]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: use i_size_read() to set size for file-ns
authorChaitanya Kulkarni <kch@nvidia.com>
Wed, 2 Feb 2022 09:04:44 +0000 (01:04 -0800)
committerChristoph Hellwig <hch@lst.de>
Mon, 28 Feb 2022 11:45:05 +0000 (13:45 +0200)
commit15eee51afa075ed1cd7ae419e236693cedf6ec72
treee6aee65b3cd522347626a22444bb50bf6e34c47e
parent0e232bfb87c683f4b2c6ca76f5479ddb796591d3
nvmet: use i_size_read() to set size for file-ns

Instead of calling vfs_getattr() use i_size_read() to read the size of
file so we can read the size of not only file type but also block type
with one call. This is needed to implement buffered_io support for the
NVMeOF block device backend.

We also change return type of function nvmet_file_ns_revalidate() from
int to void, since this function does not return any meaning value.

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/io-cmd-file.c
drivers/nvme/target/nvmet.h