patch-2.4.0-test10 linux/fs/super.c
Next file: linux/fs/umsdos/inode.c
Previous file: linux/fs/proc/base.c
Back to the patch index
Back to the overall index
- Lines: 53
- Date:
Mon Oct 16 12:57:59 2000
- Orig file:
v2.4.0-test9/linux/fs/super.c
- Orig date:
Sun Oct 8 10:50:33 2000
diff -u --recursive --new-file v2.4.0-test9/linux/fs/super.c linux/fs/super.c
@@ -884,24 +884,27 @@
return sb;
}
-static struct block_device *kill_super(struct super_block *sb, int umount_root)
+static void kill_super(struct super_block *sb, int umount_root)
{
struct block_device *bdev;
kdev_t dev;
struct dentry *root = sb->s_root;
+ struct file_system_type *fs = sb->s_type;
+ struct super_operations *sop = sb->s_op;
+
sb->s_root = NULL;
/* Need to clean after the sucker */
- if (sb->s_type->fs_flags & FS_LITTER)
+ if (fs->fs_flags & FS_LITTER)
d_genocide(root);
- if (sb->s_type->fs_flags & (FS_SINGLE|FS_LITTER))
+ if (fs->fs_flags & (FS_SINGLE|FS_LITTER))
shrink_dcache_parent(root);
dput(root);
lock_super(sb);
- if (sb->s_op) {
- if (sb->s_op->write_super && sb->s_dirt)
- sb->s_op->write_super(sb);
- if (sb->s_op->put_super)
- sb->s_op->put_super(sb);
+ if (sop) {
+ if (sop->write_super && sb->s_dirt)
+ sop->write_super(sb);
+ if (sop->put_super)
+ sop->put_super(sb);
}
/* Forget any remaining inodes */
@@ -914,7 +917,7 @@
sb->s_dev = 0; /* Free the superblock */
bdev = sb->s_bdev;
sb->s_bdev = NULL;
- put_filesystem(sb->s_type);
+ put_filesystem(fs);
sb->s_type = NULL;
unlock_super(sb);
if (umount_root) {
@@ -928,7 +931,6 @@
bdput(bdev);
} else
put_unnamed_dev(dev);
- return bdev;
}
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)