[Devel] [PATCH 1/2] fs/fuse kio: backport immediate-write attribute handle
Pavel Butsykin
pbutsykin at virtuozzo.com
Mon Dec 24 18:58:09 MSK 2018
This patch provides support PCS_FATTR_IMMEDIATE_WRITE attribute for KIO module.
#VSTOR-19324
Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
fs/fuse/kio/pcs/pcs_cs.c | 3 ++-
fs/fuse/kio/pcs/pcs_prot_types.h | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/kio/pcs/pcs_cs.c b/fs/fuse/kio/pcs/pcs_cs.c
index 00cd1ae99850..1a2e64270b9e 100644
--- a/fs/fuse/kio/pcs/pcs_cs.c
+++ b/fs/fuse/kio/pcs/pcs_cs.c
@@ -515,7 +515,8 @@ void pcs_cs_submit(struct pcs_cs *cs, struct pcs_int_request *ireq)
ioh->hdr.type = PCS_CS_READ_REQ;
break;
case PCS_REQ_T_WRITE:
- ioh->hdr.type = PCS_CS_WRITE_REQ;
+ ioh->hdr.type = (ireq->dentry->fileinfo.attr.attrib & PCS_FATTR_IMMEDIATE_WRITE) ?
+ PCS_CS_WRITE_SYNC_REQ : PCS_CS_WRITE_REQ;
ioh->hdr.len += ireq->iochunk.size;
break;
case PCS_REQ_T_WRITE_HOLE:
diff --git a/fs/fuse/kio/pcs/pcs_prot_types.h b/fs/fuse/kio/pcs/pcs_prot_types.h
index 9db4516824aa..bba1f1dc76e3 100644
--- a/fs/fuse/kio/pcs/pcs_prot_types.h
+++ b/fs/fuse/kio/pcs/pcs_prot_types.h
@@ -417,6 +417,9 @@ enum
/* Don't cache content on the client */
PCS_FATTR_NO_CLNT_CACHE = 0x10000000,
+ /* Disable delayed writes for files in the directory */
+ PCS_FATTR_IMMEDIATE_WRITE = 0x40000000,
+
/* The following attributes are being inherited from the parent directory */
PCS_FATTR_INHERITABLE_MASK = 0xff000000,
};
--
2.15.1
More information about the Devel
mailing list