diff options
Diffstat (limited to 'libbcachefs/xattr.c')
-rw-r--r-- | libbcachefs/xattr.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/libbcachefs/xattr.c b/libbcachefs/xattr.c index b2075c2e..3a49d728 100644 --- a/libbcachefs/xattr.c +++ b/libbcachefs/xattr.c @@ -162,18 +162,17 @@ const struct bkey_ops bch2_bkey_xattr_ops = { .val_to_text = bch2_xattr_to_text, }; -int bch2_xattr_get(struct bch_fs *c, struct inode *inode, +int bch2_xattr_get(struct bch_fs *c, struct bch_inode_info *inode, const char *name, void *buffer, size_t size, int type) { - struct bch_inode_info *ei = to_bch_ei(inode); struct btree_iter iter; struct bkey_s_c k; struct bkey_s_c_xattr xattr; int ret; - k = bch2_hash_lookup(bch2_xattr_hash_desc, &ei->str_hash, c, - ei->vfs_inode.i_ino, &iter, - &X_SEARCH(type, name, strlen(name))); + k = bch2_hash_lookup(bch2_xattr_hash_desc, &inode->ei_str_hash, c, + inode->v.i_ino, &iter, + &X_SEARCH(type, name, strlen(name))); if (IS_ERR(k.k)) return bch2_btree_iter_unlock(&iter) ?: -ENODATA; @@ -236,15 +235,13 @@ int __bch2_xattr_set(struct bch_fs *c, u64 inum, return ret; } -int bch2_xattr_set(struct bch_fs *c, struct inode *inode, - const char *name, const void *value, size_t size, - int flags, int type) +int bch2_xattr_set(struct bch_fs *c, struct bch_inode_info *inode, + const char *name, const void *value, size_t size, + int flags, int type) { - struct bch_inode_info *ei = to_bch_ei(inode); - - return __bch2_xattr_set(c, inode->i_ino, &ei->str_hash, - name, value, size, flags, type, - &ei->journal_seq); + return __bch2_xattr_set(c, inode->v.i_ino, &inode->ei_str_hash, + name, value, size, flags, type, + &inode->ei_journal_seq); } static size_t bch2_xattr_emit(struct dentry *dentry, @@ -313,23 +310,25 @@ ssize_t bch2_xattr_list(struct dentry *dentry, char *buffer, size_t buffer_size) } static int bch2_xattr_get_handler(const struct xattr_handler *handler, - struct dentry *dentry, struct inode *inode, - const char *name, void *buffer, size_t size) + struct dentry *dentry, struct inode *vinode, + const char *name, void *buffer, size_t size) { - struct bch_fs *c = inode->i_sb->s_fs_info; + struct bch_inode_info *inode = to_bch_ei(vinode); + struct bch_fs *c = inode->v.i_sb->s_fs_info; return bch2_xattr_get(c, inode, name, buffer, size, handler->flags); } static int bch2_xattr_set_handler(const struct xattr_handler *handler, - struct dentry *dentry, struct inode *inode, - const char *name, const void *value, - size_t size, int flags) + struct dentry *dentry, struct inode *vinode, + const char *name, const void *value, + size_t size, int flags) { - struct bch_fs *c = inode->i_sb->s_fs_info; + struct bch_inode_info *inode = to_bch_ei(vinode); + struct bch_fs *c = inode->v.i_sb->s_fs_info; return bch2_xattr_set(c, inode, name, value, size, flags, - handler->flags); + handler->flags); } static const struct xattr_handler bch_xattr_user_handler = { |