diff options
Diffstat (limited to 'fs/nfs')
| -rw-r--r-- | fs/nfs/callback.c | 2 | ||||
| -rw-r--r-- | fs/nfs/client.c | 54 | ||||
| -rw-r--r-- | fs/nfs/super.c | 10 |
3 files changed, 14 insertions, 52 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index 75f309c8741a..a796be5051bf 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/sunrpc/svcsock.h> | 14 | #include <linux/sunrpc/svcsock.h> |
| 15 | #include <linux/nfs_fs.h> | 15 | #include <linux/nfs_fs.h> |
| 16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
| 17 | #include <linux/freezer.h> | ||
| 17 | 18 | ||
| 18 | #include <net/inet_sock.h> | 19 | #include <net/inet_sock.h> |
| 19 | 20 | ||
| @@ -67,6 +68,7 @@ static void nfs_callback_svc(struct svc_rqst *rqstp) | |||
| 67 | daemonize("nfsv4-svc"); | 68 | daemonize("nfsv4-svc"); |
| 68 | /* Process request with signals blocked, but allow SIGKILL. */ | 69 | /* Process request with signals blocked, but allow SIGKILL. */ |
| 69 | allow_signal(SIGKILL); | 70 | allow_signal(SIGKILL); |
| 71 | set_freezable(); | ||
| 70 | 72 | ||
| 71 | complete(&nfs_callback_info.started); | 73 | complete(&nfs_callback_info.started); |
| 72 | 74 | ||
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index ccb455053ee4..a49f9feff776 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
| @@ -1206,23 +1206,9 @@ static int nfs_server_list_open(struct inode *inode, struct file *file) | |||
| 1206 | */ | 1206 | */ |
| 1207 | static void *nfs_server_list_start(struct seq_file *m, loff_t *_pos) | 1207 | static void *nfs_server_list_start(struct seq_file *m, loff_t *_pos) |
| 1208 | { | 1208 | { |
| 1209 | struct list_head *_p; | ||
| 1210 | loff_t pos = *_pos; | ||
| 1211 | |||
| 1212 | /* lock the list against modification */ | 1209 | /* lock the list against modification */ |
| 1213 | spin_lock(&nfs_client_lock); | 1210 | spin_lock(&nfs_client_lock); |
| 1214 | 1211 | return seq_list_start_head(&nfs_client_list, *_pos); | |
| 1215 | /* allow for the header line */ | ||
| 1216 | if (!pos) | ||
| 1217 | return SEQ_START_TOKEN; | ||
| 1218 | pos--; | ||
| 1219 | |||
| 1220 | /* find the n'th element in the list */ | ||
| 1221 | list_for_each(_p, &nfs_client_list) | ||
| 1222 | if (!pos--) | ||
| 1223 | break; | ||
| 1224 | |||
| 1225 | return _p != &nfs_client_list ? _p : NULL; | ||
| 1226 | } | 1212 | } |
| 1227 | 1213 | ||
| 1228 | /* | 1214 | /* |
| @@ -1230,14 +1216,7 @@ static void *nfs_server_list_start(struct seq_file *m, loff_t *_pos) | |||
| 1230 | */ | 1216 | */ |
| 1231 | static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos) | 1217 | static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos) |
| 1232 | { | 1218 | { |
| 1233 | struct list_head *_p; | 1219 | return seq_list_next(v, &nfs_client_list, pos); |
| 1234 | |||
| 1235 | (*pos)++; | ||
| 1236 | |||
| 1237 | _p = v; | ||
| 1238 | _p = (v == SEQ_START_TOKEN) ? nfs_client_list.next : _p->next; | ||
| 1239 | |||
| 1240 | return _p != &nfs_client_list ? _p : NULL; | ||
| 1241 | } | 1220 | } |
| 1242 | 1221 | ||
| 1243 | /* | 1222 | /* |
| @@ -1256,7 +1235,7 @@ static int nfs_server_list_show(struct seq_file *m, void *v) | |||
| 1256 | struct nfs_client *clp; | 1235 | struct nfs_client *clp; |
| 1257 | 1236 | ||
| 1258 | /* display header on line 1 */ | 1237 | /* display header on line 1 */ |
| 1259 | if (v == SEQ_START_TOKEN) { | 1238 | if (v == &nfs_client_list) { |
| 1260 | seq_puts(m, "NV SERVER PORT USE HOSTNAME\n"); | 1239 | seq_puts(m, "NV SERVER PORT USE HOSTNAME\n"); |
| 1261 | return 0; | 1240 | return 0; |
| 1262 | } | 1241 | } |
| @@ -1297,23 +1276,9 @@ static int nfs_volume_list_open(struct inode *inode, struct file *file) | |||
| 1297 | */ | 1276 | */ |
| 1298 | static void *nfs_volume_list_start(struct seq_file *m, loff_t *_pos) | 1277 | static void *nfs_volume_list_start(struct seq_file *m, loff_t *_pos) |
| 1299 | { | 1278 | { |
| 1300 | struct list_head *_p; | ||
| 1301 | loff_t pos = *_pos; | ||
| 1302 | |||
| 1303 | /* lock the list against modification */ | 1279 | /* lock the list against modification */ |
| 1304 | spin_lock(&nfs_client_lock); | 1280 | spin_lock(&nfs_client_lock); |
| 1305 | 1281 | return seq_list_start_head(&nfs_volume_list, *_pos); | |
| 1306 | /* allow for the header line */ | ||
| 1307 | if (!pos) | ||
| 1308 | return SEQ_START_TOKEN; | ||
| 1309 | pos--; | ||
| 1310 | |||
| 1311 | /* find the n'th element in the list */ | ||
| 1312 | list_for_each(_p, &nfs_volume_list) | ||
| 1313 | if (!pos--) | ||
| 1314 | break; | ||
| 1315 | |||
| 1316 | return _p != &nfs_volume_list ? _p : NULL; | ||
| 1317 | } | 1282 | } |
| 1318 | 1283 | ||
| 1319 | /* | 1284 | /* |
| @@ -1321,14 +1286,7 @@ static void *nfs_volume_list_start(struct seq_file *m, loff_t *_pos) | |||
| 1321 | */ | 1286 | */ |
| 1322 | static void *nfs_volume_list_next(struct seq_file *p, void *v, loff_t *pos) | 1287 | static void *nfs_volume_list_next(struct seq_file *p, void *v, loff_t *pos) |
| 1323 | { | 1288 | { |
| 1324 | struct list_head *_p; | 1289 | return seq_list_next(v, &nfs_volume_list, pos); |
| 1325 | |||
| 1326 | (*pos)++; | ||
| 1327 | |||
| 1328 | _p = v; | ||
| 1329 | _p = (v == SEQ_START_TOKEN) ? nfs_volume_list.next : _p->next; | ||
| 1330 | |||
| 1331 | return _p != &nfs_volume_list ? _p : NULL; | ||
| 1332 | } | 1290 | } |
| 1333 | 1291 | ||
| 1334 | /* | 1292 | /* |
| @@ -1349,7 +1307,7 @@ static int nfs_volume_list_show(struct seq_file *m, void *v) | |||
| 1349 | char dev[8], fsid[17]; | 1307 | char dev[8], fsid[17]; |
| 1350 | 1308 | ||
| 1351 | /* display header on line 1 */ | 1309 | /* display header on line 1 */ |
| 1352 | if (v == SEQ_START_TOKEN) { | 1310 | if (v == &nfs_volume_list) { |
| 1353 | seq_puts(m, "NV SERVER PORT DEV FSID\n"); | 1311 | seq_puts(m, "NV SERVER PORT DEV FSID\n"); |
| 1354 | return 0; | 1312 | return 0; |
| 1355 | } | 1313 | } |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index a2b1af89ca1a..adffe1615c51 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
| @@ -300,7 +300,10 @@ static const struct super_operations nfs4_sops = { | |||
| 300 | }; | 300 | }; |
| 301 | #endif | 301 | #endif |
| 302 | 302 | ||
| 303 | static struct shrinker *acl_shrinker; | 303 | static struct shrinker acl_shrinker = { |
| 304 | .shrink = nfs_access_cache_shrinker, | ||
| 305 | .seeks = DEFAULT_SEEKS, | ||
| 306 | }; | ||
| 304 | 307 | ||
| 305 | /* | 308 | /* |
| 306 | * Register the NFS filesystems | 309 | * Register the NFS filesystems |
| @@ -321,7 +324,7 @@ int __init register_nfs_fs(void) | |||
| 321 | if (ret < 0) | 324 | if (ret < 0) |
| 322 | goto error_2; | 325 | goto error_2; |
| 323 | #endif | 326 | #endif |
| 324 | acl_shrinker = set_shrinker(DEFAULT_SEEKS, nfs_access_cache_shrinker); | 327 | register_shrinker(&acl_shrinker); |
| 325 | return 0; | 328 | return 0; |
| 326 | 329 | ||
| 327 | #ifdef CONFIG_NFS_V4 | 330 | #ifdef CONFIG_NFS_V4 |
| @@ -339,8 +342,7 @@ error_0: | |||
| 339 | */ | 342 | */ |
| 340 | void __exit unregister_nfs_fs(void) | 343 | void __exit unregister_nfs_fs(void) |
| 341 | { | 344 | { |
| 342 | if (acl_shrinker != NULL) | 345 | unregister_shrinker(&acl_shrinker); |
| 343 | remove_shrinker(acl_shrinker); | ||
| 344 | #ifdef CONFIG_NFS_V4 | 346 | #ifdef CONFIG_NFS_V4 |
| 345 | unregister_filesystem(&nfs4_fs_type); | 347 | unregister_filesystem(&nfs4_fs_type); |
| 346 | nfs_unregister_sysctl(); | 348 | nfs_unregister_sysctl(); |
