diff options
author | Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> | 2018-06-20 00:01:41 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-07-23 09:35:14 +0200 |
commit | 55eb942eda2ccbbbea61db4c1a774ba22b618046 (patch) | |
tree | cfeeeaadeaf87b88e73a6bdf2ec878fc846b8b11 /drivers/nvme/target/nvmet.h | |
parent | nvmet: add commands supported and effects log page (diff) | |
download | linux-dev-55eb942eda2ccbbbea61db4c1a774ba22b618046.tar.xz linux-dev-55eb942eda2ccbbbea61db4c1a774ba22b618046.zip |
nvmet: add buffered I/O support for file backed ns
Add a new "buffered_io" attribute, which disabled direct I/O and thus
enables page cache based caching when enabled. The attribute can only
be changed when the namespace is disabled as the file has to be reopend
for the change to take effect.
The possibly blocking read/write are deferred to a newly introduced
global workqueue.
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to '')
-rw-r--r-- | drivers/nvme/target/nvmet.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h index 480dfe10fad9..5efb98ec95df 100644 --- a/drivers/nvme/target/nvmet.h +++ b/drivers/nvme/target/nvmet.h @@ -65,6 +65,7 @@ struct nvmet_ns { u8 nguid[16]; uuid_t uuid; + bool buffered_io; bool enabled; struct nvmet_subsys *subsys; const char *device_path; @@ -269,6 +270,8 @@ struct nvmet_req { const struct nvmet_fabrics_ops *ops; }; +extern struct workqueue_struct *buffered_io_wq; + static inline void nvmet_set_status(struct nvmet_req *req, u16 status) { req->rsp->status = cpu_to_le16(status << 1); |