X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libbcachefs%2Fxattr.h;h=214cbbaac3045d92da690d7fa18c6489183a702c;hb=c99a444c5cc242a89845be83236aacd7db628ef5;hp=1365032d56c39aa19e298d48e78f06562ffbdb7d;hpb=75c7148e0aff2184c75a52e7c4c58e46e715757b;p=bcachefs-tools-debian diff --git a/libbcachefs/xattr.h b/libbcachefs/xattr.h index 1365032..214cbba 100644 --- a/libbcachefs/xattr.h +++ b/libbcachefs/xattr.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _BCACHEFS_XATTR_H #define _BCACHEFS_XATTR_H @@ -5,13 +6,15 @@ extern const struct bch_hash_desc bch2_xattr_hash_desc; -const char *bch2_xattr_invalid(const struct bch_fs *, struct bkey_s_c); -void bch2_xattr_to_text(struct bch_fs *, char *, size_t, struct bkey_s_c); +int bch2_xattr_invalid(const struct bch_fs *, struct bkey_s_c, + enum bkey_invalid_flags, struct printbuf *); +void bch2_xattr_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c); -#define bch2_bkey_xattr_ops (struct bkey_ops) { \ +#define bch2_bkey_ops_xattr ((struct bkey_ops) { \ .key_invalid = bch2_xattr_invalid, \ .val_to_text = bch2_xattr_to_text, \ -} + .min_val_size = 8, \ +}) static inline unsigned xattr_val_u64s(unsigned name_len, unsigned val_len) { @@ -35,15 +38,13 @@ struct xattr_handler; struct bch_hash_info; struct bch_inode_info; -struct bkey_s_c bch2_xattr_get_iter(struct bch_fs *, - struct btree_iter *, - struct bch_inode_info *, - const char *, int); int bch2_xattr_get(struct bch_fs *, struct bch_inode_info *, const char *, void *, size_t, int); -int bch2_xattr_set(struct bch_fs *, u64, const struct bch_hash_info *, - const char *, const void *, size_t, int, int, u64 *); +int bch2_xattr_set(struct btree_trans *, subvol_inum, + const struct bch_hash_info *, + const char *, const void *, size_t, int, int); + ssize_t bch2_xattr_list(struct dentry *, char *, size_t); extern const struct xattr_handler *bch2_xattr_handlers[];