Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17559
b: refs/heads/master
c: b98932c
h: refs/heads/master
i:
  17557: 04cfcb3
  17555: cacd40c
  17551: db535de
v: v3
  • Loading branch information
Christoph Hellwig authored and Linus Torvalds committed Jan 10, 2006
1 parent 99b6f10 commit b0e7ffe
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 52 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c37ef806a3e1c0bca65fd03b7590d56d19625da4
refs/heads/master: b98932cb514eef404c6168c9a15cf28851498dea
21 changes: 0 additions & 21 deletions trunk/fs/reiserfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,6 @@ reiserfs_xattr_set(struct inode *inode, const char *name, const void *buffer,
struct iattr newattrs;
__u32 xahash = 0;

if (IS_RDONLY(inode))
return -EROFS;

if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
return -EPERM;

if (get_inode_sd_version(inode) == STAT_DATA_V1)
return -EOPNOTSUPP;

Expand Down Expand Up @@ -758,9 +752,6 @@ int reiserfs_xattr_del(struct inode *inode, const char *name)
struct dentry *dir;
int err;

if (IS_RDONLY(inode))
return -EROFS;

dir = open_xa_dir(inode, FL_READONLY);
if (IS_ERR(dir)) {
err = PTR_ERR(dir);
Expand Down Expand Up @@ -984,12 +975,6 @@ reiserfs_setxattr(struct dentry *dentry, const char *name, const void *value,
get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1)
return -EOPNOTSUPP;

if (IS_RDONLY(dentry->d_inode))
return -EROFS;

if (IS_IMMUTABLE(dentry->d_inode) || IS_APPEND(dentry->d_inode))
return -EROFS;

reiserfs_write_lock_xattr_i(dentry->d_inode);
lock = !has_xattr_dir(dentry->d_inode);
if (lock)
Expand Down Expand Up @@ -1019,12 +1004,6 @@ int reiserfs_removexattr(struct dentry *dentry, const char *name)
get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1)
return -EOPNOTSUPP;

if (IS_RDONLY(dentry->d_inode))
return -EROFS;

if (IS_IMMUTABLE(dentry->d_inode) || IS_APPEND(dentry->d_inode))
return -EPERM;

reiserfs_write_lock_xattr_i(dentry->d_inode);
reiserfs_read_lock_xattrs(dentry->d_sb);

Expand Down
30 changes: 0 additions & 30 deletions trunk/fs/reiserfs/xattr_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,10 @@ static int
user_get(struct inode *inode, const char *name, void *buffer, size_t size)
{

int error;

if (strlen(name) < sizeof(XATTR_USER_PREFIX))
return -EINVAL;

if (!reiserfs_xattrs_user(inode->i_sb))
return -EOPNOTSUPP;

error = reiserfs_permission_locked(inode, MAY_READ, NULL);
if (error)
return error;

return reiserfs_xattr_get(inode, name, buffer, size);
}

Expand All @@ -36,43 +28,21 @@ user_set(struct inode *inode, const char *name, const void *buffer,
size_t size, int flags)
{

int error;

if (strlen(name) < sizeof(XATTR_USER_PREFIX))
return -EINVAL;

if (!reiserfs_xattrs_user(inode->i_sb))
return -EOPNOTSUPP;

if (!S_ISREG(inode->i_mode) &&
(!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX))
return -EPERM;

error = reiserfs_permission_locked(inode, MAY_WRITE, NULL);
if (error)
return error;

return reiserfs_xattr_set(inode, name, buffer, size, flags);
}

static int user_del(struct inode *inode, const char *name)
{
int error;

if (strlen(name) < sizeof(XATTR_USER_PREFIX))
return -EINVAL;

if (!reiserfs_xattrs_user(inode->i_sb))
return -EOPNOTSUPP;

if (!S_ISREG(inode->i_mode) &&
(!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX))
return -EPERM;

error = reiserfs_permission_locked(inode, MAY_WRITE, NULL);
if (error)
return error;

return 0;
}

Expand Down

0 comments on commit b0e7ffe

Please sign in to comment.