xattr.c (78c0b75c34209c471616566b3978eac4c1c53e99) xattr.c (facafdcbc157686311dbe58649ef9d29fcf8e610)
1// SPDX-License-Identifier: GPL-2.0
2
3#include "bcachefs.h"
4#include "bkey_methods.h"
5#include "btree_update.h"
6#include "extents.h"
7#include "fs.h"
8#include "rebalance.h"

--- 56 unchanged lines hidden (view full) ---

65 .key_type = KEY_TYPE_xattr,
66 .hash_key = xattr_hash_key,
67 .hash_bkey = xattr_hash_bkey,
68 .cmp_key = xattr_cmp_key,
69 .cmp_bkey = xattr_cmp_bkey,
70};
71
72int bch2_xattr_invalid(const struct bch_fs *c, struct bkey_s_c k,
1// SPDX-License-Identifier: GPL-2.0
2
3#include "bcachefs.h"
4#include "bkey_methods.h"
5#include "btree_update.h"
6#include "extents.h"
7#include "fs.h"
8#include "rebalance.h"

--- 56 unchanged lines hidden (view full) ---

65 .key_type = KEY_TYPE_xattr,
66 .hash_key = xattr_hash_key,
67 .hash_bkey = xattr_hash_bkey,
68 .cmp_key = xattr_cmp_key,
69 .cmp_bkey = xattr_cmp_bkey,
70};
71
72int bch2_xattr_invalid(const struct bch_fs *c, struct bkey_s_c k,
73 int rw, struct printbuf *err)
73 unsigned flags, struct printbuf *err)
74{
75 const struct xattr_handler *handler;
76 struct bkey_s_c_xattr xattr = bkey_s_c_to_xattr(k);
77
78 if (bkey_val_bytes(k.k) < sizeof(struct bch_xattr)) {
79 prt_printf(err, "incorrect value size (%zu < %zu)",
80 bkey_val_bytes(k.k), sizeof(*xattr.v));
81 return -BCH_ERR_invalid_bkey;

--- 573 unchanged lines hidden ---
74{
75 const struct xattr_handler *handler;
76 struct bkey_s_c_xattr xattr = bkey_s_c_to_xattr(k);
77
78 if (bkey_val_bytes(k.k) < sizeof(struct bch_xattr)) {
79 prt_printf(err, "incorrect value size (%zu < %zu)",
80 bkey_val_bytes(k.k), sizeof(*xattr.v));
81 return -BCH_ERR_invalid_bkey;

--- 573 unchanged lines hidden ---