Update bcachefs sources to de906c3e2e bcachefs: Fix iterator counting for reflink pointers (again)

This commit is contained in:
Kent Overstreet 2019-10-12 14:49:11 -04:00
parent cec69929f0
commit 6e696ea087
5 changed files with 25 additions and 33 deletions

View File

@ -1 +1 @@
d0625a441839f54b9600783c3a6b90db6f197cad
de906c3e2eddad291d46bd0e7c81c68eaadcd08a

View File

@ -1359,6 +1359,13 @@ static inline struct bkey_s_c btree_iter_peek_uptodate(struct btree_iter *iter)
if (debug_check_iterators(iter->trans->c)) {
struct bkey k = bkey_unpack_key(l->b, _k);
/*
* this flag is internal to the btree code,
* we don't care if it doesn't match - if it's now set
* it just means the key has been written out to disk:
*/
k.needs_whiteout = iter->k.needs_whiteout;
BUG_ON(memcmp(&k, &iter->k, sizeof(k)));
}

View File

@ -898,6 +898,9 @@ retry:
bkey_cmp(iter->pos, end) < 0) {
struct bkey_i delete;
bch2_trans_unlink_iters(trans);
trans->iters_touched &= trans->iters_live;
bkey_init(&delete.k);
/*

View File

@ -960,7 +960,8 @@ static int count_iters_for_insert(struct btree_trans *trans,
case KEY_TYPE_reflink_p: {
struct bkey_s_c_reflink_p p = bkey_s_c_to_reflink_p(k);
u64 idx = le64_to_cpu(p.v->idx);
unsigned sectors = end->offset - bkey_start_offset(p.k);
unsigned sectors = bpos_min(*end, p.k->p).offset -
bkey_start_offset(p.k);
struct btree_iter *iter;
struct bkey_s_c r_k;

View File

@ -306,11 +306,11 @@ static struct dentry *bch2_lookup(struct inode *vdir, struct dentry *dentry,
return d_splice_alias(vinode, dentry);
}
static int bch2_create(struct inode *vdir, struct dentry *dentry,
umode_t mode, bool excl)
static int bch2_mknod(struct inode *vdir, struct dentry *dentry,
umode_t mode, dev_t rdev)
{
struct bch_inode_info *inode =
__bch2_create(to_bch_ei(vdir), dentry, mode|S_IFREG, 0, false);
__bch2_create(to_bch_ei(vdir), dentry, mode, rdev, false);
if (IS_ERR(inode))
return PTR_ERR(inode);
@ -319,6 +319,12 @@ static int bch2_create(struct inode *vdir, struct dentry *dentry,
return 0;
}
static int bch2_create(struct inode *vdir, struct dentry *dentry,
umode_t mode, bool excl)
{
return bch2_mknod(vdir, dentry, mode|S_IFREG, 0);
}
static int __bch2_link(struct bch_fs *c,
struct bch_inode_info *inode,
struct bch_inode_info *dir,
@ -448,32 +454,7 @@ err:
static int bch2_mkdir(struct inode *vdir, struct dentry *dentry, umode_t mode)
{
struct bch_inode_info *inode =
__bch2_create(to_bch_ei(vdir), dentry, mode|S_IFDIR, 0, false);
if (IS_ERR(inode))
return PTR_ERR(inode);
d_instantiate(dentry, &inode->v);
return 0;
}
static int bch2_rmdir(struct inode *vdir, struct dentry *dentry)
{
return bch2_unlink(vdir, dentry);
}
static int bch2_mknod(struct inode *vdir, struct dentry *dentry,
umode_t mode, dev_t rdev)
{
struct bch_inode_info *inode =
__bch2_create(to_bch_ei(vdir), dentry, mode, rdev, false);
if (IS_ERR(inode))
return PTR_ERR(inode);
d_instantiate(dentry, &inode->v);
return 0;
return bch2_mknod(vdir, dentry, mode|S_IFDIR, 0);
}
static int bch2_rename2(struct inode *src_vdir, struct dentry *src_dentry,
@ -958,7 +939,7 @@ static const struct inode_operations bch_dir_inode_operations = {
.unlink = bch2_unlink,
.symlink = bch2_symlink,
.mkdir = bch2_mkdir,
.rmdir = bch2_rmdir,
.rmdir = bch2_unlink,
.mknod = bch2_mknod,
.rename = bch2_rename2,
.getattr = bch2_getattr,
@ -974,7 +955,7 @@ static const struct inode_operations bch_dir_inode_operations = {
static const struct file_operations bch_dir_file_operations = {
.llseek = bch2_dir_llseek,
.read = generic_read_dir,
.iterate = bch2_vfs_readdir,
.iterate_shared = bch2_vfs_readdir,
.fsync = bch2_fsync,
.unlocked_ioctl = bch2_fs_file_ioctl,
#ifdef CONFIG_COMPAT