Re: [PATCH] code cleanup on fs/super.c

From: Ted Ts'o
Date: Thu Feb 17 2011 - 12:25:40 EST


On Thu, Feb 17, 2011 at 08:20:31AM -0800, Linus Torvalds wrote:
> On Thu, Feb 17, 2011 at 12:59 AM, Steven Liu <lingjiujianke@xxxxxxxxx> wrote:
> >
> >   Clean up the unsed code on fs/super.c, all filesystem using mount_bdev
> >   and mount_nodev to replace get_sb_bdev and get_sb_nodev.
>
> There might easily be external modules that still use this.
>
> Also, if you do this, then the same patch would also need to remove
> the declarations and the documentation entry, so that there is no sign
> at all of those functions in the whole kernel tree.

The documentation update should just state that previous users of
get_sb_bdev() and get_sb_bdev() can and should just use mount_bdev()
and mount_nodev() instead. The lines of code in the get_sb_*()
functions that do this:

mnt->mnt_root = root;
mnt->mnt_sb = root->d_sb;

Actually aren't necessary, since these functions are used in a
filesystem's file_system_type->mount() function, and vfs_kern_mount(),
which calls the type->mount() function, already does the above call.

So telling external modules that if you use get_sb_bdev(), you should
use mount_bdev() instead, should be just fine.

- Ted


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/