summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBen Myers <bpm@sgi.com>2010-02-17 14:05:16 -0600
committerJ. Bruce Fields <bfields@citi.umich.edu>2010-02-20 13:14:50 -0800
commit978ebd97d1426d5708d3f353179ab81f191a7eeb (patch)
tree6456e766099798df58f315f989bbb075b14a9aec /fs
parentf501912a35c02eadc55ca9396ece55fe36f785d0 (diff)
downloadop-kernel-dev-978ebd97d1426d5708d3f353179ab81f191a7eeb.zip
op-kernel-dev-978ebd97d1426d5708d3f353179ab81f191a7eeb.tar.gz
xfs_export_operations.commit_metadata
This is the commit_metadata export operation for XFS. - Takes one inode to be committed. - Forces the log up to the lsn of the inode. - Doesn't force the log if the inode doesn't have a pincount. Signed-off-by: Ben Myers <bpm@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com> [bfields@citi.umich.edu: trivial whitespace fix] Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_export.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c
index 87b8cbd..8f4d707 100644
--- a/fs/xfs/linux-2.6/xfs_export.c
+++ b/fs/xfs/linux-2.6/xfs_export.c
@@ -29,6 +29,7 @@
#include "xfs_vnodeops.h"
#include "xfs_bmap_btree.h"
#include "xfs_inode.h"
+#include "xfs_inode_item.h"
/*
* Note that we only accept fileids which are long enough rather than allow
@@ -215,9 +216,28 @@ xfs_fs_get_parent(
return d_obtain_alias(VFS_I(cip));
}
+STATIC int
+xfs_fs_nfs_commit_metadata(
+ struct inode *inode)
+{
+ struct xfs_inode *ip = XFS_I(inode);
+ struct xfs_mount *mp = ip->i_mount;
+ int error = 0;
+
+ xfs_ilock(ip, XFS_ILOCK_SHARED);
+ if (xfs_ipincount(ip)) {
+ error = _xfs_log_force(mp, ip->i_itemp->ili_last_lsn,
+ XFS_LOG_FORCE | XFS_LOG_SYNC, NULL);
+ }
+ xfs_iunlock(ip, XFS_ILOCK_SHARED);
+
+ return error;
+}
+
const struct export_operations xfs_export_operations = {
.encode_fh = xfs_fs_encode_fh,
.fh_to_dentry = xfs_fs_fh_to_dentry,
.fh_to_parent = xfs_fs_fh_to_parent,
.get_parent = xfs_fs_get_parent,
+ .commit_metadata = xfs_fs_nfs_commit_metadata,
};
OpenPOWER on IntegriCloud