Commit 2f96736a authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (4/4) ->kill_sb() switchover

bdev filesystems switched.  Changes documented in Locking and porting.
parent d18f45e6
......@@ -121,10 +121,16 @@ by better scheme anyway.
--------------------------- file_system_type ---------------------------
prototypes:
struct super_block *(*read_super) (struct super_block *, void *, int);
struct super_block *(*get_sb) (struct file_system_type *, int, char *, void *);
void (*kill_sb) (struct super_block *);
locking rules:
may block BKL ->s_lock mount_sem
yes yes yes maybe
may block BKL
get_sb yes yes
kill_sb yes yes
->get_sb() returns error or a locked superblock (exclusive on ->s_umount).
->kill_sb() takes a locked superblock, does all shutdown work on it,
unlocks and drops the reference.
--------------------------- address_space_operations --------------------------
prototypes:
......
......@@ -99,3 +99,20 @@ free to drop it...
->link() callers hold ->i_sem on the object we are linking to. Some of your
problems might be over...
---
[mandatory]
new file_system_type method - kill_sb(superblock). If you are converting
an existing filesystem, set it according to ->fs_flags:
FS_REQUIRES_DEV - kill_block_super
FS_LITTER - kill_litter_super
neither - kill_anon_super
FS_LITTER is gone - just remove it from fs_flags.
---
[mandatory]
FS_SINGLE is gone (actually, that had happened back when ->get_sb()
went in - and hadn't been documented ;-/). Just remove it from fs_flags
(and see ->get_sb() entry for other actions).
......@@ -485,6 +485,7 @@ static struct file_system_type adfs_fs_type = {
owner: THIS_MODULE,
name: "adfs",
get_sb: adfs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -536,6 +536,7 @@ static struct file_system_type affs_fs_type = {
owner: THIS_MODULE,
name: "affs",
get_sb: affs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -371,6 +371,7 @@ static struct file_system_type bfs_fs_type = {
owner: THIS_MODULE,
name: "bfs",
get_sb: bfs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -458,6 +458,7 @@ static struct file_system_type cramfs_fs_type = {
owner: THIS_MODULE,
name: "cramfs",
get_sb: cramfs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -24,6 +24,7 @@ static struct file_system_type efs_fs_type = {
owner: THIS_MODULE,
name: "efs",
get_sb: efs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -853,6 +853,7 @@ static struct file_system_type ext2_fs_type = {
owner: THIS_MODULE,
name: "ext2",
get_sb: ext2_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -1778,6 +1778,7 @@ static struct file_system_type ext3_fs_type = {
owner: THIS_MODULE,
name: "ext3",
get_sb: ext3_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -237,6 +237,7 @@ static struct file_system_type vxfs_fs_type = {
owner: THIS_MODULE,
name: "vxfs",
get_sb: vxfs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -105,6 +105,7 @@ static struct file_system_type hfs_fs = {
owner: THIS_MODULE,
name: "hfs",
get_sb: hfs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -619,6 +619,7 @@ static struct file_system_type hpfs_fs_type = {
owner: THIS_MODULE,
name: "hpfs",
get_sb: hpfs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -1404,6 +1404,7 @@ static struct file_system_type iso9660_fs_type = {
owner: THIS_MODULE,
name: "iso9660",
get_sb: isofs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -1763,6 +1763,7 @@ static struct file_system_type jffs_fs_type = {
owner: THIS_MODULE,
name: "jffs",
get_sb: jffs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -356,6 +356,7 @@ static struct file_system_type jffs2_fs_type = {
owner: THIS_MODULE,
name: "jffs2",
get_sb: jffs2_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -364,6 +364,7 @@ static struct file_system_type jfs_fs_type = {
owner: THIS_MODULE,
name: "jfs",
get_sb: jfs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -567,6 +567,7 @@ static struct file_system_type minix_fs_type = {
owner: THIS_MODULE,
name: "minix",
get_sb: minix_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -35,6 +35,7 @@ static struct file_system_type msdos_fs_type = {
owner: THIS_MODULE,
name: "msdos",
get_sb: msdos_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -1168,6 +1168,7 @@ static struct file_system_type ntfs_fs_type = {
owner: THIS_MODULE,
name: "ntfs",
get_sb: ntfs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -549,6 +549,7 @@ static struct file_system_type qnx4_fs_type = {
owner: THIS_MODULE,
name: "qnx4",
get_sb: qnx4_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -1193,6 +1193,7 @@ static struct file_system_type reiserfs_fs_type = {
owner: THIS_MODULE,
name: "reiserfs",
get_sb: reiserfs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -540,6 +540,7 @@ static struct file_system_type romfs_fs_type = {
owner: THIS_MODULE,
name: "romfs",
get_sb: romfs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -432,16 +432,6 @@ static void generic_shutdown_super(struct super_block *sb)
remove_super(sb);
}
static void shutdown_super(struct super_block *sb)
{
struct file_system_type *fs = sb->s_type;
struct block_device *bdev = sb->s_bdev;
generic_shutdown_super(sb);
bd_release(bdev);
blkdev_put(bdev, BDEV_FS);
}
void kill_super(struct super_block *sb)
{
struct file_system_type *fs = sb->s_type;
......@@ -450,10 +440,7 @@ void kill_super(struct super_block *sb)
return;
down_write(&sb->s_umount);
if (fs->kill_sb)
fs->kill_sb(sb);
else
shutdown_super(sb);
put_filesystem(fs);
}
......
......@@ -490,6 +490,7 @@ static struct file_system_type sysv_fs_type = {
owner: THIS_MODULE,
name: "sysv",
get_sb: sysv_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......@@ -497,6 +498,7 @@ static struct file_system_type v7_fs_type = {
owner: THIS_MODULE,
name: "v7",
get_sb: v7_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -106,6 +106,7 @@ static struct file_system_type udf_fstype = {
owner: THIS_MODULE,
name: "udf",
get_sb: udf_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -1018,6 +1018,7 @@ static struct file_system_type ufs_fs_type = {
owner: THIS_MODULE,
name: "ufs",
get_sb: ufs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
......@@ -21,6 +21,7 @@ static struct file_system_type vfat_fs_type = {
owner: THIS_MODULE,
name: "vfat",
get_sb: vfat_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment