diff options
author | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-05-19 01:09:05 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-05-19 01:09:05 -0400 |
commit | c203e45f069af47ca7623e4dcd8c00bfba2722e4 (patch) | |
tree | 4563115b6565dcfd97015c1c9366fb3d07cabf19 /fs/nfs | |
parent | a94477da38e0b261a7ecea71f4c95a3bcd5be69c (diff) | |
parent | b8291ad07a7f3b5b990900f0001198ac23ba893e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/client.c | 20 | ||||
-rw-r--r-- | fs/nfs/super.c | 26 |
2 files changed, 35 insertions, 11 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index f2f3b284e6dd..89ac5bb0401c 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -1321,6 +1321,7 @@ static const struct file_operations nfs_server_list_fops = { | |||
1321 | .read = seq_read, | 1321 | .read = seq_read, |
1322 | .llseek = seq_lseek, | 1322 | .llseek = seq_lseek, |
1323 | .release = seq_release, | 1323 | .release = seq_release, |
1324 | .owner = THIS_MODULE, | ||
1324 | }; | 1325 | }; |
1325 | 1326 | ||
1326 | static int nfs_volume_list_open(struct inode *inode, struct file *file); | 1327 | static int nfs_volume_list_open(struct inode *inode, struct file *file); |
@@ -1341,6 +1342,7 @@ static const struct file_operations nfs_volume_list_fops = { | |||
1341 | .read = seq_read, | 1342 | .read = seq_read, |
1342 | .llseek = seq_lseek, | 1343 | .llseek = seq_lseek, |
1343 | .release = seq_release, | 1344 | .release = seq_release, |
1345 | .owner = THIS_MODULE, | ||
1344 | }; | 1346 | }; |
1345 | 1347 | ||
1346 | /* | 1348 | /* |
@@ -1500,33 +1502,29 @@ int __init nfs_fs_proc_init(void) | |||
1500 | { | 1502 | { |
1501 | struct proc_dir_entry *p; | 1503 | struct proc_dir_entry *p; |
1502 | 1504 | ||
1503 | proc_fs_nfs = proc_mkdir("nfsfs", proc_root_fs); | 1505 | proc_fs_nfs = proc_mkdir("fs/nfsfs", NULL); |
1504 | if (!proc_fs_nfs) | 1506 | if (!proc_fs_nfs) |
1505 | goto error_0; | 1507 | goto error_0; |
1506 | 1508 | ||
1507 | proc_fs_nfs->owner = THIS_MODULE; | 1509 | proc_fs_nfs->owner = THIS_MODULE; |
1508 | 1510 | ||
1509 | /* a file of servers with which we're dealing */ | 1511 | /* a file of servers with which we're dealing */ |
1510 | p = create_proc_entry("servers", S_IFREG|S_IRUGO, proc_fs_nfs); | 1512 | p = proc_create("servers", S_IFREG|S_IRUGO, |
1513 | proc_fs_nfs, &nfs_server_list_fops); | ||
1511 | if (!p) | 1514 | if (!p) |
1512 | goto error_1; | 1515 | goto error_1; |
1513 | 1516 | ||
1514 | p->proc_fops = &nfs_server_list_fops; | ||
1515 | p->owner = THIS_MODULE; | ||
1516 | |||
1517 | /* a file of volumes that we have mounted */ | 1517 | /* a file of volumes that we have mounted */ |
1518 | p = create_proc_entry("volumes", S_IFREG|S_IRUGO, proc_fs_nfs); | 1518 | p = proc_create("volumes", S_IFREG|S_IRUGO, |
1519 | proc_fs_nfs, &nfs_volume_list_fops); | ||
1519 | if (!p) | 1520 | if (!p) |
1520 | goto error_2; | 1521 | goto error_2; |
1521 | |||
1522 | p->proc_fops = &nfs_volume_list_fops; | ||
1523 | p->owner = THIS_MODULE; | ||
1524 | return 0; | 1522 | return 0; |
1525 | 1523 | ||
1526 | error_2: | 1524 | error_2: |
1527 | remove_proc_entry("servers", proc_fs_nfs); | 1525 | remove_proc_entry("servers", proc_fs_nfs); |
1528 | error_1: | 1526 | error_1: |
1529 | remove_proc_entry("nfsfs", proc_root_fs); | 1527 | remove_proc_entry("fs/nfsfs", NULL); |
1530 | error_0: | 1528 | error_0: |
1531 | return -ENOMEM; | 1529 | return -ENOMEM; |
1532 | } | 1530 | } |
@@ -1538,7 +1536,7 @@ void nfs_fs_proc_exit(void) | |||
1538 | { | 1536 | { |
1539 | remove_proc_entry("volumes", proc_fs_nfs); | 1537 | remove_proc_entry("volumes", proc_fs_nfs); |
1540 | remove_proc_entry("servers", proc_fs_nfs); | 1538 | remove_proc_entry("servers", proc_fs_nfs); |
1541 | remove_proc_entry("nfsfs", proc_root_fs); | 1539 | remove_proc_entry("fs/nfsfs", NULL); |
1542 | } | 1540 | } |
1543 | 1541 | ||
1544 | #endif /* CONFIG_PROC_FS */ | 1542 | #endif /* CONFIG_PROC_FS */ |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index fa220dc74609..7226a506f3ca 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1575,6 +1575,11 @@ static int nfs_compare_super(struct super_block *sb, void *data) | |||
1575 | return nfs_compare_mount_options(sb, server, mntflags); | 1575 | return nfs_compare_mount_options(sb, server, mntflags); |
1576 | } | 1576 | } |
1577 | 1577 | ||
1578 | static int nfs_bdi_register(struct nfs_server *server) | ||
1579 | { | ||
1580 | return bdi_register_dev(&server->backing_dev_info, server->s_dev); | ||
1581 | } | ||
1582 | |||
1578 | static int nfs_get_sb(struct file_system_type *fs_type, | 1583 | static int nfs_get_sb(struct file_system_type *fs_type, |
1579 | int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt) | 1584 | int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt) |
1580 | { | 1585 | { |
@@ -1617,6 +1622,10 @@ static int nfs_get_sb(struct file_system_type *fs_type, | |||
1617 | if (s->s_fs_info != server) { | 1622 | if (s->s_fs_info != server) { |
1618 | nfs_free_server(server); | 1623 | nfs_free_server(server); |
1619 | server = NULL; | 1624 | server = NULL; |
1625 | } else { | ||
1626 | error = nfs_bdi_register(server); | ||
1627 | if (error) | ||
1628 | goto error_splat_super; | ||
1620 | } | 1629 | } |
1621 | 1630 | ||
1622 | if (!s->s_root) { | 1631 | if (!s->s_root) { |
@@ -1664,6 +1673,7 @@ static void nfs_kill_super(struct super_block *s) | |||
1664 | { | 1673 | { |
1665 | struct nfs_server *server = NFS_SB(s); | 1674 | struct nfs_server *server = NFS_SB(s); |
1666 | 1675 | ||
1676 | bdi_unregister(&server->backing_dev_info); | ||
1667 | kill_anon_super(s); | 1677 | kill_anon_super(s); |
1668 | nfs_free_server(server); | 1678 | nfs_free_server(server); |
1669 | } | 1679 | } |
@@ -1708,6 +1718,10 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags, | |||
1708 | if (s->s_fs_info != server) { | 1718 | if (s->s_fs_info != server) { |
1709 | nfs_free_server(server); | 1719 | nfs_free_server(server); |
1710 | server = NULL; | 1720 | server = NULL; |
1721 | } else { | ||
1722 | error = nfs_bdi_register(server); | ||
1723 | if (error) | ||
1724 | goto error_splat_super; | ||
1711 | } | 1725 | } |
1712 | 1726 | ||
1713 | if (!s->s_root) { | 1727 | if (!s->s_root) { |
@@ -1984,6 +1998,10 @@ static int nfs4_get_sb(struct file_system_type *fs_type, | |||
1984 | if (s->s_fs_info != server) { | 1998 | if (s->s_fs_info != server) { |
1985 | nfs_free_server(server); | 1999 | nfs_free_server(server); |
1986 | server = NULL; | 2000 | server = NULL; |
2001 | } else { | ||
2002 | error = nfs_bdi_register(server); | ||
2003 | if (error) | ||
2004 | goto error_splat_super; | ||
1987 | } | 2005 | } |
1988 | 2006 | ||
1989 | if (!s->s_root) { | 2007 | if (!s->s_root) { |
@@ -2070,6 +2088,10 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags, | |||
2070 | if (s->s_fs_info != server) { | 2088 | if (s->s_fs_info != server) { |
2071 | nfs_free_server(server); | 2089 | nfs_free_server(server); |
2072 | server = NULL; | 2090 | server = NULL; |
2091 | } else { | ||
2092 | error = nfs_bdi_register(server); | ||
2093 | if (error) | ||
2094 | goto error_splat_super; | ||
2073 | } | 2095 | } |
2074 | 2096 | ||
2075 | if (!s->s_root) { | 2097 | if (!s->s_root) { |
@@ -2149,6 +2171,10 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags, | |||
2149 | if (s->s_fs_info != server) { | 2171 | if (s->s_fs_info != server) { |
2150 | nfs_free_server(server); | 2172 | nfs_free_server(server); |
2151 | server = NULL; | 2173 | server = NULL; |
2174 | } else { | ||
2175 | error = nfs_bdi_register(server); | ||
2176 | if (error) | ||
2177 | goto error_splat_super; | ||
2152 | } | 2178 | } |
2153 | 2179 | ||
2154 | if (!s->s_root) { | 2180 | if (!s->s_root) { |