aboutsummaryrefslogtreecommitdiffstats
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 15:16:37 -0400
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,
1927 reiserfs_warning(inode->i_sb, "jdm-13090", 1927 reiserfs_warning(inode->i_sb, "jdm-13090",
1928 "ACLs aren't enabled in the fs, " 1928 "ACLs aren't enabled in the fs, "
1929 "but vfs thinks they are!"); 1929 "but vfs thinks they are!");
1930 } else if (is_reiserfs_priv_object(dir)) { 1930 } else if (IS_PRIVATE(dir))
1931 reiserfs_mark_inode_private(inode); 1931 inode->i_flags |= S_PRIVATE;
1932 }
1933 1932
1934 reiserfs_update_sd(th, inode); 1933 reiserfs_update_sd(th, inode);
1935 reiserfs_check_path(&path_to_key); 1934 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,
358 return ERR_PTR(-EACCES); 358 return ERR_PTR(-EACCES);
359 } 359 }
360 360
361 /* Propogate the priv_object flag so we know we're in the priv tree */ 361 /* Propagate the private flag so we know we're
362 if (is_reiserfs_priv_object(dir)) 362 * in the priv tree */
363 reiserfs_mark_inode_private(inode); 363 if (IS_PRIVATE(dir))
364 inode->i_flags |= S_PRIVATE;
364 } 365 }
365 reiserfs_write_unlock(dir->i_sb); 366 reiserfs_write_unlock(dir->i_sb);
366 if (retval == IO_ERROR) { 367 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)
633 if (S_ISDIR(dentry->d_inode->i_mode)) 633 if (S_ISDIR(dentry->d_inode->i_mode))
634 goto out_file; 634 goto out_file;
635 635
636 if (!is_reiserfs_priv_object(dentry->d_inode)) { 636 if (!IS_PRIVATE(dentry->d_inode)) {
637 reiserfs_error(dir->i_sb, "jdm-20003", 637 reiserfs_error(dir->i_sb, "jdm-20003",
638 "OID %08x [%.*s/%.*s] doesn't have " 638 "OID %08x [%.*s/%.*s] doesn't have "
639 "priv flag set [parent is %sset].", 639 "priv flag set [parent is %sset].",
640 le32_to_cpu(INODE_PKEY(dentry->d_inode)-> 640 le32_to_cpu(INODE_PKEY(dentry->d_inode)->
641 k_objectid), xadir->d_name.len, 641 k_objectid), xadir->d_name.len,
642 xadir->d_name.name, namelen, name, 642 xadir->d_name.name, namelen, name,
643 is_reiserfs_priv_object(xadir->d_inode) ? "" : 643 IS_PRIVATE(xadir->d_inode) ? "" :
644 "not "); 644 "not ");
645 dput(dentry); 645 dput(dentry);
646 return -EIO; 646 return -EIO;
@@ -701,8 +701,7 @@ int reiserfs_delete_xattrs(struct inode *inode)
701 int err = 0; 701 int err = 0;
702 702
703 /* Skip out, an xattr has no xattrs associated with it */ 703 /* Skip out, an xattr has no xattrs associated with it */
704 if (is_reiserfs_priv_object(inode) || 704 if (IS_PRIVATE(inode) || get_inode_sd_version(inode) == STAT_DATA_V1 ||
705 get_inode_sd_version(inode) == STAT_DATA_V1 ||
706 !reiserfs_xattrs(inode->i_sb)) { 705 !reiserfs_xattrs(inode->i_sb)) {
707 return 0; 706 return 0;
708 } 707 }
@@ -786,8 +785,7 @@ int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs)
786 unsigned int ia_valid = attrs->ia_valid; 785 unsigned int ia_valid = attrs->ia_valid;
787 786
788 /* Skip out, an xattr has no xattrs associated with it */ 787 /* Skip out, an xattr has no xattrs associated with it */
789 if (is_reiserfs_priv_object(inode) || 788 if (IS_PRIVATE(inode) || get_inode_sd_version(inode) == STAT_DATA_V1 ||
790 get_inode_sd_version(inode) == STAT_DATA_V1 ||
791 !reiserfs_xattrs(inode->i_sb)) { 789 !reiserfs_xattrs(inode->i_sb)) {
792 return 0; 790 return 0;
793 } 791 }
@@ -1178,7 +1176,7 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags)
1178 1176
1179 if (!err && dentry) { 1177 if (!err && dentry) {
1180 s->s_root->d_op = &xattr_lookup_poison_ops; 1178 s->s_root->d_op = &xattr_lookup_poison_ops;
1181 reiserfs_mark_inode_private(dentry->d_inode); 1179 dentry->d_inode->i_flags |= S_PRIVATE;
1182 REISERFS_SB(s)->priv_root = dentry; 1180 REISERFS_SB(s)->priv_root = dentry;
1183 } else if (!(mount_flags & MS_RDONLY)) { /* xattrs are unavailable */ 1181 } else if (!(mount_flags & MS_RDONLY)) { /* xattrs are unavailable */
1184 /* If we're read-only it just means that the dir hasn't been 1182 /* 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)
1239 * We don't do permission checks on the internal objects. 1237 * We don't do permission checks on the internal objects.
1240 * Permissions are determined by the "owning" object. 1238 * Permissions are determined by the "owning" object.
1241 */ 1239 */
1242 if (is_reiserfs_priv_object(inode)) 1240 if (IS_PRIVATE(inode))
1243 return 0; 1241 return 0;
1244 1242
1245 /* 1243 /*
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,
335 /* Don't apply ACLs to objects in the .reiserfs_priv tree.. This 335 /* Don't apply ACLs to objects in the .reiserfs_priv tree.. This
336 * would be useless since permissions are ignored, and a pain because 336 * would be useless since permissions are ignored, and a pain because
337 * it introduces locking cycles */ 337 * it introduces locking cycles */
338 if (is_reiserfs_priv_object(dir)) { 338 if (IS_PRIVATE(dir)) {
339 reiserfs_mark_inode_private(inode); 339 inode->i_flags |= S_PRIVATE;
340 goto apply_umask; 340 goto apply_umask;
341 } 341 }
342 342
@@ -401,7 +401,7 @@ reiserfs_inherit_default_acl(struct inode *dir, struct dentry *dentry,
401int reiserfs_cache_default_acl(struct inode *inode) 401int reiserfs_cache_default_acl(struct inode *inode)
402{ 402{
403 int ret = 0; 403 int ret = 0;
404 if (reiserfs_posixacl(inode->i_sb) && !is_reiserfs_priv_object(inode)) { 404 if (reiserfs_posixacl(inode->i_sb) && !IS_PRIVATE(inode)) {
405 struct posix_acl *acl; 405 struct posix_acl *acl;
406 reiserfs_read_lock_xattr_i(inode); 406 reiserfs_read_lock_xattr_i(inode);
407 reiserfs_read_lock_xattrs(inode->i_sb); 407 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)
12 if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX)) 12 if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
13 return -EINVAL; 13 return -EINVAL;
14 14
15 if (is_reiserfs_priv_object(inode)) 15 if (IS_PRIVATE(inode))
16 return -EPERM; 16 return -EPERM;
17 17
18 return reiserfs_xattr_get(inode, name, buffer, size); 18 return reiserfs_xattr_get(inode, name, buffer, size);
@@ -25,7 +25,7 @@ security_set(struct inode *inode, const char *name, const void *buffer,
25 if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX)) 25 if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
26 return -EINVAL; 26 return -EINVAL;
27 27
28 if (is_reiserfs_priv_object(inode)) 28 if (IS_PRIVATE(inode))
29 return -EPERM; 29 return -EPERM;
30 30
31 return reiserfs_xattr_set(inode, name, buffer, size, flags); 31 return reiserfs_xattr_set(inode, name, buffer, size, flags);
@@ -36,7 +36,7 @@ static int security_del(struct inode *inode, const char *name)
36 if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX)) 36 if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
37 return -EINVAL; 37 return -EINVAL;
38 38
39 if (is_reiserfs_priv_object(inode)) 39 if (IS_PRIVATE(inode))
40 return -EPERM; 40 return -EPERM;
41 41
42 return 0; 42 return 0;
@@ -47,7 +47,7 @@ security_list(struct inode *inode, const char *name, int namelen, char *out)
47{ 47{
48 int len = namelen; 48 int len = namelen;
49 49
50 if (is_reiserfs_priv_object(inode)) 50 if (IS_PRIVATE(inode))
51 return 0; 51 return 0;
52 52
53 if (out) 53 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)
16 if (!reiserfs_xattrs(inode->i_sb)) 16 if (!reiserfs_xattrs(inode->i_sb))
17 return -EOPNOTSUPP; 17 return -EOPNOTSUPP;
18 18
19 if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode))) 19 if (!(capable(CAP_SYS_ADMIN) || IS_PRIVATE(inode)))
20 return -EPERM; 20 return -EPERM;
21 21
22 return reiserfs_xattr_get(inode, name, buffer, size); 22 return reiserfs_xattr_get(inode, name, buffer, size);
@@ -32,7 +32,7 @@ trusted_set(struct inode *inode, const char *name, const void *buffer,
32 if (!reiserfs_xattrs(inode->i_sb)) 32 if (!reiserfs_xattrs(inode->i_sb))
33 return -EOPNOTSUPP; 33 return -EOPNOTSUPP;
34 34
35 if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode))) 35 if (!(capable(CAP_SYS_ADMIN) || IS_PRIVATE(inode)))
36 return -EPERM; 36 return -EPERM;
37 37
38 return reiserfs_xattr_set(inode, name, buffer, size, flags); 38 return reiserfs_xattr_set(inode, name, buffer, size, flags);
@@ -46,7 +46,7 @@ static int trusted_del(struct inode *inode, const char *name)
46 if (!reiserfs_xattrs(inode->i_sb)) 46 if (!reiserfs_xattrs(inode->i_sb))
47 return -EOPNOTSUPP; 47 return -EOPNOTSUPP;
48 48
49 if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode))) 49 if (!(capable(CAP_SYS_ADMIN) || IS_PRIVATE(inode)))
50 return -EPERM; 50 return -EPERM;
51 51
52 return 0; 52 return 0;
@@ -60,7 +60,7 @@ trusted_list(struct inode *inode, const char *name, int namelen, char *out)
60 if (!reiserfs_xattrs(inode->i_sb)) 60 if (!reiserfs_xattrs(inode->i_sb))
61 return 0; 61 return 0;
62 62
63 if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode))) 63 if (!(capable(CAP_SYS_ADMIN) || IS_PRIVATE(inode)))
64 return 0; 64 return 0;
65 65
66 if (out) 66 if (out)