[Devel] [PATCH RHEL7 COMMIT] fs/fuse kio: add support PCS_CS_IO_SYNC flag

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jan 10 13:11:19 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 7fae4e7e21417dcd7dd998ec7f3667d18ba2fba6
Author: Pavel Butsykin <pbutsykin at virtuozzo.com>
Date:   Thu Jan 10 13:11:17 2019 +0300

    fs/fuse kio: add support PCS_CS_IO_SYNC flag
    
    In case PCS_FATTR_IMMEDIATE_WRITE attribute is set, all write operations must
    be synchronous, although now it's not and there is only PCS_CS_WRITE_SYNC_REQ
    for PCS_REQ_T_WRITE. Adding PCS_CS_IO_SYNC flag makes it possible to handle any
    write request synchronously.
    
    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_cs_prot.h | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/fs/fuse/kio/pcs/pcs_cs.c b/fs/fuse/kio/pcs/pcs_cs.c
index 1a2e64270b9e..60e2dc545cc5 100644
--- a/fs/fuse/kio/pcs/pcs_cs.c
+++ b/fs/fuse/kio/pcs/pcs_cs.c
@@ -541,6 +541,9 @@ void pcs_cs_submit(struct pcs_cs *cs, struct pcs_int_request *ireq)
 	if (ireq->flags & IREQ_F_SEQ)
 		ioh->sync.misc = PCS_CS_IO_SEQ;
 
+	if (ireq->dentry->fileinfo.attr.attrib & PCS_FATTR_IMMEDIATE_WRITE)
+		ioh->sync.misc |= PCS_CS_IO_SYNC;
+
 	msg->size = ioh->hdr.len;
 	msg->rpc = NULL;
 	pcs_clear_error(&msg->error);
diff --git a/fs/fuse/kio/pcs/pcs_cs_prot.h b/fs/fuse/kio/pcs/pcs_cs_prot.h
index 7de7dd1bea6b..8ca6cbabf741 100644
--- a/fs/fuse/kio/pcs/pcs_cs_prot.h
+++ b/fs/fuse/kio/pcs/pcs_cs_prot.h
@@ -24,6 +24,10 @@ struct pcs_cs_sync_data
  */
 #define PCS_CS_IO_CACHED	(1ULL<<63)	/* Resp: result is read from cache or written ahead to journal */
 #define PCS_CS_IO_SEQ		(1ULL<<62)	/* Req: request is part of sequential flow */
+#define PCS_CS_IO_SYNC		(1ULL<<60)	/* Req: Write operations will be performed synchronously.
+						 *	This means that at the req completion time, the output
+						 *	data will be transferred to disk.
+						 */
 
 #define PCS_CS_RESET_TS_RECV(sdata, ts)	do { (sdata)->misc = ((u64)ts & 0xFFFFFFFFFFFFFULL); } while (0)
 #define PCS_CS_SET_TS_RECV(sdata, ts)	do { (sdata)->misc = ((sdata)->misc & ~0xFFFFFFFFFFFFFULL) | ((u64)ts & 0xFFFFFFFFFFFFFULL); } while (0)



More information about the Devel mailing list