summaryrefslogtreecommitdiff
path: root/libbcachefs/xattr.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-07-13 00:43:23 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2018-07-13 00:45:28 -0400
commit75c7148e0aff2184c75a52e7c4c58e46e715757b (patch)
treece823d6a7b2a5d3057bd912d00088fc707dec08b /libbcachefs/xattr.h
parent17e2f2775be6e10b966cd958bc0461aab662571a (diff)
Update bcachefs sources to 940d6ca657 bcachefs: acl code improvements
Diffstat (limited to 'libbcachefs/xattr.h')
-rw-r--r--libbcachefs/xattr.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/libbcachefs/xattr.h b/libbcachefs/xattr.h
index a58e7e30..1365032d 100644
--- a/libbcachefs/xattr.h
+++ b/libbcachefs/xattr.h
@@ -13,17 +13,37 @@ void bch2_xattr_to_text(struct bch_fs *, char *, size_t, struct bkey_s_c);
.val_to_text = bch2_xattr_to_text, \
}
+static inline unsigned xattr_val_u64s(unsigned name_len, unsigned val_len)
+{
+ return DIV_ROUND_UP(offsetof(struct bch_xattr, x_name) +
+ name_len + val_len, sizeof(u64));
+}
+
+#define xattr_val(_xattr) \
+ ((void *) (_xattr)->x_name + (_xattr)->x_name_len)
+
+struct xattr_search_key {
+ u8 type;
+ struct qstr name;
+};
+
+#define X_SEARCH(_type, _name, _len) ((struct xattr_search_key) \
+ { .type = _type, .name = QSTR_INIT(_name, _len) })
+
struct dentry;
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 bch_fs *, struct bch_inode_info *,
- const char *, const void *, size_t, int, int);
+
+int bch2_xattr_set(struct bch_fs *, u64, const struct bch_hash_info *,
+ const char *, const void *, size_t, int, int, u64 *);
ssize_t bch2_xattr_list(struct dentry *, char *, size_t);
extern const struct xattr_handler *bch2_xattr_handlers[];