summaryrefslogtreecommitdiff
path: root/libbcache/xattr.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-03-03 21:09:52 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2017-03-03 23:17:31 -0900
commit171ee48e57be78f4e95954c99851553fa523bf91 (patch)
tree5a54443f074f8f7922eda1451743bb9d2f60368e /libbcache/xattr.c
parenta5b5eba7f788bb77cf57f9c94f3474a2d439ab0b (diff)
Delete more unused shim code, update bcache code
Diffstat (limited to 'libbcache/xattr.c')
-rw-r--r--libbcache/xattr.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/libbcache/xattr.c b/libbcache/xattr.c
index 56a8e8f8..78552369 100644
--- a/libbcache/xattr.c
+++ b/libbcache/xattr.c
@@ -165,18 +165,18 @@ int bch_xattr_get(struct cache_set *c, struct inode *inode,
return ret;
}
-int bch_xattr_set(struct cache_set *c, struct inode *inode,
+int __bch_xattr_set(struct cache_set *c, u64 inum,
+ const struct bch_hash_info *hash_info,
const char *name, const void *value, size_t size,
- int flags, int type)
+ int flags, int type, u64 *journal_seq)
{
- struct bch_inode_info *ei = to_bch_ei(inode);
struct xattr_search_key search = X_SEARCH(type, name, strlen(name));
int ret;
if (!value) {
- ret = bch_hash_delete(xattr_hash_desc, &ei->str_hash,
- c, ei->vfs_inode.i_ino,
- &ei->journal_seq, &search);
+ ret = bch_hash_delete(xattr_hash_desc, hash_info,
+ c, inum,
+ journal_seq, &search);
} else {
struct bkey_i_xattr *xattr;
unsigned u64s = BKEY_U64s +
@@ -199,8 +199,8 @@ int bch_xattr_set(struct cache_set *c, struct inode *inode,
memcpy(xattr->v.x_name, search.name.name, search.name.len);
memcpy(xattr_val(&xattr->v), value, size);
- ret = bch_hash_set(xattr_hash_desc, &ei->str_hash, c,
- ei->vfs_inode.i_ino, &ei->journal_seq,
+ ret = bch_hash_set(xattr_hash_desc, hash_info, c,
+ inum, journal_seq,
&xattr->k_i,
(flags & XATTR_CREATE ? BCH_HASH_SET_MUST_CREATE : 0)|
(flags & XATTR_REPLACE ? BCH_HASH_SET_MUST_REPLACE : 0));
@@ -213,6 +213,17 @@ int bch_xattr_set(struct cache_set *c, struct inode *inode,
return ret;
}
+int bch_xattr_set(struct cache_set *c, struct inode *inode,
+ const char *name, const void *value, size_t size,
+ int flags, int type)
+{
+ struct bch_inode_info *ei = to_bch_ei(inode);
+
+ return __bch_xattr_set(c, inode->i_ino, &ei->str_hash,
+ name, value, size, flags, type,
+ &ei->journal_seq);
+}
+
static const struct xattr_handler *bch_xattr_type_to_handler(unsigned);
static size_t bch_xattr_emit(struct dentry *dentry,