Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5bb89b47 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS



The LAYOUTCOMMIT operation means different things to different layout types.
For blocks and objects, it is both a data and metadata consistency operation.
For files and flexfiles, it is only a metadata consistency operation.

This patch separates out the 2 cases, allowing the files/flexfiles layout
drivers to optimise away the data consistency calls to layoutcommit.

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 7140171e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -890,6 +890,7 @@ static struct pnfs_layoutdriver_type blocklayout_type = {
	.free_deviceid_node		= bl_free_deviceid_node,
	.pg_read_ops			= &bl_pg_read_ops,
	.pg_write_ops			= &bl_pg_write_ops,
	.sync				= pnfs_generic_sync,
};

static int __init nfs4blocklayout_init(void)
+1 −0
Original line number Diff line number Diff line
@@ -1139,6 +1139,7 @@ static struct pnfs_layoutdriver_type filelayout_type = {
	.write_pagelist		= filelayout_write_pagelist,
	.alloc_deviceid_node	= filelayout_alloc_deviceid_node,
	.free_deviceid_node	= filelayout_free_deviceid_node,
	.sync			= pnfs_nfs_generic_sync,
};

static int __init nfs4filelayout_init(void)
+1 −0
Original line number Diff line number Diff line
@@ -1509,6 +1509,7 @@ static struct pnfs_layoutdriver_type flexfilelayout_type = {
	.write_pagelist		= ff_layout_write_pagelist,
	.alloc_deviceid_node    = ff_layout_alloc_deviceid_node,
	.encode_layoutreturn    = ff_layout_encode_layoutreturn,
	.sync			= pnfs_nfs_generic_sync,
};

static int __init nfs4flexfilelayout_init(void)
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
		mutex_lock(&inode->i_mutex);
		ret = nfs_file_fsync_commit(file, start, end, datasync);
		if (!ret)
			ret = pnfs_layoutcommit_inode(inode, true);
			ret = pnfs_sync_inode(inode, !!datasync);
		mutex_unlock(&inode->i_mutex);
		/*
		 * If nfs_file_fsync_commit detected a server reboot, then
+2 −0
Original line number Diff line number Diff line
@@ -637,6 +637,8 @@ static struct pnfs_layoutdriver_type objlayout_type = {
	.pg_read_ops             = &objio_pg_read_ops,
	.pg_write_ops            = &objio_pg_write_ops,

	.sync			 = pnfs_generic_sync,

	.free_deviceid_node	 = objio_free_deviceid_node,

	.encode_layoutcommit	 = objlayout_encode_layoutcommit,
Loading