[Devel] [PATCH RHEL7 COMMIT] fs/fuse kio: backport immediate-write attribute handle

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jan 10 13:11:18 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.1.3.vz7.83.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.1.3.vz7.83.4
------>
commit c5c8d5017256a7bfc1566e120bd0c6ab12021d87
Author: Pavel Butsykin <pbutsykin at virtuozzo.com>
Date:   Thu Jan 10 13:11:16 2019 +0300

    fs/fuse kio: backport immediate-write attribute handle
    
    This patch provides support PCS_FATTR_IMMEDIATE_WRITE attribute for KIO module.
    
    https://pmc.acronis.com/browse/VSTOR-19396
    
    Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
    Acked-by: Alexey Kuznetsov <kuznet 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,
 };



More information about the Devel mailing list