aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/subvolume.c
diff options
context:
space:
mode:
authorGravatar Kent Overstreet <kent.overstreet@gmail.com> 2021-10-28 16:24:39 -0400
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2023-10-22 17:09:15 -0400
commit41f9b7d39fb11c9f306809681bb6991ac96f9b2e (patch)
tree7d5ca41936a26cee5f184f822cadb75c928e8ad1 /fs/bcachefs/subvolume.c
parentbcachefs: Don't do upgrades in nochanges mode (diff)
downloadlinux-41f9b7d39fb11c9f306809681bb6991ac96f9b2e.tar.gz
linux-41f9b7d39fb11c9f306809681bb6991ac96f9b2e.tar.bz2
linux-41f9b7d39fb11c9f306809681bb6991ac96f9b2e.zip
bcachefs: Move bch2_evict_subvolume_inodes() to fs.c
This fixes building in userspace - code that's coupled to the kernel VFS interface should live in fs.c Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/subvolume.c')
-rw-r--r--fs/bcachefs/subvolume.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c
index 58cda98989b1..4d385c9e9268 100644
--- a/fs/bcachefs/subvolume.c
+++ b/fs/bcachefs/subvolume.c
@@ -542,16 +542,6 @@ err:
return ret;
}
-static bool snapshot_list_has_id(struct snapshot_id_list *s, u32 id)
-{
- unsigned i;
-
- for (i = 0; i < s->nr; i++)
- if (id == s->d[i])
- return true;
- return false;
-}
-
static int snapshot_id_add(struct snapshot_id_list *s, u32 id)
{
BUG_ON(snapshot_list_has_id(s, id));
@@ -870,53 +860,6 @@ err:
return ret;
}
-static void bch2_evict_subvolume_inodes(struct bch_fs *c,
- struct snapshot_id_list *s)
-{
- struct super_block *sb = c->vfs_sb;
- struct inode *inode;
-
- spin_lock(&sb->s_inode_list_lock);
- list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
- if (!snapshot_list_has_id(s, to_bch_ei(inode)->ei_subvol) ||
- (inode->i_state & I_FREEING))
- continue;
-
- d_mark_dontcache(inode);
- d_prune_aliases(inode);
- }
- spin_unlock(&sb->s_inode_list_lock);
-again:
- cond_resched();
- spin_lock(&sb->s_inode_list_lock);
- list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
- if (!snapshot_list_has_id(s, to_bch_ei(inode)->ei_subvol) ||
- (inode->i_state & I_FREEING))
- continue;
-
- if (!(inode->i_state & I_DONTCACHE)) {
- d_mark_dontcache(inode);
- d_prune_aliases(inode);
- }
-
- spin_lock(&inode->i_lock);
- if (snapshot_list_has_id(s, to_bch_ei(inode)->ei_subvol) &&
- !(inode->i_state & I_FREEING)) {
- wait_queue_head_t *wq = bit_waitqueue(&inode->i_state, __I_NEW);
- DEFINE_WAIT_BIT(wait, &inode->i_state, __I_NEW);
- prepare_to_wait(wq, &wait.wq_entry, TASK_UNINTERRUPTIBLE);
- spin_unlock(&inode->i_lock);
- spin_unlock(&sb->s_inode_list_lock);
- schedule();
- finish_wait(wq, &wait.wq_entry);
- goto again;
- }
-
- spin_unlock(&inode->i_lock);
- }
- spin_unlock(&sb->s_inode_list_lock);
-}
-
void bch2_subvolume_wait_for_pagecache_and_delete(struct work_struct *work)
{
struct bch_fs *c = container_of(work, struct bch_fs,