summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.h
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2015-02-24 10:24:07 +1100
committerDave Chinner <david@fromorbit.com>2015-02-24 10:24:07 +1100
commit3cabb836d801c3ad791c2dc6be07ec5819ab0a37 (patch)
treedbc5bff557d23e978fd3c8920c7d99d8c09fa272 /fs/xfs/xfs_inode.h
parent83d5f01858b56db69c8e4ca5389ef7c29bfdb5dd (diff)
parent444a702231412e82fb1c09679adc159301e9242c (diff)
downloadlinux-3cabb836d801c3ad791c2dc6be07ec5819ab0a37.tar.bz2
Merge branch 'xfs-misc-fixes-for-4.1' into for-next
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r--fs/xfs/xfs_inode.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index a1cd55f3f351..c73b63d51bc1 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -391,6 +391,28 @@ int xfs_zero_eof(struct xfs_inode *ip, xfs_off_t offset,
int xfs_iozero(struct xfs_inode *ip, loff_t pos, size_t count);
+/* from xfs_iops.c */
+/*
+ * When setting up a newly allocated inode, we need to call
+ * xfs_finish_inode_setup() once the inode is fully instantiated at
+ * the VFS level to prevent the rest of the world seeing the inode
+ * before we've completed instantiation. Otherwise we can do it
+ * the moment the inode lookup is complete.
+ */
+extern void xfs_setup_inode(struct xfs_inode *ip);
+static inline void xfs_finish_inode_setup(struct xfs_inode *ip)
+{
+ xfs_iflags_clear(ip, XFS_INEW);
+ barrier();
+ unlock_new_inode(VFS_I(ip));
+}
+
+static inline void xfs_setup_existing_inode(struct xfs_inode *ip)
+{
+ xfs_setup_inode(ip);
+ xfs_finish_inode_setup(ip);
+}
+
#define IHOLD(ip) \
do { \
ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \