tree:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
fscache-iter
head: 757ac8b16a0edd3befa15c9bdcb2ab3811be945d
commit: e7242eaae0e94cafdcbe04c110ab787715b618b5 [37/60] fscache: Add read helper
config: microblaze-randconfig-r026-20200723 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout e7242eaae0e94cafdcbe04c110ab787715b618b5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
microblaze-linux-ld: fs/fscache/read_helper.o: in function `fscache_write':
> include/linux/fscache.h:607: undefined reference to
`__fscache_write'
microblaze-linux-ld: fs/fscache/read_helper.o: in function
`fscache_read':
> include/linux/fscache.h:573: undefined reference to
`__fscache_read'
microblaze-linux-ld: fs/fscache/read_helper.o: in function
`queue_work':
> include/linux/workqueue.h:507: undefined reference to
`fscache_op_wq'
> microblaze-linux-ld: include/linux/workqueue.h:507: undefined reference to
`fscache_op_wq'
microblaze-linux-ld: fs/fscache/read_helper.o: in function
`fscache_shape_request':
> include/linux/fscache.h:542: undefined reference to
`__fscache_shape_request'
vim +607 include/linux/fscache.h
076cf3d60a360f3 David Howells 2020-02-06 511
076cf3d60a360f3 David Howells 2020-02-06 512 /**
076cf3d60a360f3 David Howells 2020-02-06 513 * fscache_shape_request - Shape an request
to fit cache granulation
076cf3d60a360f3 David Howells 2020-02-06 514 * @cookie: The cache cookie to access
076cf3d60a360f3 David Howells 2020-02-06 515 * @shape: The request proposed by the
VM/filesystem (gets modified).
076cf3d60a360f3 David Howells 2020-02-06 516 *
076cf3d60a360f3 David Howells 2020-02-06 517 * Shape the size and position of a cache
I/O request such that either the
076cf3d60a360f3 David Howells 2020-02-06 518 * region will entirely be read from the
server or entirely read from the
076cf3d60a360f3 David Howells 2020-02-06 519 * cache. The proposed region may be
adjusted by a combination of extending
076cf3d60a360f3 David Howells 2020-02-06 520 * the front forward and/or extending or
shrinking the end. In any case, the
076cf3d60a360f3 David Howells 2020-02-06 521 * first page of the proposed request will
be contained in the revised extent.
076cf3d60a360f3 David Howells 2020-02-06 522 *
076cf3d60a360f3 David Howells 2020-02-06 523 * The function sets shape->to_be_done
to FSCACHE_READ_FROM_CACHE to indicate
076cf3d60a360f3 David Howells 2020-02-06 524 * that the data is resident in the cache
and can be read from there,
076cf3d60a360f3 David Howells 2020-02-06 525 * FSCACHE_WRITE_TO_CACHE to indicate that
the data isn't present, but the
076cf3d60a360f3 David Howells 2020-02-06 526 * netfs should write it,
FSCACHE_FILL_WITH_ZERO to indicate that the data
076cf3d60a360f3 David Howells 2020-02-06 527 * should be all zeros on the server and
can just be fabricated locally or
076cf3d60a360f3 David Howells 2020-02-06 528 * FSCACHE_READ_FROM_SERVER to indicate
that there's no cache or an error
076cf3d60a360f3 David Howells 2020-02-06 529 * occurred and the netfs should just read
from the server.
076cf3d60a360f3 David Howells 2020-02-06 530 */
076cf3d60a360f3 David Howells 2020-02-06 531 static inline
076cf3d60a360f3 David Howells 2020-02-06 532 void fscache_shape_request(struct
fscache_cookie *cookie,
076cf3d60a360f3 David Howells 2020-02-06 533 struct fscache_request_shape *shape)
076cf3d60a360f3 David Howells 2020-02-06 534 {
076cf3d60a360f3 David Howells 2020-02-06 535 shape->to_be_done =
FSCACHE_READ_FROM_SERVER;
076cf3d60a360f3 David Howells 2020-02-06 536 shape->granularity = 1;
076cf3d60a360f3 David Howells 2020-02-06 537 shape->dio_block_size = 1;
076cf3d60a360f3 David Howells 2020-02-06 538 shape->actual_nr_pages =
shape->proposed_nr_pages;
076cf3d60a360f3 David Howells 2020-02-06 539 shape->actual_start =
shape->proposed_start;
076cf3d60a360f3 David Howells 2020-02-06 540
076cf3d60a360f3 David Howells 2020-02-06 541 if (fscache_cookie_valid(cookie))
076cf3d60a360f3 David Howells 2020-02-06 @542 __fscache_shape_request(cookie, shape);
076cf3d60a360f3 David Howells 2020-02-06 543 else if (((loff_t)shape->proposed_start
<< PAGE_SHIFT) >= shape->i_size)
076cf3d60a360f3 David Howells 2020-02-06 544 shape->to_be_done =
FSCACHE_FILL_WITH_ZERO;
076cf3d60a360f3 David Howells 2020-02-06 545 }
076cf3d60a360f3 David Howells 2020-02-06 546
076cf3d60a360f3 David Howells 2020-02-06 547 /**
076cf3d60a360f3 David Howells 2020-02-06 548 * fscache_read - Read data from the
cache.
076cf3d60a360f3 David Howells 2020-02-06 549 * @req: The I/O request descriptor
076cf3d60a360f3 David Howells 2020-02-06 550 * @iter: The buffer to read into
076cf3d60a360f3 David Howells 2020-02-06 551 *
076cf3d60a360f3 David Howells 2020-02-06 552 * The cache will attempt to read from the
object referred to by the cookie,
076cf3d60a360f3 David Howells 2020-02-06 553 * using the size and position described in
the request. The data will be
076cf3d60a360f3 David Howells 2020-02-06 554 * transferred to the buffer described by
the iterator specified in the request.
076cf3d60a360f3 David Howells 2020-02-06 555 *
076cf3d60a360f3 David Howells 2020-02-06 556 * If this fails or can't be done, an
error will be set in the request
076cf3d60a360f3 David Howells 2020-02-06 557 * descriptor and the netfs must reissue
the read to the server.
076cf3d60a360f3 David Howells 2020-02-06 558 *
076cf3d60a360f3 David Howells 2020-02-06 559 * Note that the length and position of the
request should be aligned to the DIO
076cf3d60a360f3 David Howells 2020-02-06 560 * block size returned by
fscache_shape_request().
076cf3d60a360f3 David Howells 2020-02-06 561 *
076cf3d60a360f3 David Howells 2020-02-06 562 * If req->done is set, the request will
be submitted as asynchronous I/O and
076cf3d60a360f3 David Howells 2020-02-06 563 * -EIOCBQUEUED may be returned to indicate
that the operation is in progress.
076cf3d60a360f3 David Howells 2020-02-06 564 * The done function will be called when
the operation is concluded either way.
076cf3d60a360f3 David Howells 2020-02-06 565 *
076cf3d60a360f3 David Howells 2020-02-06 566 * If req->done is not set, the request
will be submitted as synchronous I/O and
076cf3d60a360f3 David Howells 2020-02-06 567 * will be completed before the function
returns.
076cf3d60a360f3 David Howells 2020-02-06 568 */
076cf3d60a360f3 David Howells 2020-02-06 569 static inline
076cf3d60a360f3 David Howells 2020-02-06 570 int fscache_read(struct fscache_io_request
*req, struct iov_iter *iter)
076cf3d60a360f3 David Howells 2020-02-06 571 {
076cf3d60a360f3 David Howells 2020-02-06 572 if (fscache_cookie_valid(req->cookie))
076cf3d60a360f3 David Howells 2020-02-06 @573 return __fscache_read(req, iter);
076cf3d60a360f3 David Howells 2020-02-06 574 req->error = -ENODATA;
076cf3d60a360f3 David Howells 2020-02-06 575 if (req->io_done)
076cf3d60a360f3 David Howells 2020-02-06 576 req->io_done(req);
076cf3d60a360f3 David Howells 2020-02-06 577 return -ENODATA;
076cf3d60a360f3 David Howells 2020-02-06 578 }
076cf3d60a360f3 David Howells 2020-02-06 579
076cf3d60a360f3 David Howells 2020-02-06 580
076cf3d60a360f3 David Howells 2020-02-06 581 /**
076cf3d60a360f3 David Howells 2020-02-06 582 * fscache_write - Write data to the
cache.
076cf3d60a360f3 David Howells 2020-02-06 583 * @req: The I/O request description
076cf3d60a360f3 David Howells 2020-02-06 584 * @iter: The data to write
076cf3d60a360f3 David Howells 2020-02-06 585 *
076cf3d60a360f3 David Howells 2020-02-06 586 * The cache will attempt to write to the
object referred to by the cookie,
076cf3d60a360f3 David Howells 2020-02-06 587 * using the size and position described in
the request. The data will be
076cf3d60a360f3 David Howells 2020-02-06 588 * transferred from the iterator specified
in the request.
076cf3d60a360f3 David Howells 2020-02-06 589 *
076cf3d60a360f3 David Howells 2020-02-06 590 * If this fails or can't be done, an
error will be set in the request
076cf3d60a360f3 David Howells 2020-02-06 591 * descriptor.
076cf3d60a360f3 David Howells 2020-02-06 592 *
076cf3d60a360f3 David Howells 2020-02-06 593 * Note that the length and position of the
request should be aligned to the DIO
076cf3d60a360f3 David Howells 2020-02-06 594 * block size returned by
fscache_shape_request().
076cf3d60a360f3 David Howells 2020-02-06 595 *
076cf3d60a360f3 David Howells 2020-02-06 596 * If req->io_done is set, the request
will be submitted as asynchronous I/O and
076cf3d60a360f3 David Howells 2020-02-06 597 * -EIOCBQUEUED may be returned to indicate
that the operation is in progress.
076cf3d60a360f3 David Howells 2020-02-06 598 * The done function will be called when
the operation is concluded either way.
076cf3d60a360f3 David Howells 2020-02-06 599 *
076cf3d60a360f3 David Howells 2020-02-06 600 * If req->io_done is not set, the
request will be submitted as synchronous I/O and
076cf3d60a360f3 David Howells 2020-02-06 601 * will be completed before the function
returns.
076cf3d60a360f3 David Howells 2020-02-06 602 */
076cf3d60a360f3 David Howells 2020-02-06 603 static inline
076cf3d60a360f3 David Howells 2020-02-06 604 int fscache_write(struct fscache_io_request
*req, struct iov_iter *iter)
076cf3d60a360f3 David Howells 2020-02-06 605 {
076cf3d60a360f3 David Howells 2020-02-06 606 if (fscache_cookie_valid(req->cookie))
076cf3d60a360f3 David Howells 2020-02-06 @607 return __fscache_write(req, iter);
076cf3d60a360f3 David Howells 2020-02-06 608 req->error = -ENOBUFS;
076cf3d60a360f3 David Howells 2020-02-06 609 if (req->io_done)
076cf3d60a360f3 David Howells 2020-02-06 610 req->io_done(req);
076cf3d60a360f3 David Howells 2020-02-06 611 return -ENOBUFS;
076cf3d60a360f3 David Howells 2020-02-06 612 }
076cf3d60a360f3 David Howells 2020-02-06 613
:::::: The code at line 607 was first introduced by commit
:::::: 076cf3d60a360f3b1faa84626b1ad93a6db4709f fscache: Rewrite the I/O API based on
iov_iter
:::::: TO: David Howells <dhowells(a)redhat.com>
:::::: CC: David Howells <dhowells(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org