bcachefs: Kill bch2_xattr_get()
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 9 Jul 2023 18:12:58 +0000 (14:12 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:06 +0000 (17:10 -0400)
Inline it into the only caller

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/xattr.c
fs/bcachefs/xattr.h

index 867cc68782483c86d0b6e9a578903f529ce6dd4e..43904c0ec9ba9dd46365c423279758bcaae42895 100644 (file)
@@ -166,13 +166,6 @@ err1:
        return ret < 0 && bch2_err_matches(ret, ENOENT) ? -ENODATA : ret;
 }
 
-int bch2_xattr_get(struct bch_fs *c, struct bch_inode_info *inode,
-                  const char *name, void *buffer, size_t size, int type)
-{
-       return bch2_trans_do(c, NULL, NULL, 0,
-               bch2_xattr_get_trans(&trans, inode, name, buffer, size, type));
-}
-
 int bch2_xattr_set(struct btree_trans *trans, subvol_inum inum,
                   const struct bch_hash_info *hash_info,
                   const char *name, const void *value, size_t size,
@@ -365,9 +358,9 @@ static int bch2_xattr_get_handler(const struct xattr_handler *handler,
 {
        struct bch_inode_info *inode = to_bch_ei(vinode);
        struct bch_fs *c = inode->v.i_sb->s_fs_info;
-       int ret;
+       int ret = bch2_trans_do(c, NULL, NULL, 0,
+               bch2_xattr_get_trans(&trans, inode, name, buffer, size, handler->flags));
 
-       ret = bch2_xattr_get(c, inode, name, buffer, size, handler->flags);
        return bch2_err_class(ret);
 }
 
index 214cbbaac3045d92da690d7fa18c6489183a702c..ad568c06e1f83cc33c77cf4e5fe79a1e0d8dfe5d 100644 (file)
@@ -38,9 +38,7 @@ struct xattr_handler;
 struct bch_hash_info;
 struct bch_inode_info;
 
-int bch2_xattr_get(struct bch_fs *, struct bch_inode_info *,
-                 const char *, void *, size_t, int);
-
+/* Exported for cmd_migrate.c in tools: */
 int bch2_xattr_set(struct btree_trans *, subvol_inum,
                   const struct bch_hash_info *,
                   const char *, const void *, size_t, int, int);