Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6cfd0148 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Al Viro
Browse files

push BKL down into ->put_super



Move BKL into ->put_super from the only caller.  A couple of
filesystems had trivial enough ->put_super (only kfree and NULLing of
s_fs_info + stuff in there) to not get any locking: coda, cramfs, efs,
hugetlbfs, omfs, qnx4, shmem, all others got the full treatment.  Most
of them probably don't need it, but I'd rather sort that out individually.
Preferably after all the other BKL pushdowns in that area.

[AV: original used to move lock_super() down as well; these changes are
removed since we don't do lock_super() at all in generic_shutdown_super()
now]
[AV: fuse, btrfs and xfs are known to need no damn BKL, exempt]

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent a9e220f8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -132,11 +132,15 @@ static void adfs_put_super(struct super_block *sb)
	int i;
	struct adfs_sb_info *asb = ADFS_SB(sb);

	lock_kernel();

	for (i = 0; i < asb->s_map_size; i++)
		brelse(asb->s_map[i].dm_bh);
	kfree(asb->s_map);
	kfree(asb);
	sb->s_fs_info = NULL;

	unlock_kernel();
}

static int adfs_show_options(struct seq_file *seq, struct vfsmount *mnt)
+4 −1
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ affs_put_super(struct super_block *sb)
	struct affs_sb_info *sbi = AFFS_SB(sb);
	pr_debug("AFFS: put_super()\n");

	lock_kernel();

	if (!(sb->s_flags & MS_RDONLY)) {
		AFFS_ROOT_TAIL(sb, sbi->s_root_bh)->bm_flag = cpu_to_be32(1);
		secs_to_datestamp(get_seconds(),
@@ -42,7 +44,8 @@ affs_put_super(struct super_block *sb)
	affs_brelse(sbi->s_root_bh);
	kfree(sbi);
	sb->s_fs_info = NULL;
	return;

	unlock_kernel();
}

static void
+4 −0
Original line number Diff line number Diff line
@@ -440,8 +440,12 @@ static void afs_put_super(struct super_block *sb)

	_enter("");

	lock_kernel();

	afs_put_volume(as->volume);

	unlock_kernel();

	_leave("");
}

+4 −1
Original line number Diff line number Diff line
@@ -737,6 +737,8 @@ parse_options(char *options, befs_mount_options * opts)
static void
befs_put_super(struct super_block *sb)
{
	lock_kernel();

	kfree(BEFS_SB(sb)->mount_opts.iocharset);
	BEFS_SB(sb)->mount_opts.iocharset = NULL;

@@ -747,7 +749,8 @@ befs_put_super(struct super_block *sb)

	kfree(sb->s_fs_info);
	sb->s_fs_info = NULL;
	return;

	unlock_kernel();
}

/* Allocate private field of the superblock, fill it.
+4 −0
Original line number Diff line number Diff line
@@ -217,6 +217,8 @@ static void bfs_put_super(struct super_block *s)
	if (!info)
		return;

	lock_kernel();

	if (s->s_dirt)
		bfs_write_super(s);

@@ -225,6 +227,8 @@ static void bfs_put_super(struct super_block *s)
	kfree(info->si_imap);
	kfree(info);
	s->s_fs_info = NULL;

	unlock_kernel();
}

static int bfs_statfs(struct dentry *dentry, struct kstatfs *buf)
Loading