summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2009-03-30 14:02:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 12:16:37 -0700
commit6dfede696391133eadd7ce90b61c9573ee6e5a90 (patch)
tree2051bfc5108d0e7592b8738e43f4ae972d398ccd /fs
parent010f5a21a323e7383e067009a7785462883fe5ea (diff)
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/reiserfs/inode.c5
-rw-r--r--fs/reiserfs/namei.c7
-rw-r--r--fs/reiserfs/xattr.c14
-rw-r--r--fs/reiserfs/xattr_acl.c6
-rw-r--r--fs/reiserfs/xattr_security.c8
-rw-r--r--fs/reiserfs/xattr_trusted.c8
6 files changed, 23 insertions, 25 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index fab0373ad6e3..cd42a8658086 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -1927,9 +1927,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
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 3ce3f8b1690d..c8430f1c824f 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -358,9 +358,10 @@ static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry,
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 3e9e82ca3ba2..c5fc207e529c 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -633,14 +633,14 @@ __reiserfs_xattr_del(struct dentry *xadir, const char *name, int namelen)
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 reiserfs_delete_xattrs(struct inode *inode)
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 @@ int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs)
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 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags)
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 @@ int reiserfs_permission(struct inode *inode, int mask)
* 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 b7e4fa4539de..9128e4d5ba64 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -335,8 +335,8 @@ reiserfs_inherit_default_acl(struct inode *dir, struct dentry *dentry,
/* 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 @@ reiserfs_inherit_default_acl(struct inode *dir, struct dentry *dentry,
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 056008db1377..1958b361c35d 100644
--- a/fs/reiserfs/xattr_security.c
+++ b/fs/reiserfs/xattr_security.c
@@ -12,7 +12,7 @@ security_get(struct inode *inode, const char *name, void *buffer, size_t size)
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 @@ security_set(struct inode *inode, const char *name, const void *buffer,
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 @@ static int security_del(struct inode *inode, const char *name)
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 @@ security_list(struct inode *inode, const char *name, int namelen, char *out)
{
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 60abe2bb1f98..076ad388d489 100644
--- a/fs/reiserfs/xattr_trusted.c
+++ b/fs/reiserfs/xattr_trusted.c
@@ -16,7 +16,7 @@ trusted_get(struct inode *inode, const char *name, void *buffer, size_t size)
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 @@ trusted_set(struct inode *inode, const char *name, const void *buffer,
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 @@ static int trusted_del(struct inode *inode, const char *name)
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 @@ trusted_list(struct inode *inode, const char *name, int namelen, char *out)
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)