mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
Update bcachefs sources to 62439c6f1a6d bcachefs: Simplify bch2_xattr_emit() implementation
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
e2e1493111
commit
8e0023ed4a
@ -1 +1 @@
|
|||||||
e7015d0df31c410789666b4c8ad0683aae87b4da
|
62439c6f1a6dba3fca1e57f352745d6e36dd1e31
|
||||||
|
@ -556,7 +556,7 @@ int bch2_bucket_gens_init(struct bch_fs *c)
|
|||||||
struct bpos pos = alloc_gens_pos(iter.pos, &offset);
|
struct bpos pos = alloc_gens_pos(iter.pos, &offset);
|
||||||
int ret2 = 0;
|
int ret2 = 0;
|
||||||
|
|
||||||
if (have_bucket_gens_key && bkey_cmp(iter.pos, pos)) {
|
if (have_bucket_gens_key && !bkey_eq(g.k.p, pos)) {
|
||||||
ret2 = bch2_btree_insert_trans(trans, BTREE_ID_bucket_gens, &g.k_i, 0) ?:
|
ret2 = bch2_btree_insert_trans(trans, BTREE_ID_bucket_gens, &g.k_i, 0) ?:
|
||||||
bch2_trans_commit(trans, NULL, NULL, BCH_TRANS_COMMIT_no_enospc);
|
bch2_trans_commit(trans, NULL, NULL, BCH_TRANS_COMMIT_no_enospc);
|
||||||
if (ret2)
|
if (ret2)
|
||||||
@ -829,7 +829,7 @@ int bch2_trigger_alloc(struct btree_trans *trans,
|
|||||||
if (likely(new.k->type == KEY_TYPE_alloc_v4)) {
|
if (likely(new.k->type == KEY_TYPE_alloc_v4)) {
|
||||||
new_a = bkey_s_to_alloc_v4(new).v;
|
new_a = bkey_s_to_alloc_v4(new).v;
|
||||||
} else {
|
} else {
|
||||||
BUG_ON(!(flags & BTREE_TRIGGER_gc));
|
BUG_ON(!(flags & (BTREE_TRIGGER_gc|BTREE_TRIGGER_check_repair)));
|
||||||
|
|
||||||
struct bkey_i_alloc_v4 *new_ka = bch2_alloc_to_v4_mut_inlined(trans, new.s_c);
|
struct bkey_i_alloc_v4 *new_ka = bch2_alloc_to_v4_mut_inlined(trans, new.s_c);
|
||||||
ret = PTR_ERR_OR_ZERO(new_ka);
|
ret = PTR_ERR_OR_ZERO(new_ka);
|
||||||
|
@ -974,6 +974,10 @@ retry:
|
|||||||
|
|
||||||
bch2_btree_node_wait_on_read(b);
|
bch2_btree_node_wait_on_read(b);
|
||||||
|
|
||||||
|
ret = bch2_trans_relock(trans);
|
||||||
|
if (ret)
|
||||||
|
return ERR_PTR(ret);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* should_be_locked is not set on this path yet, so we need to
|
* should_be_locked is not set on this path yet, so we need to
|
||||||
* relock it specifically:
|
* relock it specifically:
|
||||||
|
@ -107,7 +107,7 @@ int bch2_set_bucket_needs_journal_commit(struct buckets_waiting_for_journal *b,
|
|||||||
nr_elements += t->d[i].journal_seq > flushed_seq;
|
nr_elements += t->d[i].journal_seq > flushed_seq;
|
||||||
|
|
||||||
new_bits = ilog2(roundup_pow_of_two(nr_elements * 3));
|
new_bits = ilog2(roundup_pow_of_two(nr_elements * 3));
|
||||||
|
realloc:
|
||||||
n = kvmalloc(sizeof(*n) + (sizeof(n->d[0]) << new_bits), GFP_KERNEL);
|
n = kvmalloc(sizeof(*n) + (sizeof(n->d[0]) << new_bits), GFP_KERNEL);
|
||||||
if (!n) {
|
if (!n) {
|
||||||
ret = -BCH_ERR_ENOMEM_buckets_waiting_for_journal_set;
|
ret = -BCH_ERR_ENOMEM_buckets_waiting_for_journal_set;
|
||||||
@ -118,6 +118,8 @@ retry_rehash:
|
|||||||
if (nr_rehashes_this_size == 3) {
|
if (nr_rehashes_this_size == 3) {
|
||||||
new_bits++;
|
new_bits++;
|
||||||
nr_rehashes_this_size = 0;
|
nr_rehashes_this_size = 0;
|
||||||
|
kvfree(n);
|
||||||
|
goto realloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
nr_rehashes++;
|
nr_rehashes++;
|
||||||
|
@ -20,6 +20,74 @@
|
|||||||
#include "subvolume.h"
|
#include "subvolume.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
|
static void bkey_put_dev_refs(struct bch_fs *c, struct bkey_s_c k)
|
||||||
|
{
|
||||||
|
struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k);
|
||||||
|
|
||||||
|
bkey_for_each_ptr(ptrs, ptr)
|
||||||
|
bch2_dev_put(bch2_dev_have_ref(c, ptr->dev));
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool bkey_get_dev_refs(struct bch_fs *c, struct bkey_s_c k)
|
||||||
|
{
|
||||||
|
struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k);
|
||||||
|
|
||||||
|
bkey_for_each_ptr(ptrs, ptr) {
|
||||||
|
if (!bch2_dev_tryget(c, ptr->dev)) {
|
||||||
|
bkey_for_each_ptr(ptrs, ptr2) {
|
||||||
|
if (ptr2 == ptr)
|
||||||
|
break;
|
||||||
|
bch2_dev_put(bch2_dev_have_ref(c, ptr2->dev));
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void bkey_nocow_unlock(struct bch_fs *c, struct bkey_s_c k)
|
||||||
|
{
|
||||||
|
struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k);
|
||||||
|
|
||||||
|
bkey_for_each_ptr(ptrs, ptr) {
|
||||||
|
struct bch_dev *ca = bch2_dev_have_ref(c, ptr->dev);
|
||||||
|
struct bpos bucket = PTR_BUCKET_POS(ca, ptr);
|
||||||
|
|
||||||
|
bch2_bucket_nocow_unlock(&c->nocow_locks, bucket, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool bkey_nocow_lock(struct bch_fs *c, struct moving_context *ctxt, struct bkey_s_c k)
|
||||||
|
{
|
||||||
|
struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k);
|
||||||
|
|
||||||
|
bkey_for_each_ptr(ptrs, ptr) {
|
||||||
|
struct bch_dev *ca = bch2_dev_have_ref(c, ptr->dev);
|
||||||
|
struct bpos bucket = PTR_BUCKET_POS(ca, ptr);
|
||||||
|
|
||||||
|
if (ctxt) {
|
||||||
|
bool locked;
|
||||||
|
|
||||||
|
move_ctxt_wait_event(ctxt,
|
||||||
|
(locked = bch2_bucket_nocow_trylock(&c->nocow_locks, bucket, 0)) ||
|
||||||
|
list_empty(&ctxt->ios));
|
||||||
|
|
||||||
|
if (!locked)
|
||||||
|
bch2_bucket_nocow_lock(&c->nocow_locks, bucket, 0);
|
||||||
|
} else {
|
||||||
|
if (!bch2_bucket_nocow_trylock(&c->nocow_locks, bucket, 0)) {
|
||||||
|
bkey_for_each_ptr(ptrs, ptr2) {
|
||||||
|
if (ptr2 == ptr)
|
||||||
|
break;
|
||||||
|
bch2_bucket_nocow_unlock(&c->nocow_locks, bucket, 0);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static void trace_move_extent_finish2(struct bch_fs *c, struct bkey_s_c k)
|
static void trace_move_extent_finish2(struct bch_fs *c, struct bkey_s_c k)
|
||||||
{
|
{
|
||||||
if (trace_move_extent_finish_enabled()) {
|
if (trace_move_extent_finish_enabled()) {
|
||||||
@ -355,17 +423,11 @@ void bch2_data_update_read_done(struct data_update *m,
|
|||||||
void bch2_data_update_exit(struct data_update *update)
|
void bch2_data_update_exit(struct data_update *update)
|
||||||
{
|
{
|
||||||
struct bch_fs *c = update->op.c;
|
struct bch_fs *c = update->op.c;
|
||||||
struct bkey_ptrs_c ptrs =
|
struct bkey_s_c k = bkey_i_to_s_c(update->k.k);
|
||||||
bch2_bkey_ptrs_c(bkey_i_to_s_c(update->k.k));
|
|
||||||
|
|
||||||
bkey_for_each_ptr(ptrs, ptr) {
|
|
||||||
struct bch_dev *ca = bch2_dev_have_ref(c, ptr->dev);
|
|
||||||
if (c->opts.nocow_enabled)
|
if (c->opts.nocow_enabled)
|
||||||
bch2_bucket_nocow_unlock(&c->nocow_locks,
|
bkey_nocow_unlock(c, k);
|
||||||
PTR_BUCKET_POS(ca, ptr), 0);
|
bkey_put_dev_refs(c, k);
|
||||||
bch2_dev_put(ca);
|
|
||||||
}
|
|
||||||
|
|
||||||
bch2_bkey_buf_exit(&update->k, c);
|
bch2_bkey_buf_exit(&update->k, c);
|
||||||
bch2_disk_reservation_put(c, &update->op.res);
|
bch2_disk_reservation_put(c, &update->op.res);
|
||||||
bch2_bio_free_pages_pool(c, &update->op.wbio.bio);
|
bch2_bio_free_pages_pool(c, &update->op.wbio.bio);
|
||||||
@ -475,6 +537,9 @@ void bch2_data_update_opts_to_text(struct printbuf *out, struct bch_fs *c,
|
|||||||
bch2_compression_opt_to_text(out, background_compression(*io_opts));
|
bch2_compression_opt_to_text(out, background_compression(*io_opts));
|
||||||
prt_newline(out);
|
prt_newline(out);
|
||||||
|
|
||||||
|
prt_str(out, "opts.replicas:\t");
|
||||||
|
prt_u64(out, io_opts->data_replicas);
|
||||||
|
|
||||||
prt_str(out, "extra replicas:\t");
|
prt_str(out, "extra replicas:\t");
|
||||||
prt_u64(out, data_opts->extra_replicas);
|
prt_u64(out, data_opts->extra_replicas);
|
||||||
}
|
}
|
||||||
@ -543,7 +608,6 @@ int bch2_data_update_init(struct btree_trans *trans,
|
|||||||
const union bch_extent_entry *entry;
|
const union bch_extent_entry *entry;
|
||||||
struct extent_ptr_decoded p;
|
struct extent_ptr_decoded p;
|
||||||
unsigned i, reserve_sectors = k.k->size * data_opts.extra_replicas;
|
unsigned i, reserve_sectors = k.k->size * data_opts.extra_replicas;
|
||||||
unsigned ptrs_locked = 0;
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -554,6 +618,15 @@ int bch2_data_update_init(struct btree_trans *trans,
|
|||||||
if (unlikely(k.k->p.snapshot && !bch2_snapshot_equiv(c, k.k->p.snapshot)))
|
if (unlikely(k.k->p.snapshot && !bch2_snapshot_equiv(c, k.k->p.snapshot)))
|
||||||
return -BCH_ERR_data_update_done;
|
return -BCH_ERR_data_update_done;
|
||||||
|
|
||||||
|
if (!bkey_get_dev_refs(c, k))
|
||||||
|
return -BCH_ERR_data_update_done;
|
||||||
|
|
||||||
|
if (c->opts.nocow_enabled &&
|
||||||
|
!bkey_nocow_lock(c, ctxt, k)) {
|
||||||
|
bkey_put_dev_refs(c, k);
|
||||||
|
return -BCH_ERR_nocow_lock_blocked;
|
||||||
|
}
|
||||||
|
|
||||||
bch2_bkey_buf_init(&m->k);
|
bch2_bkey_buf_init(&m->k);
|
||||||
bch2_bkey_buf_reassemble(&m->k, c, k);
|
bch2_bkey_buf_reassemble(&m->k, c, k);
|
||||||
m->btree_id = btree_id;
|
m->btree_id = btree_id;
|
||||||
@ -575,40 +648,24 @@ int bch2_data_update_init(struct btree_trans *trans,
|
|||||||
m->op.compression_opt = background_compression(io_opts);
|
m->op.compression_opt = background_compression(io_opts);
|
||||||
m->op.watermark = m->data_opts.btree_insert_flags & BCH_WATERMARK_MASK;
|
m->op.watermark = m->data_opts.btree_insert_flags & BCH_WATERMARK_MASK;
|
||||||
|
|
||||||
bkey_for_each_ptr(ptrs, ptr) {
|
|
||||||
if (!bch2_dev_tryget(c, ptr->dev)) {
|
|
||||||
bkey_for_each_ptr(ptrs, ptr2) {
|
|
||||||
if (ptr2 == ptr)
|
|
||||||
break;
|
|
||||||
bch2_dev_put(bch2_dev_have_ref(c, ptr2->dev));
|
|
||||||
}
|
|
||||||
return -BCH_ERR_data_update_done;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned durability_have = 0, durability_removing = 0;
|
unsigned durability_have = 0, durability_removing = 0;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
bkey_for_each_ptr_decode(k.k, ptrs, p, entry) {
|
bkey_for_each_ptr_decode(k.k, ptrs, p, entry) {
|
||||||
struct bch_dev *ca = bch2_dev_have_ref(c, p.ptr.dev);
|
if (!p.ptr.cached) {
|
||||||
struct bpos bucket = PTR_BUCKET_POS(ca, &p.ptr);
|
|
||||||
bool locked;
|
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
if (((1U << i) & m->data_opts.rewrite_ptrs)) {
|
if (BIT(i) & m->data_opts.rewrite_ptrs) {
|
||||||
BUG_ON(p.ptr.cached);
|
|
||||||
|
|
||||||
if (crc_is_compressed(p.crc))
|
if (crc_is_compressed(p.crc))
|
||||||
reserve_sectors += k.k->size;
|
reserve_sectors += k.k->size;
|
||||||
|
|
||||||
m->op.nr_replicas += bch2_extent_ptr_desired_durability(c, &p);
|
m->op.nr_replicas += bch2_extent_ptr_desired_durability(c, &p);
|
||||||
durability_removing += bch2_extent_ptr_desired_durability(c, &p);
|
durability_removing += bch2_extent_ptr_desired_durability(c, &p);
|
||||||
} else if (!p.ptr.cached &&
|
} else if (!(BIT(i) & m->data_opts.kill_ptrs)) {
|
||||||
!((1U << i) & m->data_opts.kill_ptrs)) {
|
|
||||||
bch2_dev_list_add_dev(&m->op.devs_have, p.ptr.dev);
|
bch2_dev_list_add_dev(&m->op.devs_have, p.ptr.dev);
|
||||||
durability_have += bch2_extent_ptr_durability(c, &p);
|
durability_have += bch2_extent_ptr_durability(c, &p);
|
||||||
}
|
}
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* op->csum_type is normally initialized from the fs/file's
|
* op->csum_type is normally initialized from the fs/file's
|
||||||
@ -623,24 +680,6 @@ int bch2_data_update_init(struct btree_trans *trans,
|
|||||||
if (p.crc.compression_type == BCH_COMPRESSION_TYPE_incompressible)
|
if (p.crc.compression_type == BCH_COMPRESSION_TYPE_incompressible)
|
||||||
m->op.incompressible = true;
|
m->op.incompressible = true;
|
||||||
|
|
||||||
if (c->opts.nocow_enabled) {
|
|
||||||
if (ctxt) {
|
|
||||||
move_ctxt_wait_event(ctxt,
|
|
||||||
(locked = bch2_bucket_nocow_trylock(&c->nocow_locks,
|
|
||||||
bucket, 0)) ||
|
|
||||||
list_empty(&ctxt->ios));
|
|
||||||
|
|
||||||
if (!locked)
|
|
||||||
bch2_bucket_nocow_lock(&c->nocow_locks, bucket, 0);
|
|
||||||
} else {
|
|
||||||
if (!bch2_bucket_nocow_trylock(&c->nocow_locks, bucket, 0)) {
|
|
||||||
ret = -BCH_ERR_nocow_lock_blocked;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ptrs_locked |= (1U << i);
|
|
||||||
}
|
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -654,16 +693,6 @@ int bch2_data_update_init(struct btree_trans *trans,
|
|||||||
* Increasing replication is an explicit operation triggered by
|
* Increasing replication is an explicit operation triggered by
|
||||||
* rereplicate, currently, so that users don't get an unexpected -ENOSPC
|
* rereplicate, currently, so that users don't get an unexpected -ENOSPC
|
||||||
*/
|
*/
|
||||||
if (!(m->data_opts.write_flags & BCH_WRITE_CACHED) &&
|
|
||||||
!durability_required) {
|
|
||||||
m->data_opts.kill_ptrs |= m->data_opts.rewrite_ptrs;
|
|
||||||
m->data_opts.rewrite_ptrs = 0;
|
|
||||||
/* if iter == NULL, it's just a promote */
|
|
||||||
if (iter)
|
|
||||||
ret = bch2_extent_drop_ptrs(trans, iter, k, m->data_opts);
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
m->op.nr_replicas = min(durability_removing, durability_required) +
|
m->op.nr_replicas = min(durability_removing, durability_required) +
|
||||||
m->data_opts.extra_replicas;
|
m->data_opts.extra_replicas;
|
||||||
|
|
||||||
@ -675,48 +704,38 @@ int bch2_data_update_init(struct btree_trans *trans,
|
|||||||
if (!(durability_have + durability_removing))
|
if (!(durability_have + durability_removing))
|
||||||
m->op.nr_replicas = max((unsigned) m->op.nr_replicas, 1);
|
m->op.nr_replicas = max((unsigned) m->op.nr_replicas, 1);
|
||||||
|
|
||||||
if (!m->op.nr_replicas) {
|
|
||||||
struct printbuf buf = PRINTBUF;
|
|
||||||
|
|
||||||
bch2_data_update_to_text(&buf, m);
|
|
||||||
WARN(1, "trying to move an extent, but nr_replicas=0\n%s", buf.buf);
|
|
||||||
printbuf_exit(&buf);
|
|
||||||
ret = -BCH_ERR_data_update_done;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
m->op.nr_replicas_required = m->op.nr_replicas;
|
m->op.nr_replicas_required = m->op.nr_replicas;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* It might turn out that we don't need any new replicas, if the
|
||||||
|
* replicas or durability settings have been changed since the extent
|
||||||
|
* was written:
|
||||||
|
*/
|
||||||
|
if (!m->op.nr_replicas) {
|
||||||
|
m->data_opts.kill_ptrs |= m->data_opts.rewrite_ptrs;
|
||||||
|
m->data_opts.rewrite_ptrs = 0;
|
||||||
|
/* if iter == NULL, it's just a promote */
|
||||||
|
if (iter)
|
||||||
|
ret = bch2_extent_drop_ptrs(trans, iter, k, m->data_opts);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (reserve_sectors) {
|
if (reserve_sectors) {
|
||||||
ret = bch2_disk_reservation_add(c, &m->op.res, reserve_sectors,
|
ret = bch2_disk_reservation_add(c, &m->op.res, reserve_sectors,
|
||||||
m->data_opts.extra_replicas
|
m->data_opts.extra_replicas
|
||||||
? 0
|
? 0
|
||||||
: BCH_DISK_RESERVATION_NOFAIL);
|
: BCH_DISK_RESERVATION_NOFAIL);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bkey_extent_is_unwritten(k)) {
|
if (bkey_extent_is_unwritten(k)) {
|
||||||
bch2_update_unwritten_extent(trans, m);
|
bch2_update_unwritten_extent(trans, m);
|
||||||
goto done;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
err:
|
out:
|
||||||
i = 0;
|
|
||||||
bkey_for_each_ptr_decode(k.k, ptrs, p, entry) {
|
|
||||||
struct bch_dev *ca = bch2_dev_have_ref(c, p.ptr.dev);
|
|
||||||
struct bpos bucket = PTR_BUCKET_POS(ca, &p.ptr);
|
|
||||||
if ((1U << i) & ptrs_locked)
|
|
||||||
bch2_bucket_nocow_unlock(&c->nocow_locks, bucket, 0);
|
|
||||||
bch2_dev_put(ca);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
bch2_bkey_buf_exit(&m->k, c);
|
|
||||||
bch2_bio_free_pages_pool(c, &m->op.wbio.bio);
|
|
||||||
return ret;
|
|
||||||
done:
|
|
||||||
bch2_data_update_exit(m);
|
bch2_data_update_exit(m);
|
||||||
return ret ?: -BCH_ERR_data_update_done;
|
return ret ?: -BCH_ERR_data_update_done;
|
||||||
}
|
}
|
||||||
|
@ -1017,6 +1017,8 @@ void bch2_extent_ptr_to_text(struct printbuf *out, struct bch_fs *c, const struc
|
|||||||
|
|
||||||
prt_printf(out, "ptr: %u:%llu:%u gen %u",
|
prt_printf(out, "ptr: %u:%llu:%u gen %u",
|
||||||
ptr->dev, b, offset, ptr->gen);
|
ptr->dev, b, offset, ptr->gen);
|
||||||
|
if (ca->mi.durability != 1)
|
||||||
|
prt_printf(out, " d=%u", ca->mi.durability);
|
||||||
if (ptr->cached)
|
if (ptr->cached)
|
||||||
prt_str(out, " cached");
|
prt_str(out, " cached");
|
||||||
if (ptr->unwritten)
|
if (ptr->unwritten)
|
||||||
|
@ -523,7 +523,7 @@ do_io:
|
|||||||
|
|
||||||
if (f_sectors > w->tmp_sectors) {
|
if (f_sectors > w->tmp_sectors) {
|
||||||
kfree(w->tmp);
|
kfree(w->tmp);
|
||||||
w->tmp = kcalloc(f_sectors, sizeof(struct bch_folio_sector), __GFP_NOFAIL);
|
w->tmp = kcalloc(f_sectors, sizeof(struct bch_folio_sector), GFP_NOFS|__GFP_NOFAIL);
|
||||||
w->tmp_sectors = f_sectors;
|
w->tmp_sectors = f_sectors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,7 +451,8 @@ retry:
|
|||||||
.type = BCH_DISK_ACCOUNTING_replicas,
|
.type = BCH_DISK_ACCOUNTING_replicas,
|
||||||
};
|
};
|
||||||
|
|
||||||
memcpy(&k.replicas, e, replicas_entry_bytes(e));
|
unsafe_memcpy(&k.replicas, e, replicas_entry_bytes(e),
|
||||||
|
"embedded variable length struct");
|
||||||
|
|
||||||
struct bpos p = disk_accounting_pos_to_bpos(&k);
|
struct bpos p = disk_accounting_pos_to_bpos(&k);
|
||||||
|
|
||||||
|
@ -591,10 +591,20 @@ static int bch2_xattr_bcachefs_get_effective(
|
|||||||
name, buffer, size, true);
|
name, buffer, size, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Noop - xattrs in the bcachefs_effective namespace are inherited */
|
||||||
|
static int bch2_xattr_bcachefs_set_effective(const struct xattr_handler *handler,
|
||||||
|
struct mnt_idmap *idmap,
|
||||||
|
struct dentry *dentry, struct inode *vinode,
|
||||||
|
const char *name, const void *value,
|
||||||
|
size_t size, int flags)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct xattr_handler bch_xattr_bcachefs_effective_handler = {
|
static const struct xattr_handler bch_xattr_bcachefs_effective_handler = {
|
||||||
.prefix = "bcachefs_effective.",
|
.prefix = "bcachefs_effective.",
|
||||||
.get = bch2_xattr_bcachefs_get_effective,
|
.get = bch2_xattr_bcachefs_get_effective,
|
||||||
.set = bch2_xattr_bcachefs_set,
|
.set = bch2_xattr_bcachefs_set_effective,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* NO_BCACHEFS_FS */
|
#endif /* NO_BCACHEFS_FS */
|
||||||
|
Loading…
Reference in New Issue
Block a user