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

Submitted by Konstantin Khorenko on Jan. 10, 2019, 10:11 a.m.

Details

Message ID 201901101011.x0AABG09004619@finist-ce7.sw.ru
State New
Series "backport immediate-write attribute for Fast-path"
Headers show

Commit Message

Konstantin Khorenko Jan. 10, 2019, 10:11 a.m.
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@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@virtuozzo.com>
    Acked-by: Alexey Kuznetsov <kuznet@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(-)

Patch hide | download patch | download mbox

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,
 };