lkml.org 
[lkml]   [2020]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] nvmet: add revalidation support to bdev and file backed namespaces
From
Date

> +void nvmet_bdev_ns_revalidate(struct nvmet_ns *ns)
> +{
> + loff_t size;
> +
> + size = i_size_read(ns->bdev->bd_inode);
> +
> + if (ns->size != size)
> + ns->size = size;

Why is the if useful?

> +}
> +
> static u16 blk_to_nvme_status(struct nvmet_req *req, blk_status_t blk_sts)
> {
> u16 status = NVME_SC_SUCCESS;
> diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c
> index cd5670b83118..c102437db72a 100644
> --- a/drivers/nvme/target/io-cmd-file.c
> +++ b/drivers/nvme/target/io-cmd-file.c
> @@ -80,6 +80,20 @@ int nvmet_file_ns_enable(struct nvmet_ns *ns)
> return ret;
> }
>
> +void nvmet_file_ns_revalidate(struct nvmet_ns *ns)
> +{
> + struct kstat stat;
> +
> + if (!ns->file)
> + return;

When is !ns->file expected?

\
 
 \ /
  Last update: 2020-04-03 00:15    [W:0.076 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site