summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fs.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-10-11 12:03:19 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:15 -0400
commit2027875bd8318171159495c948461eae2f84936d (patch)
tree891d2abcd3f50b2bd3bf9b3b60cd325aea5fad66 /fs/bcachefs/fs.c
parentf3b1e1937973624d3bc5f3ba0824e228ae256b88 (diff)
bcachefs: Add BCH_SUBVOLUME_UNLINKED
Snapshot deletion needs to become a multi step process, where we unlink, then tear down the page cache, then delete the subvolume - the deleting flag is equivalent to an inode with i_nlink = 0. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/fs.c')
-rw-r--r--fs/bcachefs/fs.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index 334cd335ff11..c325e5c4325c 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -490,7 +490,7 @@ static int bch2_link(struct dentry *old_dentry, struct inode *vdir,
}
int __bch2_unlink(struct inode *vdir, struct dentry *dentry,
- int deleting_snapshot)
+ bool deleting_snapshot)
{
struct bch_fs *c = vdir->i_sb->s_fs_info;
struct bch_inode_info *dir = to_bch_ei(vdir);
@@ -527,7 +527,7 @@ int __bch2_unlink(struct inode *vdir, struct dentry *dentry,
static int bch2_unlink(struct inode *vdir, struct dentry *dentry)
{
- return __bch2_unlink(vdir, dentry, -1);
+ return __bch2_unlink(vdir, dentry, false);
}
static int bch2_symlink(struct mnt_idmap *idmap,
@@ -1292,6 +1292,12 @@ static int bch2_vfs_write_inode(struct inode *vinode,
return ret;
}
+static int bch2_drop_inode(struct inode *vinode)
+{
+
+ return generic_drop_inode(vinode);
+}
+
static void bch2_evict_inode(struct inode *vinode)
{
struct bch_fs *c = vinode->i_sb->s_fs_info;
@@ -1496,6 +1502,7 @@ static const struct super_operations bch_super_operations = {
.alloc_inode = bch2_alloc_inode,
.destroy_inode = bch2_destroy_inode,
.write_inode = bch2_vfs_write_inode,
+ .drop_inode = bch2_drop_inode,
.evict_inode = bch2_evict_inode,
.sync_fs = bch2_sync_fs,
.statfs = bch2_statfs,