diff options
Diffstat (limited to 'fs/ceph/xattr.c')
-rw-r--r-- | fs/ceph/xattr.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index c6e917d360f7..248e32e3ae7d 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c @@ -877,11 +877,10 @@ out: return err; } -static int ceph_sync_setxattr(struct dentry *dentry, const char *name, +static int ceph_sync_setxattr(struct inode *inode, const char *name, const char *value, size_t size, int flags) { - struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); - struct inode *inode = d_inode(dentry); + struct ceph_fs_client *fsc = ceph_sb_to_client(inode->i_sb); struct ceph_inode_info *ci = ceph_inode(inode); struct ceph_mds_request *req; struct ceph_mds_client *mdsc = fsc->mdsc; @@ -939,13 +938,12 @@ out: return err; } -int __ceph_setxattr(struct dentry *dentry, const char *name, +int __ceph_setxattr(struct inode *inode, const char *name, const void *value, size_t size, int flags) { - struct inode *inode = d_inode(dentry); struct ceph_vxattr *vxattr; struct ceph_inode_info *ci = ceph_inode(inode); - struct ceph_mds_client *mdsc = ceph_sb_to_client(dentry->d_sb)->mdsc; + struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; struct ceph_cap_flush *prealloc_cf = NULL; int issued; int err; @@ -1056,7 +1054,7 @@ do_sync_unlocked: "during filling trace\n", inode); err = -EBUSY; } else { - err = ceph_sync_setxattr(dentry, name, value, size, flags); + err = ceph_sync_setxattr(inode, name, value, size, flags); } out: ceph_free_cap_flush(prealloc_cf); @@ -1078,14 +1076,13 @@ int ceph_setxattr(struct dentry *dentry, const char *name, if (size == 0) value = ""; /* empty EA, do not remove */ - return __ceph_setxattr(dentry, name, value, size, flags); + return __ceph_setxattr(d_inode(dentry), name, value, size, flags); } -static int ceph_send_removexattr(struct dentry *dentry, const char *name) +static int ceph_send_removexattr(struct inode *inode, const char *name) { - struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); + struct ceph_fs_client *fsc = ceph_sb_to_client(inode->i_sb); struct ceph_mds_client *mdsc = fsc->mdsc; - struct inode *inode = d_inode(dentry); struct ceph_mds_request *req; int err; @@ -1106,12 +1103,11 @@ static int ceph_send_removexattr(struct dentry *dentry, const char *name) return err; } -int __ceph_removexattr(struct dentry *dentry, const char *name) +static int __ceph_removexattr(struct inode *inode, const char *name) { - struct inode *inode = d_inode(dentry); struct ceph_vxattr *vxattr; struct ceph_inode_info *ci = ceph_inode(inode); - struct ceph_mds_client *mdsc = ceph_sb_to_client(dentry->d_sb)->mdsc; + struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; struct ceph_cap_flush *prealloc_cf = NULL; int issued; int err; @@ -1192,7 +1188,7 @@ do_sync_unlocked: if (lock_snap_rwsem) up_read(&mdsc->snap_rwsem); ceph_free_cap_flush(prealloc_cf); - err = ceph_send_removexattr(dentry, name); + err = ceph_send_removexattr(inode, name); return err; } @@ -1204,7 +1200,7 @@ int ceph_removexattr(struct dentry *dentry, const char *name) if (!strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN)) return generic_removexattr(dentry, name); - return __ceph_removexattr(dentry, name); + return __ceph_removexattr(d_inode(dentry), name); } #ifdef CONFIG_SECURITY |