reiserfs: remove IS_PRIVATE helpers
There are a number of helper functions for marking a reiserfs inode
private that were leftover from reiserfs did its own thing wrt to
private inodes. S_PRIVATE has been in the kernel for some time, so this
patch removes the helpers and uses IS_PRIVATE instead.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index fab0373..cd42a86 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -1927,9 +1927,8 @@
reiserfs_warning(inode->i_sb, "jdm-13090",
"ACLs aren't enabled in the fs, "
"but vfs thinks they are!");
- } else if (is_reiserfs_priv_object(dir)) {
- reiserfs_mark_inode_private(inode);
- }
+ } else if (IS_PRIVATE(dir))
+ inode->i_flags |= S_PRIVATE;
reiserfs_update_sd(th, inode);
reiserfs_check_path(&path_to_key);
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 3ce3f8b..c8430f1 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -358,9 +358,10 @@
return ERR_PTR(-EACCES);
}
- /* Propogate the priv_object flag so we know we're in the priv tree */
- if (is_reiserfs_priv_object(dir))
- reiserfs_mark_inode_private(inode);
+ /* Propagate the private flag so we know we're
+ * in the priv tree */
+ if (IS_PRIVATE(dir))
+ inode->i_flags |= S_PRIVATE;
}
reiserfs_write_unlock(dir->i_sb);
if (retval == IO_ERROR) {
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 3e9e82c..c5fc207 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -633,14 +633,14 @@
if (S_ISDIR(dentry->d_inode->i_mode))
goto out_file;
- if (!is_reiserfs_priv_object(dentry->d_inode)) {
+ if (!IS_PRIVATE(dentry->d_inode)) {
reiserfs_error(dir->i_sb, "jdm-20003",
"OID %08x [%.*s/%.*s] doesn't have "
"priv flag set [parent is %sset].",
le32_to_cpu(INODE_PKEY(dentry->d_inode)->
k_objectid), xadir->d_name.len,
xadir->d_name.name, namelen, name,
- is_reiserfs_priv_object(xadir->d_inode) ? "" :
+ IS_PRIVATE(xadir->d_inode) ? "" :
"not ");
dput(dentry);
return -EIO;
@@ -701,8 +701,7 @@
int err = 0;
/* Skip out, an xattr has no xattrs associated with it */
- if (is_reiserfs_priv_object(inode) ||
- get_inode_sd_version(inode) == STAT_DATA_V1 ||
+ if (IS_PRIVATE(inode) || get_inode_sd_version(inode) == STAT_DATA_V1 ||
!reiserfs_xattrs(inode->i_sb)) {
return 0;
}
@@ -786,8 +785,7 @@
unsigned int ia_valid = attrs->ia_valid;
/* Skip out, an xattr has no xattrs associated with it */
- if (is_reiserfs_priv_object(inode) ||
- get_inode_sd_version(inode) == STAT_DATA_V1 ||
+ if (IS_PRIVATE(inode) || get_inode_sd_version(inode) == STAT_DATA_V1 ||
!reiserfs_xattrs(inode->i_sb)) {
return 0;
}
@@ -1178,7 +1176,7 @@
if (!err && dentry) {
s->s_root->d_op = &xattr_lookup_poison_ops;
- reiserfs_mark_inode_private(dentry->d_inode);
+ dentry->d_inode->i_flags |= S_PRIVATE;
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
@@ -1239,7 +1237,7 @@
* We don't do permission checks on the internal objects.
* Permissions are determined by the "owning" object.
*/
- if (is_reiserfs_priv_object(inode))
+ if (IS_PRIVATE(inode))
return 0;
/*
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
index b7e4fa4..9128e4d 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -335,8 +335,8 @@
/* Don't apply ACLs to objects in the .reiserfs_priv tree.. This
* would be useless since permissions are ignored, and a pain because
* it introduces locking cycles */
- if (is_reiserfs_priv_object(dir)) {
- reiserfs_mark_inode_private(inode);
+ if (IS_PRIVATE(dir)) {
+ inode->i_flags |= S_PRIVATE;
goto apply_umask;
}
@@ -401,7 +401,7 @@
int reiserfs_cache_default_acl(struct inode *inode)
{
int ret = 0;
- if (reiserfs_posixacl(inode->i_sb) && !is_reiserfs_priv_object(inode)) {
+ if (reiserfs_posixacl(inode->i_sb) && !IS_PRIVATE(inode)) {
struct posix_acl *acl;
reiserfs_read_lock_xattr_i(inode);
reiserfs_read_lock_xattrs(inode->i_sb);
diff --git a/fs/reiserfs/xattr_security.c b/fs/reiserfs/xattr_security.c
index 056008d..1958b36 100644
--- a/fs/reiserfs/xattr_security.c
+++ b/fs/reiserfs/xattr_security.c
@@ -12,7 +12,7 @@
if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
return -EINVAL;
- if (is_reiserfs_priv_object(inode))
+ if (IS_PRIVATE(inode))
return -EPERM;
return reiserfs_xattr_get(inode, name, buffer, size);
@@ -25,7 +25,7 @@
if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
return -EINVAL;
- if (is_reiserfs_priv_object(inode))
+ if (IS_PRIVATE(inode))
return -EPERM;
return reiserfs_xattr_set(inode, name, buffer, size, flags);
@@ -36,7 +36,7 @@
if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
return -EINVAL;
- if (is_reiserfs_priv_object(inode))
+ if (IS_PRIVATE(inode))
return -EPERM;
return 0;
@@ -47,7 +47,7 @@
{
int len = namelen;
- if (is_reiserfs_priv_object(inode))
+ if (IS_PRIVATE(inode))
return 0;
if (out)
diff --git a/fs/reiserfs/xattr_trusted.c b/fs/reiserfs/xattr_trusted.c
index 60abe2b..076ad38 100644
--- a/fs/reiserfs/xattr_trusted.c
+++ b/fs/reiserfs/xattr_trusted.c
@@ -16,7 +16,7 @@
if (!reiserfs_xattrs(inode->i_sb))
return -EOPNOTSUPP;
- if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode)))
+ if (!(capable(CAP_SYS_ADMIN) || IS_PRIVATE(inode)))
return -EPERM;
return reiserfs_xattr_get(inode, name, buffer, size);
@@ -32,7 +32,7 @@
if (!reiserfs_xattrs(inode->i_sb))
return -EOPNOTSUPP;
- if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode)))
+ if (!(capable(CAP_SYS_ADMIN) || IS_PRIVATE(inode)))
return -EPERM;
return reiserfs_xattr_set(inode, name, buffer, size, flags);
@@ -46,7 +46,7 @@
if (!reiserfs_xattrs(inode->i_sb))
return -EOPNOTSUPP;
- if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode)))
+ if (!(capable(CAP_SYS_ADMIN) || IS_PRIVATE(inode)))
return -EPERM;
return 0;
@@ -60,7 +60,7 @@
if (!reiserfs_xattrs(inode->i_sb))
return 0;
- if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode)))
+ if (!(capable(CAP_SYS_ADMIN) || IS_PRIVATE(inode)))
return 0;
if (out)
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index af135ae..58f32ba 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -44,7 +44,6 @@
};
#ifdef CONFIG_REISERFS_FS_XATTR
-#define is_reiserfs_priv_object(inode) IS_PRIVATE(inode)
#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir)
ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name,
void *buffer, size_t size);
@@ -104,11 +103,6 @@
up_read(&REISERFS_I(inode)->xattr_sem);
}
-static inline void reiserfs_mark_inode_private(struct inode *inode)
-{
- inode->i_flags |= S_PRIVATE;
-}
-
static inline void reiserfs_init_xattr_rwsem(struct inode *inode)
{
init_rwsem(&REISERFS_I(inode)->xattr_sem);
@@ -116,8 +110,6 @@
#else
-#define is_reiserfs_priv_object(inode) 0
-#define reiserfs_mark_inode_private(inode) do {;} while(0)
#define reiserfs_getxattr NULL
#define reiserfs_setxattr NULL
#define reiserfs_listxattr NULL