
From: Jeffrey Mahoney <jeffm@suse.com>

This patch moves the assignment of i_priv_object to a static inline.  This
is in preparation for selinux support in reiserfs.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/reiserfs/inode.c            |    2 ++
 25-akpm/fs/reiserfs/namei.c            |    2 +-
 25-akpm/fs/reiserfs/xattr.c            |    6 +-----
 25-akpm/fs/reiserfs/xattr_acl.c        |    2 +-
 25-akpm/include/linux/reiserfs_xattr.h |    7 +++++++
 5 files changed, 12 insertions(+), 7 deletions(-)

diff -puN fs/reiserfs/inode.c~reiserfs-private-inode-abstracted-to-static-inline fs/reiserfs/inode.c
--- 25/fs/reiserfs/inode.c~reiserfs-private-inode-abstracted-to-static-inline	2005-03-07 20:41:24.000000000 -0800
+++ 25-akpm/fs/reiserfs/inode.c	2005-03-07 20:41:24.000000000 -0800
@@ -1843,6 +1843,8 @@ int reiserfs_new_inode (struct reiserfs_
     } else if (inode->i_sb->s_flags & MS_POSIXACL) {
 	reiserfs_warning (inode->i_sb, "ACLs aren't enabled in the fs, "
 			  "but vfs thinks they are!");
+    } else if (is_reiserfs_priv_object (dir)) {
+	reiserfs_mark_inode_private (inode);
     }
 
     insert_inode_hash (inode);
diff -puN fs/reiserfs/namei.c~reiserfs-private-inode-abstracted-to-static-inline fs/reiserfs/namei.c
--- 25/fs/reiserfs/namei.c~reiserfs-private-inode-abstracted-to-static-inline	2005-03-07 20:41:24.000000000 -0800
+++ 25-akpm/fs/reiserfs/namei.c	2005-03-07 21:14:29.000000000 -0800
@@ -353,7 +353,7 @@ static struct dentry * reiserfs_lookup (
 
 	/* Propogate the priv_object flag so we know we're in the priv tree */
 	if (is_reiserfs_priv_object (dir))
-	    REISERFS_I(inode)->i_flags |= i_priv_object;
+	    reiserfs_mark_inode_private (inode);
     }
     reiserfs_write_unlock(dir->i_sb);
     if ( retval == IO_ERROR ) {
diff -puN fs/reiserfs/xattr_acl.c~reiserfs-private-inode-abstracted-to-static-inline fs/reiserfs/xattr_acl.c
--- 25/fs/reiserfs/xattr_acl.c~reiserfs-private-inode-abstracted-to-static-inline	2005-03-07 20:41:24.000000000 -0800
+++ 25-akpm/fs/reiserfs/xattr_acl.c	2005-03-07 20:41:24.000000000 -0800
@@ -339,7 +339,7 @@ reiserfs_inherit_default_acl (struct ino
      * would be useless since permissions are ignored, and a pain because
      * it introduces locking cycles */
     if (is_reiserfs_priv_object (dir)) {
-        REISERFS_I(inode)->i_flags |= i_priv_object;
+        reiserfs_mark_inode_private (inode);
         goto apply_umask;
     }
 
diff -puN fs/reiserfs/xattr.c~reiserfs-private-inode-abstracted-to-static-inline fs/reiserfs/xattr.c
--- 25/fs/reiserfs/xattr.c~reiserfs-private-inode-abstracted-to-static-inline	2005-03-07 20:41:24.000000000 -0800
+++ 25-akpm/fs/reiserfs/xattr.c	2005-03-07 20:41:24.000000000 -0800
@@ -181,8 +181,6 @@ open_xa_dir (const struct inode *inode, 
             dput (xadir);
             return ERR_PTR (-ENODATA);
         }
-        /* Newly created object.. Need to mark it private */
-        REISERFS_I(xadir->d_inode)->i_flags |= i_priv_object;
     }
 
     dput (xaroot);
@@ -230,8 +228,6 @@ get_xa_file_dentry (const struct inode *
             dput (xafile);
             goto out;
         }
-        /* Newly created object.. Need to mark it private */
-        REISERFS_I(xafile->d_inode)->i_flags |= i_priv_object;
     }
 
 out:
@@ -1316,7 +1312,7 @@ reiserfs_xattr_init (struct super_block 
 
       if (!err && dentry) {
           s->s_root->d_op = &xattr_lookup_poison_ops;
-          REISERFS_I(dentry->d_inode)->i_flags |= i_priv_object;
+          reiserfs_mark_inode_private (dentry->d_inode);
           REISERFS_SB(s)->priv_root = dentry;
       } else if (!(mount_flags & MS_RDONLY)) { /* xattrs are unavailable */
           /* If we're read-only it just means that the dir hasn't been
diff -puN include/linux/reiserfs_xattr.h~reiserfs-private-inode-abstracted-to-static-inline include/linux/reiserfs_xattr.h
--- 25/include/linux/reiserfs_xattr.h~reiserfs-private-inode-abstracted-to-static-inline	2005-03-07 20:41:24.000000000 -0800
+++ 25-akpm/include/linux/reiserfs_xattr.h	2005-03-07 21:14:55.000000000 -0800
@@ -103,9 +103,16 @@ reiserfs_read_unlock_xattr_i(struct inod
     up_read (&REISERFS_I(inode)->xattr_sem);
 }
 
+static inline void
+reiserfs_mark_inode_private(struct inode *inode)
+{
+    REISERFS_I(inode)->i_flags |= i_priv_object;
+}
+
 #else
 
 #define is_reiserfs_priv_object(inode) 0
+#define reiserfs_mark_inode_private(inode)
 #define reiserfs_getxattr NULL
 #define reiserfs_setxattr NULL
 #define reiserfs_listxattr NULL
_
