mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 06:12:08 +00:00
mm: bdi: expose the BDI object in sysfs for NFS
Register NFS' backing_dev_info under sysfs with the name "nfs-MAJOR:MINOR" Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: "J. Bruce Fields" <bfields@fieldses.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
cf0ca9fe5d
commit
fa799759f9
@ -1575,6 +1575,11 @@ static int nfs_compare_super(struct super_block *sb, void *data)
|
||||
return nfs_compare_mount_options(sb, server, mntflags);
|
||||
}
|
||||
|
||||
static int nfs_bdi_register(struct nfs_server *server)
|
||||
{
|
||||
return bdi_register_dev(&server->backing_dev_info, server->s_dev);
|
||||
}
|
||||
|
||||
static int nfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt)
|
||||
{
|
||||
@ -1617,6 +1622,10 @@ static int nfs_get_sb(struct file_system_type *fs_type,
|
||||
if (s->s_fs_info != server) {
|
||||
nfs_free_server(server);
|
||||
server = NULL;
|
||||
} else {
|
||||
error = nfs_bdi_register(server);
|
||||
if (error)
|
||||
goto error_splat_super;
|
||||
}
|
||||
|
||||
if (!s->s_root) {
|
||||
@ -1664,6 +1673,7 @@ static void nfs_kill_super(struct super_block *s)
|
||||
{
|
||||
struct nfs_server *server = NFS_SB(s);
|
||||
|
||||
bdi_unregister(&server->backing_dev_info);
|
||||
kill_anon_super(s);
|
||||
nfs_free_server(server);
|
||||
}
|
||||
@ -1708,6 +1718,10 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
|
||||
if (s->s_fs_info != server) {
|
||||
nfs_free_server(server);
|
||||
server = NULL;
|
||||
} else {
|
||||
error = nfs_bdi_register(server);
|
||||
if (error)
|
||||
goto error_splat_super;
|
||||
}
|
||||
|
||||
if (!s->s_root) {
|
||||
@ -1984,6 +1998,10 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
|
||||
if (s->s_fs_info != server) {
|
||||
nfs_free_server(server);
|
||||
server = NULL;
|
||||
} else {
|
||||
error = nfs_bdi_register(server);
|
||||
if (error)
|
||||
goto error_splat_super;
|
||||
}
|
||||
|
||||
if (!s->s_root) {
|
||||
@ -2070,6 +2088,10 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
|
||||
if (s->s_fs_info != server) {
|
||||
nfs_free_server(server);
|
||||
server = NULL;
|
||||
} else {
|
||||
error = nfs_bdi_register(server);
|
||||
if (error)
|
||||
goto error_splat_super;
|
||||
}
|
||||
|
||||
if (!s->s_root) {
|
||||
@ -2149,6 +2171,10 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags,
|
||||
if (s->s_fs_info != server) {
|
||||
nfs_free_server(server);
|
||||
server = NULL;
|
||||
} else {
|
||||
error = nfs_bdi_register(server);
|
||||
if (error)
|
||||
goto error_splat_super;
|
||||
}
|
||||
|
||||
if (!s->s_root) {
|
||||
|
Loading…
Reference in New Issue
Block a user