diff options
author | Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> | 2020-05-19 11:06:27 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-05-27 08:12:38 +0300 |
commit | 463c5fabb8dfca4941c4c50365bb7749ac5c9916 (patch) | |
tree | 486190dfe5aae498989c7ec45915db60da99ea06 /drivers/nvme/target/core.c | |
parent | 696ece751366e7a02a81fa0228125fe25a47969d (diff) | |
download | linux-463c5fabb8dfca4941c4c50365bb7749ac5c9916.tar.xz |
nvmet: add helper to revalidate bdev and file ns
This patch adds a wrapper helper to indicate size change in the bdev &
file-backed namespace when revalidating ns. This helper is needed in
order to minimize code repetition in the next patch for configfs.c and
existing admin-cmd.c.
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Sagi Grimberg <sagi@grimbeg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/target/core.c')
-rw-r--r-- | drivers/nvme/target/core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 7ce3d3b0f5d6..ee5865568588 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -515,6 +515,14 @@ static void nvmet_p2pmem_ns_add_p2p(struct nvmet_ctrl *ctrl, ns->nsid); } +void nvmet_ns_revalidate(struct nvmet_ns *ns) +{ + if (ns->bdev) + nvmet_bdev_ns_revalidate(ns); + else + nvmet_file_ns_revalidate(ns); +} + int nvmet_ns_enable(struct nvmet_ns *ns) { struct nvmet_subsys *subsys = ns->subsys; |