diff options
Diffstat (limited to 'fs')
78 files changed, 365 insertions, 190 deletions
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 91dad63e5a2d..2756dcd5de6e 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c | |||
| @@ -365,3 +365,4 @@ struct file_system_type v9fs_fs_type = { | |||
| 365 | .owner = THIS_MODULE, | 365 | .owner = THIS_MODULE, |
| 366 | .fs_flags = FS_RENAME_DOES_D_MOVE, | 366 | .fs_flags = FS_RENAME_DOES_D_MOVE, |
| 367 | }; | 367 | }; |
| 368 | MODULE_ALIAS_FS("9p"); | ||
diff --git a/fs/adfs/super.c b/fs/adfs/super.c index d57122935793..0ff4bae2c2a2 100644 --- a/fs/adfs/super.c +++ b/fs/adfs/super.c | |||
| @@ -524,6 +524,7 @@ static struct file_system_type adfs_fs_type = { | |||
| 524 | .kill_sb = kill_block_super, | 524 | .kill_sb = kill_block_super, |
| 525 | .fs_flags = FS_REQUIRES_DEV, | 525 | .fs_flags = FS_REQUIRES_DEV, |
| 526 | }; | 526 | }; |
| 527 | MODULE_ALIAS_FS("adfs"); | ||
| 527 | 528 | ||
| 528 | static int __init init_adfs_fs(void) | 529 | static int __init init_adfs_fs(void) |
| 529 | { | 530 | { |
diff --git a/fs/affs/super.c b/fs/affs/super.c index b84dc7352502..45161a832bbc 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c | |||
| @@ -622,6 +622,7 @@ static struct file_system_type affs_fs_type = { | |||
| 622 | .kill_sb = kill_block_super, | 622 | .kill_sb = kill_block_super, |
| 623 | .fs_flags = FS_REQUIRES_DEV, | 623 | .fs_flags = FS_REQUIRES_DEV, |
| 624 | }; | 624 | }; |
| 625 | MODULE_ALIAS_FS("affs"); | ||
| 625 | 626 | ||
| 626 | static int __init init_affs_fs(void) | 627 | static int __init init_affs_fs(void) |
| 627 | { | 628 | { |
diff --git a/fs/afs/super.c b/fs/afs/super.c index 7c31ec399575..c4861557e385 100644 --- a/fs/afs/super.c +++ b/fs/afs/super.c | |||
| @@ -45,6 +45,7 @@ struct file_system_type afs_fs_type = { | |||
| 45 | .kill_sb = afs_kill_super, | 45 | .kill_sb = afs_kill_super, |
| 46 | .fs_flags = 0, | 46 | .fs_flags = 0, |
| 47 | }; | 47 | }; |
| 48 | MODULE_ALIAS_FS("afs"); | ||
| 48 | 49 | ||
| 49 | static const struct super_operations afs_super_ops = { | 50 | static const struct super_operations afs_super_ops = { |
| 50 | .statfs = afs_statfs, | 51 | .statfs = afs_statfs, |
diff --git a/fs/autofs4/init.c b/fs/autofs4/init.c index cddc74b9cdb2..b3db517e89ec 100644 --- a/fs/autofs4/init.c +++ b/fs/autofs4/init.c | |||
| @@ -26,6 +26,7 @@ static struct file_system_type autofs_fs_type = { | |||
| 26 | .mount = autofs_mount, | 26 | .mount = autofs_mount, |
| 27 | .kill_sb = autofs4_kill_sb, | 27 | .kill_sb = autofs4_kill_sb, |
| 28 | }; | 28 | }; |
| 29 | MODULE_ALIAS_FS("autofs"); | ||
| 29 | 30 | ||
| 30 | static int __init init_autofs4_fs(void) | 31 | static int __init init_autofs4_fs(void) |
| 31 | { | 32 | { |
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index c8f4e25eb9e2..8615ee89ab55 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c | |||
| @@ -951,6 +951,7 @@ static struct file_system_type befs_fs_type = { | |||
| 951 | .kill_sb = kill_block_super, | 951 | .kill_sb = kill_block_super, |
| 952 | .fs_flags = FS_REQUIRES_DEV, | 952 | .fs_flags = FS_REQUIRES_DEV, |
| 953 | }; | 953 | }; |
| 954 | MODULE_ALIAS_FS("befs"); | ||
| 954 | 955 | ||
| 955 | static int __init | 956 | static int __init |
| 956 | init_befs_fs(void) | 957 | init_befs_fs(void) |
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 737aaa3f7090..5e376bb93419 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c | |||
| @@ -473,6 +473,7 @@ static struct file_system_type bfs_fs_type = { | |||
| 473 | .kill_sb = kill_block_super, | 473 | .kill_sb = kill_block_super, |
| 474 | .fs_flags = FS_REQUIRES_DEV, | 474 | .fs_flags = FS_REQUIRES_DEV, |
| 475 | }; | 475 | }; |
| 476 | MODULE_ALIAS_FS("bfs"); | ||
| 476 | 477 | ||
| 477 | static int __init init_bfs_fs(void) | 478 | static int __init init_bfs_fs(void) |
| 478 | { | 479 | { |
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index fecbbf3f8ff2..751df5e4f61a 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c | |||
| @@ -720,6 +720,7 @@ static struct file_system_type bm_fs_type = { | |||
| 720 | .mount = bm_mount, | 720 | .mount = bm_mount, |
| 721 | .kill_sb = kill_litter_super, | 721 | .kill_sb = kill_litter_super, |
| 722 | }; | 722 | }; |
| 723 | MODULE_ALIAS_FS("binfmt_misc"); | ||
| 723 | 724 | ||
| 724 | static int __init init_misc_binfmt(void) | 725 | static int __init init_misc_binfmt(void) |
| 725 | { | 726 | { |
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 0b278b117cbe..14fce27b4780 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c | |||
| @@ -22,8 +22,9 @@ | |||
| 22 | #include "disk-io.h" | 22 | #include "disk-io.h" |
| 23 | #include "transaction.h" | 23 | #include "transaction.h" |
| 24 | 24 | ||
| 25 | #define BTRFS_DELAYED_WRITEBACK 400 | 25 | #define BTRFS_DELAYED_WRITEBACK 512 |
| 26 | #define BTRFS_DELAYED_BACKGROUND 100 | 26 | #define BTRFS_DELAYED_BACKGROUND 128 |
| 27 | #define BTRFS_DELAYED_BATCH 16 | ||
| 27 | 28 | ||
| 28 | static struct kmem_cache *delayed_node_cache; | 29 | static struct kmem_cache *delayed_node_cache; |
| 29 | 30 | ||
| @@ -494,6 +495,15 @@ static int __btrfs_add_delayed_deletion_item(struct btrfs_delayed_node *node, | |||
| 494 | BTRFS_DELAYED_DELETION_ITEM); | 495 | BTRFS_DELAYED_DELETION_ITEM); |
| 495 | } | 496 | } |
| 496 | 497 | ||
| 498 | static void finish_one_item(struct btrfs_delayed_root *delayed_root) | ||
| 499 | { | ||
| 500 | int seq = atomic_inc_return(&delayed_root->items_seq); | ||
| 501 | if ((atomic_dec_return(&delayed_root->items) < | ||
| 502 | BTRFS_DELAYED_BACKGROUND || seq % BTRFS_DELAYED_BATCH == 0) && | ||
| 503 | waitqueue_active(&delayed_root->wait)) | ||
| 504 | wake_up(&delayed_root->wait); | ||
| 505 | } | ||
| 506 | |||
| 497 | static void __btrfs_remove_delayed_item(struct btrfs_delayed_item *delayed_item) | 507 | static void __btrfs_remove_delayed_item(struct btrfs_delayed_item *delayed_item) |
| 498 | { | 508 | { |
| 499 | struct rb_root *root; | 509 | struct rb_root *root; |
| @@ -512,10 +522,8 @@ static void __btrfs_remove_delayed_item(struct btrfs_delayed_item *delayed_item) | |||
| 512 | 522 | ||
| 513 | rb_erase(&delayed_item->rb_node, root); | 523 | rb_erase(&delayed_item->rb_node, root); |
| 514 | delayed_item->delayed_node->count--; | 524 | delayed_item->delayed_node->count--; |
| 515 | if (atomic_dec_return(&delayed_root->items) < | 525 | |
| 516 | BTRFS_DELAYED_BACKGROUND && | 526 | finish_one_item(delayed_root); |
| 517 | waitqueue_active(&delayed_root->wait)) | ||
| 518 | wake_up(&delayed_root->wait); | ||
| 519 | } | 527 | } |
| 520 | 528 | ||
| 521 | static void btrfs_release_delayed_item(struct btrfs_delayed_item *item) | 529 | static void btrfs_release_delayed_item(struct btrfs_delayed_item *item) |
| @@ -1056,10 +1064,7 @@ static void btrfs_release_delayed_inode(struct btrfs_delayed_node *delayed_node) | |||
| 1056 | delayed_node->count--; | 1064 | delayed_node->count--; |
| 1057 | 1065 | ||
| 1058 | delayed_root = delayed_node->root->fs_info->delayed_root; | 1066 | delayed_root = delayed_node->root->fs_info->delayed_root; |
| 1059 | if (atomic_dec_return(&delayed_root->items) < | 1067 | finish_one_item(delayed_root); |
| 1060 | BTRFS_DELAYED_BACKGROUND && | ||
| 1061 | waitqueue_active(&delayed_root->wait)) | ||
| 1062 | wake_up(&delayed_root->wait); | ||
| 1063 | } | 1068 | } |
| 1064 | } | 1069 | } |
| 1065 | 1070 | ||
| @@ -1304,35 +1309,44 @@ void btrfs_remove_delayed_node(struct inode *inode) | |||
| 1304 | btrfs_release_delayed_node(delayed_node); | 1309 | btrfs_release_delayed_node(delayed_node); |
| 1305 | } | 1310 | } |
| 1306 | 1311 | ||
| 1307 | struct btrfs_async_delayed_node { | 1312 | struct btrfs_async_delayed_work { |
| 1308 | struct btrfs_root *root; | 1313 | struct btrfs_delayed_root *delayed_root; |
| 1309 | struct btrfs_delayed_node *delayed_node; | 1314 | int nr; |
| 1310 | struct btrfs_work work; | 1315 | struct btrfs_work work; |
| 1311 | }; | 1316 | }; |
| 1312 | 1317 | ||
| 1313 | static void btrfs_async_run_delayed_node_done(struct btrfs_work *work) | 1318 | static void btrfs_async_run_delayed_root(struct btrfs_work *work) |
| 1314 | { | 1319 | { |
| 1315 | struct btrfs_async_delayed_node *async_node; | 1320 | struct btrfs_async_delayed_work *async_work; |
| 1321 | struct btrfs_delayed_root *delayed_root; | ||
| 1316 | struct btrfs_trans_handle *trans; | 1322 | struct btrfs_trans_handle *trans; |
| 1317 | struct btrfs_path *path; | 1323 | struct btrfs_path *path; |
| 1318 | struct btrfs_delayed_node *delayed_node = NULL; | 1324 | struct btrfs_delayed_node *delayed_node = NULL; |
| 1319 | struct btrfs_root *root; | 1325 | struct btrfs_root *root; |
| 1320 | struct btrfs_block_rsv *block_rsv; | 1326 | struct btrfs_block_rsv *block_rsv; |
| 1321 | int need_requeue = 0; | 1327 | int total_done = 0; |
| 1322 | 1328 | ||
| 1323 | async_node = container_of(work, struct btrfs_async_delayed_node, work); | 1329 | async_work = container_of(work, struct btrfs_async_delayed_work, work); |
| 1330 | delayed_root = async_work->delayed_root; | ||
| 1324 | 1331 | ||
| 1325 | path = btrfs_alloc_path(); | 1332 | path = btrfs_alloc_path(); |
| 1326 | if (!path) | 1333 | if (!path) |
| 1327 | goto out; | 1334 | goto out; |
| 1328 | path->leave_spinning = 1; | ||
| 1329 | 1335 | ||
| 1330 | delayed_node = async_node->delayed_node; | 1336 | again: |
| 1337 | if (atomic_read(&delayed_root->items) < BTRFS_DELAYED_BACKGROUND / 2) | ||
| 1338 | goto free_path; | ||
| 1339 | |||
| 1340 | delayed_node = btrfs_first_prepared_delayed_node(delayed_root); | ||
| 1341 | if (!delayed_node) | ||
| 1342 | goto free_path; | ||
| 1343 | |||
| 1344 | path->leave_spinning = 1; | ||
| 1331 | root = delayed_node->root; | 1345 | root = delayed_node->root; |
| 1332 | 1346 | ||
| 1333 | trans = btrfs_join_transaction(root); | 1347 | trans = btrfs_join_transaction(root); |
| 1334 | if (IS_ERR(trans)) | 1348 | if (IS_ERR(trans)) |
| 1335 | goto free_path; | 1349 | goto release_path; |
| 1336 | 1350 | ||
| 1337 | block_rsv = trans->block_rsv; | 1351 | block_rsv = trans->block_rsv; |
| 1338 | trans->block_rsv = &root->fs_info->delayed_block_rsv; | 1352 | trans->block_rsv = &root->fs_info->delayed_block_rsv; |
| @@ -1363,57 +1377,47 @@ static void btrfs_async_run_delayed_node_done(struct btrfs_work *work) | |||
| 1363 | * Task1 will sleep until the transaction is commited. | 1377 | * Task1 will sleep until the transaction is commited. |
| 1364 | */ | 1378 | */ |
| 1365 | mutex_lock(&delayed_node->mutex); | 1379 | mutex_lock(&delayed_node->mutex); |
| 1366 | if (delayed_node->count) | 1380 | btrfs_dequeue_delayed_node(root->fs_info->delayed_root, delayed_node); |
| 1367 | need_requeue = 1; | ||
| 1368 | else | ||
| 1369 | btrfs_dequeue_delayed_node(root->fs_info->delayed_root, | ||
| 1370 | delayed_node); | ||
| 1371 | mutex_unlock(&delayed_node->mutex); | 1381 | mutex_unlock(&delayed_node->mutex); |
| 1372 | 1382 | ||
| 1373 | trans->block_rsv = block_rsv; | 1383 | trans->block_rsv = block_rsv; |
| 1374 | btrfs_end_transaction_dmeta(trans, root); | 1384 | btrfs_end_transaction_dmeta(trans, root); |
| 1375 | btrfs_btree_balance_dirty_nodelay(root); | 1385 | btrfs_btree_balance_dirty_nodelay(root); |
| 1386 | |||
| 1387 | release_path: | ||
| 1388 | btrfs_release_path(path); | ||
| 1389 | total_done++; | ||
| 1390 | |||
| 1391 | btrfs_release_prepared_delayed_node(delayed_node); | ||
| 1392 | if (async_work->nr == 0 || total_done < async_work->nr) | ||
| 1393 | goto again; | ||
| 1394 | |||
| 1376 | free_path: | 1395 | free_path: |
| 1377 | btrfs_free_path(path); | 1396 | btrfs_free_path(path); |
| 1378 | out: | 1397 | out: |
| 1379 | if (need_requeue) | 1398 | wake_up(&delayed_root->wait); |
| 1380 | btrfs_requeue_work(&async_node->work); | 1399 | kfree(async_work); |
| 1381 | else { | ||
| 1382 | btrfs_release_prepared_delayed_node(delayed_node); | ||
| 1383 | kfree(async_node); | ||
| 1384 | } | ||
| 1385 | } | 1400 | } |
| 1386 | 1401 | ||
| 1402 | |||
| 1387 | static int btrfs_wq_run_delayed_node(struct btrfs_delayed_root *delayed_root, | 1403 | static int btrfs_wq_run_delayed_node(struct btrfs_delayed_root *delayed_root, |
| 1388 | struct btrfs_root *root, int all) | 1404 | struct btrfs_root *root, int nr) |
| 1389 | { | 1405 | { |
| 1390 | struct btrfs_async_delayed_node *async_node; | 1406 | struct btrfs_async_delayed_work *async_work; |
| 1391 | struct btrfs_delayed_node *curr; | ||
| 1392 | int count = 0; | ||
| 1393 | 1407 | ||
| 1394 | again: | 1408 | if (atomic_read(&delayed_root->items) < BTRFS_DELAYED_BACKGROUND) |
| 1395 | curr = btrfs_first_prepared_delayed_node(delayed_root); | ||
| 1396 | if (!curr) | ||
| 1397 | return 0; | 1409 | return 0; |
| 1398 | 1410 | ||
| 1399 | async_node = kmalloc(sizeof(*async_node), GFP_NOFS); | 1411 | async_work = kmalloc(sizeof(*async_work), GFP_NOFS); |
| 1400 | if (!async_node) { | 1412 | if (!async_work) |
| 1401 | btrfs_release_prepared_delayed_node(curr); | ||
| 1402 | return -ENOMEM; | 1413 | return -ENOMEM; |
| 1403 | } | ||
| 1404 | |||
| 1405 | async_node->root = root; | ||
| 1406 | async_node->delayed_node = curr; | ||
| 1407 | |||
| 1408 | async_node->work.func = btrfs_async_run_delayed_node_done; | ||
| 1409 | async_node->work.flags = 0; | ||
| 1410 | 1414 | ||
| 1411 | btrfs_queue_worker(&root->fs_info->delayed_workers, &async_node->work); | 1415 | async_work->delayed_root = delayed_root; |
| 1412 | count++; | 1416 | async_work->work.func = btrfs_async_run_delayed_root; |
| 1413 | 1417 | async_work->work.flags = 0; | |
| 1414 | if (all || count < 4) | 1418 | async_work->nr = nr; |
| 1415 | goto again; | ||
| 1416 | 1419 | ||
| 1420 | btrfs_queue_worker(&root->fs_info->delayed_workers, &async_work->work); | ||
| 1417 | return 0; | 1421 | return 0; |
| 1418 | } | 1422 | } |
| 1419 | 1423 | ||
| @@ -1424,30 +1428,55 @@ void btrfs_assert_delayed_root_empty(struct btrfs_root *root) | |||
| 1424 | WARN_ON(btrfs_first_delayed_node(delayed_root)); | 1428 | WARN_ON(btrfs_first_delayed_node(delayed_root)); |
| 1425 | } | 1429 | } |
| 1426 | 1430 | ||
| 1431 | static int refs_newer(struct btrfs_delayed_root *delayed_root, | ||
| 1432 | int seq, int count) | ||
| 1433 | { | ||
| 1434 | int val = atomic_read(&delayed_root->items_seq); | ||
| 1435 | |||
| 1436 | if (val < seq || val >= seq + count) | ||
| 1437 | return 1; | ||
| 1438 | return 0; | ||
| 1439 | } | ||
| 1440 | |||
| 1427 | void btrfs_balance_delayed_items(struct btrfs_root *root) | 1441 | void btrfs_balance_delayed_items(struct btrfs_root *root) |
| 1428 | { | 1442 | { |
| 1429 | struct btrfs_delayed_root *delayed_root; | 1443 | struct btrfs_delayed_root *delayed_root; |
| 1444 | int seq; | ||
| 1430 | 1445 | ||
| 1431 | delayed_root = btrfs_get_delayed_root(root); | 1446 | delayed_root = btrfs_get_delayed_root(root); |
| 1432 | 1447 | ||
| 1433 | if (atomic_read(&delayed_root->items) < BTRFS_DELAYED_BACKGROUND) | 1448 | if (atomic_read(&delayed_root->items) < BTRFS_DELAYED_BACKGROUND) |
| 1434 | return; | 1449 | return; |
| 1435 | 1450 | ||
| 1451 | seq = atomic_read(&delayed_root->items_seq); | ||
| 1452 | |||
| 1436 | if (atomic_read(&delayed_root->items) >= BTRFS_DELAYED_WRITEBACK) { | 1453 | if (atomic_read(&delayed_root->items) >= BTRFS_DELAYED_WRITEBACK) { |
| 1437 | int ret; | 1454 | int ret; |
| 1438 | ret = btrfs_wq_run_delayed_node(delayed_root, root, 1); | 1455 | DEFINE_WAIT(__wait); |
| 1456 | |||
| 1457 | ret = btrfs_wq_run_delayed_node(delayed_root, root, 0); | ||
| 1439 | if (ret) | 1458 | if (ret) |
| 1440 | return; | 1459 | return; |
| 1441 | 1460 | ||
| 1442 | wait_event_interruptible_timeout( | 1461 | while (1) { |
| 1443 | delayed_root->wait, | 1462 | prepare_to_wait(&delayed_root->wait, &__wait, |
| 1444 | (atomic_read(&delayed_root->items) < | 1463 | TASK_INTERRUPTIBLE); |
| 1445 | BTRFS_DELAYED_BACKGROUND), | 1464 | |
| 1446 | HZ); | 1465 | if (refs_newer(delayed_root, seq, |
| 1447 | return; | 1466 | BTRFS_DELAYED_BATCH) || |
| 1467 | atomic_read(&delayed_root->items) < | ||
| 1468 | BTRFS_DELAYED_BACKGROUND) { | ||
| 1469 | break; | ||
| 1470 | } | ||
| 1471 | if (!signal_pending(current)) | ||
| 1472 | schedule(); | ||
| 1473 | else | ||
| 1474 | break; | ||
| 1475 | } | ||
| 1476 | finish_wait(&delayed_root->wait, &__wait); | ||
| 1448 | } | 1477 | } |
| 1449 | 1478 | ||
| 1450 | btrfs_wq_run_delayed_node(delayed_root, root, 0); | 1479 | btrfs_wq_run_delayed_node(delayed_root, root, BTRFS_DELAYED_BATCH); |
| 1451 | } | 1480 | } |
| 1452 | 1481 | ||
| 1453 | /* Will return 0 or -ENOMEM */ | 1482 | /* Will return 0 or -ENOMEM */ |
diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h index 78b6ad0fc669..1d5c5f7abe3e 100644 --- a/fs/btrfs/delayed-inode.h +++ b/fs/btrfs/delayed-inode.h | |||
| @@ -43,6 +43,7 @@ struct btrfs_delayed_root { | |||
| 43 | */ | 43 | */ |
| 44 | struct list_head prepare_list; | 44 | struct list_head prepare_list; |
| 45 | atomic_t items; /* for delayed items */ | 45 | atomic_t items; /* for delayed items */ |
| 46 | atomic_t items_seq; /* for delayed items */ | ||
| 46 | int nodes; /* for delayed nodes */ | 47 | int nodes; /* for delayed nodes */ |
| 47 | wait_queue_head_t wait; | 48 | wait_queue_head_t wait; |
| 48 | }; | 49 | }; |
| @@ -86,6 +87,7 @@ static inline void btrfs_init_delayed_root( | |||
| 86 | struct btrfs_delayed_root *delayed_root) | 87 | struct btrfs_delayed_root *delayed_root) |
| 87 | { | 88 | { |
| 88 | atomic_set(&delayed_root->items, 0); | 89 | atomic_set(&delayed_root->items, 0); |
| 90 | atomic_set(&delayed_root->items_seq, 0); | ||
| 89 | delayed_root->nodes = 0; | 91 | delayed_root->nodes = 0; |
| 90 | spin_lock_init(&delayed_root->lock); | 92 | spin_lock_init(&delayed_root->lock); |
| 91 | init_waitqueue_head(&delayed_root->wait); | 93 | init_waitqueue_head(&delayed_root->wait); |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 02369a3c162e..7d84651e850b 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
| @@ -62,7 +62,7 @@ static void btrfs_destroy_ordered_operations(struct btrfs_transaction *t, | |||
| 62 | static void btrfs_destroy_ordered_extents(struct btrfs_root *root); | 62 | static void btrfs_destroy_ordered_extents(struct btrfs_root *root); |
| 63 | static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, | 63 | static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, |
| 64 | struct btrfs_root *root); | 64 | struct btrfs_root *root); |
| 65 | static void btrfs_destroy_pending_snapshots(struct btrfs_transaction *t); | 65 | static void btrfs_evict_pending_snapshots(struct btrfs_transaction *t); |
| 66 | static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root); | 66 | static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root); |
| 67 | static int btrfs_destroy_marked_extents(struct btrfs_root *root, | 67 | static int btrfs_destroy_marked_extents(struct btrfs_root *root, |
| 68 | struct extent_io_tree *dirty_pages, | 68 | struct extent_io_tree *dirty_pages, |
| @@ -3687,7 +3687,7 @@ int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, | |||
| 3687 | return ret; | 3687 | return ret; |
| 3688 | } | 3688 | } |
| 3689 | 3689 | ||
| 3690 | static void btrfs_destroy_pending_snapshots(struct btrfs_transaction *t) | 3690 | static void btrfs_evict_pending_snapshots(struct btrfs_transaction *t) |
| 3691 | { | 3691 | { |
| 3692 | struct btrfs_pending_snapshot *snapshot; | 3692 | struct btrfs_pending_snapshot *snapshot; |
| 3693 | struct list_head splice; | 3693 | struct list_head splice; |
| @@ -3700,10 +3700,8 @@ static void btrfs_destroy_pending_snapshots(struct btrfs_transaction *t) | |||
| 3700 | snapshot = list_entry(splice.next, | 3700 | snapshot = list_entry(splice.next, |
| 3701 | struct btrfs_pending_snapshot, | 3701 | struct btrfs_pending_snapshot, |
| 3702 | list); | 3702 | list); |
| 3703 | 3703 | snapshot->error = -ECANCELED; | |
| 3704 | list_del_init(&snapshot->list); | 3704 | list_del_init(&snapshot->list); |
| 3705 | |||
| 3706 | kfree(snapshot); | ||
| 3707 | } | 3705 | } |
| 3708 | } | 3706 | } |
| 3709 | 3707 | ||
| @@ -3840,6 +3838,8 @@ void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans, | |||
| 3840 | cur_trans->blocked = 1; | 3838 | cur_trans->blocked = 1; |
| 3841 | wake_up(&root->fs_info->transaction_blocked_wait); | 3839 | wake_up(&root->fs_info->transaction_blocked_wait); |
| 3842 | 3840 | ||
| 3841 | btrfs_evict_pending_snapshots(cur_trans); | ||
| 3842 | |||
| 3843 | cur_trans->blocked = 0; | 3843 | cur_trans->blocked = 0; |
| 3844 | wake_up(&root->fs_info->transaction_wait); | 3844 | wake_up(&root->fs_info->transaction_wait); |
| 3845 | 3845 | ||
| @@ -3849,8 +3849,6 @@ void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans, | |||
| 3849 | btrfs_destroy_delayed_inodes(root); | 3849 | btrfs_destroy_delayed_inodes(root); |
| 3850 | btrfs_assert_delayed_root_empty(root); | 3850 | btrfs_assert_delayed_root_empty(root); |
| 3851 | 3851 | ||
| 3852 | btrfs_destroy_pending_snapshots(cur_trans); | ||
| 3853 | |||
| 3854 | btrfs_destroy_marked_extents(root, &cur_trans->dirty_pages, | 3852 | btrfs_destroy_marked_extents(root, &cur_trans->dirty_pages, |
| 3855 | EXTENT_DIRTY); | 3853 | EXTENT_DIRTY); |
| 3856 | btrfs_destroy_pinned_extent(root, | 3854 | btrfs_destroy_pinned_extent(root, |
| @@ -3894,6 +3892,8 @@ int btrfs_cleanup_transaction(struct btrfs_root *root) | |||
| 3894 | if (waitqueue_active(&root->fs_info->transaction_blocked_wait)) | 3892 | if (waitqueue_active(&root->fs_info->transaction_blocked_wait)) |
| 3895 | wake_up(&root->fs_info->transaction_blocked_wait); | 3893 | wake_up(&root->fs_info->transaction_blocked_wait); |
| 3896 | 3894 | ||
| 3895 | btrfs_evict_pending_snapshots(t); | ||
| 3896 | |||
| 3897 | t->blocked = 0; | 3897 | t->blocked = 0; |
| 3898 | smp_mb(); | 3898 | smp_mb(); |
| 3899 | if (waitqueue_active(&root->fs_info->transaction_wait)) | 3899 | if (waitqueue_active(&root->fs_info->transaction_wait)) |
| @@ -3907,8 +3907,6 @@ int btrfs_cleanup_transaction(struct btrfs_root *root) | |||
| 3907 | btrfs_destroy_delayed_inodes(root); | 3907 | btrfs_destroy_delayed_inodes(root); |
| 3908 | btrfs_assert_delayed_root_empty(root); | 3908 | btrfs_assert_delayed_root_empty(root); |
| 3909 | 3909 | ||
| 3910 | btrfs_destroy_pending_snapshots(t); | ||
| 3911 | |||
| 3912 | btrfs_destroy_delalloc_inodes(root); | 3910 | btrfs_destroy_delalloc_inodes(root); |
| 3913 | 3911 | ||
| 3914 | spin_lock(&root->fs_info->trans_lock); | 3912 | spin_lock(&root->fs_info->trans_lock); |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c226daefd65d..d1470adca8f8 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
| @@ -8502,6 +8502,7 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode, | |||
| 8502 | struct btrfs_key ins; | 8502 | struct btrfs_key ins; |
| 8503 | u64 cur_offset = start; | 8503 | u64 cur_offset = start; |
| 8504 | u64 i_size; | 8504 | u64 i_size; |
| 8505 | u64 cur_bytes; | ||
| 8505 | int ret = 0; | 8506 | int ret = 0; |
| 8506 | bool own_trans = true; | 8507 | bool own_trans = true; |
| 8507 | 8508 | ||
| @@ -8516,8 +8517,9 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode, | |||
| 8516 | } | 8517 | } |
| 8517 | } | 8518 | } |
| 8518 | 8519 | ||
| 8519 | ret = btrfs_reserve_extent(trans, root, | 8520 | cur_bytes = min(num_bytes, 256ULL * 1024 * 1024); |
| 8520 | min(num_bytes, 256ULL * 1024 * 1024), | 8521 | cur_bytes = max(cur_bytes, min_size); |
| 8522 | ret = btrfs_reserve_extent(trans, root, cur_bytes, | ||
| 8521 | min_size, 0, *alloc_hint, &ins, 1); | 8523 | min_size, 0, *alloc_hint, &ins, 1); |
| 8522 | if (ret) { | 8524 | if (ret) { |
| 8523 | if (own_trans) | 8525 | if (own_trans) |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index c83086fdda05..2c02310ff2d9 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
| @@ -527,6 +527,8 @@ fail: | |||
| 527 | if (async_transid) { | 527 | if (async_transid) { |
| 528 | *async_transid = trans->transid; | 528 | *async_transid = trans->transid; |
| 529 | err = btrfs_commit_transaction_async(trans, root, 1); | 529 | err = btrfs_commit_transaction_async(trans, root, 1); |
| 530 | if (err) | ||
| 531 | err = btrfs_commit_transaction(trans, root); | ||
| 530 | } else { | 532 | } else { |
| 531 | err = btrfs_commit_transaction(trans, root); | 533 | err = btrfs_commit_transaction(trans, root); |
| 532 | } | 534 | } |
| @@ -592,16 +594,14 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir, | |||
| 592 | *async_transid = trans->transid; | 594 | *async_transid = trans->transid; |
| 593 | ret = btrfs_commit_transaction_async(trans, | 595 | ret = btrfs_commit_transaction_async(trans, |
| 594 | root->fs_info->extent_root, 1); | 596 | root->fs_info->extent_root, 1); |
| 597 | if (ret) | ||
| 598 | ret = btrfs_commit_transaction(trans, root); | ||
| 595 | } else { | 599 | } else { |
| 596 | ret = btrfs_commit_transaction(trans, | 600 | ret = btrfs_commit_transaction(trans, |
| 597 | root->fs_info->extent_root); | 601 | root->fs_info->extent_root); |
| 598 | } | 602 | } |
| 599 | if (ret) { | 603 | if (ret) |
| 600 | /* cleanup_transaction has freed this for us */ | ||
| 601 | if (trans->aborted) | ||
| 602 | pending_snapshot = NULL; | ||
| 603 | goto fail; | 604 | goto fail; |
| 604 | } | ||
| 605 | 605 | ||
| 606 | ret = pending_snapshot->error; | 606 | ret = pending_snapshot->error; |
| 607 | if (ret) | 607 | if (ret) |
| @@ -2245,13 +2245,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp) | |||
| 2245 | if (ret) | 2245 | if (ret) |
| 2246 | return ret; | 2246 | return ret; |
| 2247 | 2247 | ||
| 2248 | if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running, | ||
| 2249 | 1)) { | ||
| 2250 | pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n"); | ||
| 2251 | mnt_drop_write_file(file); | ||
| 2252 | return -EINVAL; | ||
| 2253 | } | ||
| 2254 | |||
| 2255 | if (btrfs_root_readonly(root)) { | 2248 | if (btrfs_root_readonly(root)) { |
| 2256 | ret = -EROFS; | 2249 | ret = -EROFS; |
| 2257 | goto out; | 2250 | goto out; |
| @@ -2306,7 +2299,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp) | |||
| 2306 | ret = -EINVAL; | 2299 | ret = -EINVAL; |
| 2307 | } | 2300 | } |
| 2308 | out: | 2301 | out: |
| 2309 | atomic_set(&root->fs_info->mutually_exclusive_operation_running, 0); | ||
| 2310 | mnt_drop_write_file(file); | 2302 | mnt_drop_write_file(file); |
| 2311 | return ret; | 2303 | return ret; |
| 2312 | } | 2304 | } |
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 50695dc5e2ab..b67171e6d688 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
| @@ -1269,6 +1269,8 @@ static int __update_reloc_root(struct btrfs_root *root, int del) | |||
| 1269 | } | 1269 | } |
| 1270 | spin_unlock(&rc->reloc_root_tree.lock); | 1270 | spin_unlock(&rc->reloc_root_tree.lock); |
| 1271 | 1271 | ||
| 1272 | if (!node) | ||
| 1273 | return 0; | ||
| 1272 | BUG_ON((struct btrfs_root *)node->data != root); | 1274 | BUG_ON((struct btrfs_root *)node->data != root); |
| 1273 | 1275 | ||
| 1274 | if (!del) { | 1276 | if (!del) { |
| @@ -2238,13 +2240,28 @@ again: | |||
| 2238 | } | 2240 | } |
| 2239 | 2241 | ||
| 2240 | static noinline_for_stack | 2242 | static noinline_for_stack |
| 2243 | void free_reloc_roots(struct list_head *list) | ||
| 2244 | { | ||
| 2245 | struct btrfs_root *reloc_root; | ||
| 2246 | |||
| 2247 | while (!list_empty(list)) { | ||
| 2248 | reloc_root = list_entry(list->next, struct btrfs_root, | ||
| 2249 | root_list); | ||
| 2250 | __update_reloc_root(reloc_root, 1); | ||
| 2251 | free_extent_buffer(reloc_root->node); | ||
| 2252 | free_extent_buffer(reloc_root->commit_root); | ||
| 2253 | kfree(reloc_root); | ||
| 2254 | } | ||
| 2255 | } | ||
| 2256 | |||
| 2257 | static noinline_for_stack | ||
| 2241 | int merge_reloc_roots(struct reloc_control *rc) | 2258 | int merge_reloc_roots(struct reloc_control *rc) |
| 2242 | { | 2259 | { |
| 2243 | struct btrfs_root *root; | 2260 | struct btrfs_root *root; |
| 2244 | struct btrfs_root *reloc_root; | 2261 | struct btrfs_root *reloc_root; |
| 2245 | LIST_HEAD(reloc_roots); | 2262 | LIST_HEAD(reloc_roots); |
| 2246 | int found = 0; | 2263 | int found = 0; |
| 2247 | int ret; | 2264 | int ret = 0; |
| 2248 | again: | 2265 | again: |
| 2249 | root = rc->extent_root; | 2266 | root = rc->extent_root; |
| 2250 | 2267 | ||
| @@ -2270,20 +2287,33 @@ again: | |||
| 2270 | BUG_ON(root->reloc_root != reloc_root); | 2287 | BUG_ON(root->reloc_root != reloc_root); |
| 2271 | 2288 | ||
| 2272 | ret = merge_reloc_root(rc, root); | 2289 | ret = merge_reloc_root(rc, root); |
| 2273 | BUG_ON(ret); | 2290 | if (ret) |
| 2291 | goto out; | ||
| 2274 | } else { | 2292 | } else { |
| 2275 | list_del_init(&reloc_root->root_list); | 2293 | list_del_init(&reloc_root->root_list); |
| 2276 | } | 2294 | } |
| 2277 | ret = btrfs_drop_snapshot(reloc_root, rc->block_rsv, 0, 1); | 2295 | ret = btrfs_drop_snapshot(reloc_root, rc->block_rsv, 0, 1); |
| 2278 | BUG_ON(ret < 0); | 2296 | if (ret < 0) { |
| 2297 | if (list_empty(&reloc_root->root_list)) | ||
| 2298 | list_add_tail(&reloc_root->root_list, | ||
| 2299 | &reloc_roots); | ||
| 2300 | goto out; | ||
| 2301 | } | ||
| 2279 | } | 2302 | } |
| 2280 | 2303 | ||
| 2281 | if (found) { | 2304 | if (found) { |
| 2282 | found = 0; | 2305 | found = 0; |
| 2283 | goto again; | 2306 | goto again; |
| 2284 | } | 2307 | } |
| 2308 | out: | ||
| 2309 | if (ret) { | ||
| 2310 | btrfs_std_error(root->fs_info, ret); | ||
| 2311 | if (!list_empty(&reloc_roots)) | ||
| 2312 | free_reloc_roots(&reloc_roots); | ||
| 2313 | } | ||
| 2314 | |||
| 2285 | BUG_ON(!RB_EMPTY_ROOT(&rc->reloc_root_tree.rb_root)); | 2315 | BUG_ON(!RB_EMPTY_ROOT(&rc->reloc_root_tree.rb_root)); |
| 2286 | return 0; | 2316 | return ret; |
| 2287 | } | 2317 | } |
| 2288 | 2318 | ||
| 2289 | static void free_block_list(struct rb_root *blocks) | 2319 | static void free_block_list(struct rb_root *blocks) |
| @@ -2818,8 +2848,10 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans, | |||
| 2818 | int err = 0; | 2848 | int err = 0; |
| 2819 | 2849 | ||
| 2820 | path = btrfs_alloc_path(); | 2850 | path = btrfs_alloc_path(); |
| 2821 | if (!path) | 2851 | if (!path) { |
| 2822 | return -ENOMEM; | 2852 | err = -ENOMEM; |
| 2853 | goto out_path; | ||
| 2854 | } | ||
| 2823 | 2855 | ||
| 2824 | rb_node = rb_first(blocks); | 2856 | rb_node = rb_first(blocks); |
| 2825 | while (rb_node) { | 2857 | while (rb_node) { |
| @@ -2858,10 +2890,11 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans, | |||
| 2858 | rb_node = rb_next(rb_node); | 2890 | rb_node = rb_next(rb_node); |
| 2859 | } | 2891 | } |
| 2860 | out: | 2892 | out: |
| 2861 | free_block_list(blocks); | ||
| 2862 | err = finish_pending_nodes(trans, rc, path, err); | 2893 | err = finish_pending_nodes(trans, rc, path, err); |
| 2863 | 2894 | ||
| 2864 | btrfs_free_path(path); | 2895 | btrfs_free_path(path); |
| 2896 | out_path: | ||
| 2897 | free_block_list(blocks); | ||
| 2865 | return err; | 2898 | return err; |
| 2866 | } | 2899 | } |
| 2867 | 2900 | ||
| @@ -3698,7 +3731,15 @@ int prepare_to_relocate(struct reloc_control *rc) | |||
| 3698 | set_reloc_control(rc); | 3731 | set_reloc_control(rc); |
| 3699 | 3732 | ||
| 3700 | trans = btrfs_join_transaction(rc->extent_root); | 3733 | trans = btrfs_join_transaction(rc->extent_root); |
| 3701 | BUG_ON(IS_ERR(trans)); | 3734 | if (IS_ERR(trans)) { |
| 3735 | unset_reloc_control(rc); | ||
| 3736 | /* | ||
| 3737 | * extent tree is not a ref_cow tree and has no reloc_root to | ||
| 3738 | * cleanup. And callers are responsible to free the above | ||
| 3739 | * block rsv. | ||
| 3740 | */ | ||
| 3741 | return PTR_ERR(trans); | ||
| 3742 | } | ||
| 3702 | btrfs_commit_transaction(trans, rc->extent_root); | 3743 | btrfs_commit_transaction(trans, rc->extent_root); |
| 3703 | return 0; | 3744 | return 0; |
| 3704 | } | 3745 | } |
| @@ -3730,7 +3771,11 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) | |||
| 3730 | while (1) { | 3771 | while (1) { |
| 3731 | progress++; | 3772 | progress++; |
| 3732 | trans = btrfs_start_transaction(rc->extent_root, 0); | 3773 | trans = btrfs_start_transaction(rc->extent_root, 0); |
| 3733 | BUG_ON(IS_ERR(trans)); | 3774 | if (IS_ERR(trans)) { |
| 3775 | err = PTR_ERR(trans); | ||
| 3776 | trans = NULL; | ||
| 3777 | break; | ||
| 3778 | } | ||
| 3734 | restart: | 3779 | restart: |
| 3735 | if (update_backref_cache(trans, &rc->backref_cache)) { | 3780 | if (update_backref_cache(trans, &rc->backref_cache)) { |
| 3736 | btrfs_end_transaction(trans, rc->extent_root); | 3781 | btrfs_end_transaction(trans, rc->extent_root); |
| @@ -4264,14 +4309,9 @@ int btrfs_recover_relocation(struct btrfs_root *root) | |||
| 4264 | out_free: | 4309 | out_free: |
| 4265 | kfree(rc); | 4310 | kfree(rc); |
| 4266 | out: | 4311 | out: |
| 4267 | while (!list_empty(&reloc_roots)) { | 4312 | if (!list_empty(&reloc_roots)) |
| 4268 | reloc_root = list_entry(reloc_roots.next, | 4313 | free_reloc_roots(&reloc_roots); |
| 4269 | struct btrfs_root, root_list); | 4314 | |
| 4270 | list_del(&reloc_root->root_list); | ||
| 4271 | free_extent_buffer(reloc_root->node); | ||
| 4272 | free_extent_buffer(reloc_root->commit_root); | ||
| 4273 | kfree(reloc_root); | ||
| 4274 | } | ||
| 4275 | btrfs_free_path(path); | 4315 | btrfs_free_path(path); |
| 4276 | 4316 | ||
| 4277 | if (err == 0) { | 4317 | if (err == 0) { |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 68a29a1ea068..f6b88595f858 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
| @@ -1558,6 +1558,7 @@ static struct file_system_type btrfs_fs_type = { | |||
| 1558 | .kill_sb = btrfs_kill_super, | 1558 | .kill_sb = btrfs_kill_super, |
| 1559 | .fs_flags = FS_REQUIRES_DEV, | 1559 | .fs_flags = FS_REQUIRES_DEV, |
| 1560 | }; | 1560 | }; |
| 1561 | MODULE_ALIAS_FS("btrfs"); | ||
| 1561 | 1562 | ||
| 1562 | /* | 1563 | /* |
| 1563 | * used by btrfsctl to scan devices when no FS is mounted | 1564 | * used by btrfsctl to scan devices when no FS is mounted |
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index e52da6fb1165..9250b9c4f01e 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
| @@ -1052,7 +1052,12 @@ int btrfs_defrag_root(struct btrfs_root *root) | |||
| 1052 | 1052 | ||
| 1053 | /* | 1053 | /* |
| 1054 | * new snapshots need to be created at a very specific time in the | 1054 | * new snapshots need to be created at a very specific time in the |
| 1055 | * transaction commit. This does the actual creation | 1055 | * transaction commit. This does the actual creation. |
| 1056 | * | ||
| 1057 | * Note: | ||
| 1058 | * If the error which may affect the commitment of the current transaction | ||
| 1059 | * happens, we should return the error number. If the error which just affect | ||
| 1060 | * the creation of the pending snapshots, just return 0. | ||
| 1056 | */ | 1061 | */ |
| 1057 | static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | 1062 | static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, |
| 1058 | struct btrfs_fs_info *fs_info, | 1063 | struct btrfs_fs_info *fs_info, |
| @@ -1071,7 +1076,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
| 1071 | struct extent_buffer *tmp; | 1076 | struct extent_buffer *tmp; |
| 1072 | struct extent_buffer *old; | 1077 | struct extent_buffer *old; |
| 1073 | struct timespec cur_time = CURRENT_TIME; | 1078 | struct timespec cur_time = CURRENT_TIME; |
| 1074 | int ret; | 1079 | int ret = 0; |
| 1075 | u64 to_reserve = 0; | 1080 | u64 to_reserve = 0; |
| 1076 | u64 index = 0; | 1081 | u64 index = 0; |
| 1077 | u64 objectid; | 1082 | u64 objectid; |
| @@ -1080,40 +1085,36 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
| 1080 | 1085 | ||
| 1081 | path = btrfs_alloc_path(); | 1086 | path = btrfs_alloc_path(); |
| 1082 | if (!path) { | 1087 | if (!path) { |
| 1083 | ret = pending->error = -ENOMEM; | 1088 | pending->error = -ENOMEM; |
| 1084 | return ret; | 1089 | return 0; |
| 1085 | } | 1090 | } |
| 1086 | 1091 | ||
| 1087 | new_root_item = kmalloc(sizeof(*new_root_item), GFP_NOFS); | 1092 | new_root_item = kmalloc(sizeof(*new_root_item), GFP_NOFS); |
| 1088 | if (!new_root_item) { | 1093 | if (!new_root_item) { |
| 1089 | ret = pending->error = -ENOMEM; | 1094 | pending->error = -ENOMEM; |
| 1090 | goto root_item_alloc_fail; | 1095 | goto root_item_alloc_fail; |
| 1091 | } | 1096 | } |
| 1092 | 1097 | ||
| 1093 | ret = btrfs_find_free_objectid(tree_root, &objectid); | 1098 | pending->error = btrfs_find_free_objectid(tree_root, &objectid); |
| 1094 | if (ret) { | 1099 | if (pending->error) |
| 1095 | pending->error = ret; | ||
| 1096 | goto no_free_objectid; | 1100 | goto no_free_objectid; |
| 1097 | } | ||
| 1098 | 1101 | ||
| 1099 | btrfs_reloc_pre_snapshot(trans, pending, &to_reserve); | 1102 | btrfs_reloc_pre_snapshot(trans, pending, &to_reserve); |
| 1100 | 1103 | ||
| 1101 | if (to_reserve > 0) { | 1104 | if (to_reserve > 0) { |
| 1102 | ret = btrfs_block_rsv_add(root, &pending->block_rsv, | 1105 | pending->error = btrfs_block_rsv_add(root, |
| 1103 | to_reserve, | 1106 | &pending->block_rsv, |
| 1104 | BTRFS_RESERVE_NO_FLUSH); | 1107 | to_reserve, |
| 1105 | if (ret) { | 1108 | BTRFS_RESERVE_NO_FLUSH); |
| 1106 | pending->error = ret; | 1109 | if (pending->error) |
| 1107 | goto no_free_objectid; | 1110 | goto no_free_objectid; |
| 1108 | } | ||
| 1109 | } | 1111 | } |
| 1110 | 1112 | ||
| 1111 | ret = btrfs_qgroup_inherit(trans, fs_info, root->root_key.objectid, | 1113 | pending->error = btrfs_qgroup_inherit(trans, fs_info, |
| 1112 | objectid, pending->inherit); | 1114 | root->root_key.objectid, |
| 1113 | if (ret) { | 1115 | objectid, pending->inherit); |
| 1114 | pending->error = ret; | 1116 | if (pending->error) |
| 1115 | goto no_free_objectid; | 1117 | goto no_free_objectid; |
| 1116 | } | ||
| 1117 | 1118 | ||
| 1118 | key.objectid = objectid; | 1119 | key.objectid = objectid; |
| 1119 | key.offset = (u64)-1; | 1120 | key.offset = (u64)-1; |
| @@ -1141,7 +1142,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
| 1141 | dentry->d_name.len, 0); | 1142 | dentry->d_name.len, 0); |
| 1142 | if (dir_item != NULL && !IS_ERR(dir_item)) { | 1143 | if (dir_item != NULL && !IS_ERR(dir_item)) { |
| 1143 | pending->error = -EEXIST; | 1144 | pending->error = -EEXIST; |
| 1144 | goto fail; | 1145 | goto dir_item_existed; |
| 1145 | } else if (IS_ERR(dir_item)) { | 1146 | } else if (IS_ERR(dir_item)) { |
| 1146 | ret = PTR_ERR(dir_item); | 1147 | ret = PTR_ERR(dir_item); |
| 1147 | btrfs_abort_transaction(trans, root, ret); | 1148 | btrfs_abort_transaction(trans, root, ret); |
| @@ -1272,6 +1273,8 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
| 1272 | if (ret) | 1273 | if (ret) |
| 1273 | btrfs_abort_transaction(trans, root, ret); | 1274 | btrfs_abort_transaction(trans, root, ret); |
| 1274 | fail: | 1275 | fail: |
| 1276 | pending->error = ret; | ||
| 1277 | dir_item_existed: | ||
| 1275 | trans->block_rsv = rsv; | 1278 | trans->block_rsv = rsv; |
| 1276 | trans->bytes_reserved = 0; | 1279 | trans->bytes_reserved = 0; |
| 1277 | no_free_objectid: | 1280 | no_free_objectid: |
| @@ -1287,12 +1290,17 @@ root_item_alloc_fail: | |||
| 1287 | static noinline int create_pending_snapshots(struct btrfs_trans_handle *trans, | 1290 | static noinline int create_pending_snapshots(struct btrfs_trans_handle *trans, |
| 1288 | struct btrfs_fs_info *fs_info) | 1291 | struct btrfs_fs_info *fs_info) |
| 1289 | { | 1292 | { |
| 1290 | struct btrfs_pending_snapshot *pending; | 1293 | struct btrfs_pending_snapshot *pending, *next; |
| 1291 | struct list_head *head = &trans->transaction->pending_snapshots; | 1294 | struct list_head *head = &trans->transaction->pending_snapshots; |
| 1295 | int ret = 0; | ||
| 1292 | 1296 | ||
| 1293 | list_for_each_entry(pending, head, list) | 1297 | list_for_each_entry_safe(pending, next, head, list) { |
| 1294 | create_pending_snapshot(trans, fs_info, pending); | 1298 | list_del(&pending->list); |
| 1295 | return 0; | 1299 | ret = create_pending_snapshot(trans, fs_info, pending); |
| 1300 | if (ret) | ||
| 1301 | break; | ||
| 1302 | } | ||
| 1303 | return ret; | ||
| 1296 | } | 1304 | } |
| 1297 | 1305 | ||
| 1298 | static void update_super_roots(struct btrfs_root *root) | 1306 | static void update_super_roots(struct btrfs_root *root) |
| @@ -1448,6 +1456,13 @@ static void cleanup_transaction(struct btrfs_trans_handle *trans, | |||
| 1448 | btrfs_abort_transaction(trans, root, err); | 1456 | btrfs_abort_transaction(trans, root, err); |
| 1449 | 1457 | ||
| 1450 | spin_lock(&root->fs_info->trans_lock); | 1458 | spin_lock(&root->fs_info->trans_lock); |
| 1459 | |||
| 1460 | if (list_empty(&cur_trans->list)) { | ||
| 1461 | spin_unlock(&root->fs_info->trans_lock); | ||
| 1462 | btrfs_end_transaction(trans, root); | ||
| 1463 | return; | ||
| 1464 | } | ||
| 1465 | |||
| 1451 | list_del_init(&cur_trans->list); | 1466 | list_del_init(&cur_trans->list); |
| 1452 | if (cur_trans == root->fs_info->running_transaction) { | 1467 | if (cur_trans == root->fs_info->running_transaction) { |
| 1453 | root->fs_info->trans_no_join = 1; | 1468 | root->fs_info->trans_no_join = 1; |
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index c7ef569eb22a..451fad96ecd1 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
| @@ -1382,7 +1382,10 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans, | |||
| 1382 | 1382 | ||
| 1383 | btrfs_release_path(path); | 1383 | btrfs_release_path(path); |
| 1384 | if (ret == 0) { | 1384 | if (ret == 0) { |
| 1385 | btrfs_inc_nlink(inode); | 1385 | if (!inode->i_nlink) |
| 1386 | set_nlink(inode, 1); | ||
| 1387 | else | ||
| 1388 | btrfs_inc_nlink(inode); | ||
| 1386 | ret = btrfs_update_inode(trans, root, inode); | 1389 | ret = btrfs_update_inode(trans, root, inode); |
| 1387 | } else if (ret == -EEXIST) { | 1390 | } else if (ret == -EEXIST) { |
| 1388 | ret = 0; | 1391 | ret = 0; |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 35bb2d4ed29f..6b9cff42265d 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
| @@ -2379,7 +2379,11 @@ static int btrfs_relocate_chunk(struct btrfs_root *root, | |||
| 2379 | return ret; | 2379 | return ret; |
| 2380 | 2380 | ||
| 2381 | trans = btrfs_start_transaction(root, 0); | 2381 | trans = btrfs_start_transaction(root, 0); |
| 2382 | BUG_ON(IS_ERR(trans)); | 2382 | if (IS_ERR(trans)) { |
| 2383 | ret = PTR_ERR(trans); | ||
| 2384 | btrfs_std_error(root->fs_info, ret); | ||
| 2385 | return ret; | ||
| 2386 | } | ||
| 2383 | 2387 | ||
| 2384 | lock_chunks(root); | 2388 | lock_chunks(root); |
| 2385 | 2389 | ||
| @@ -3050,7 +3054,8 @@ static void __cancel_balance(struct btrfs_fs_info *fs_info) | |||
| 3050 | 3054 | ||
| 3051 | unset_balance_control(fs_info); | 3055 | unset_balance_control(fs_info); |
| 3052 | ret = del_balance_item(fs_info->tree_root); | 3056 | ret = del_balance_item(fs_info->tree_root); |
| 3053 | BUG_ON(ret); | 3057 | if (ret) |
| 3058 | btrfs_std_error(fs_info, ret); | ||
| 3054 | 3059 | ||
| 3055 | atomic_set(&fs_info->mutually_exclusive_operation_running, 0); | 3060 | atomic_set(&fs_info->mutually_exclusive_operation_running, 0); |
| 3056 | } | 3061 | } |
| @@ -3230,6 +3235,11 @@ int btrfs_balance(struct btrfs_balance_control *bctl, | |||
| 3230 | update_ioctl_balance_args(fs_info, 0, bargs); | 3235 | update_ioctl_balance_args(fs_info, 0, bargs); |
| 3231 | } | 3236 | } |
| 3232 | 3237 | ||
| 3238 | if ((ret && ret != -ECANCELED && ret != -ENOSPC) || | ||
| 3239 | balance_need_close(fs_info)) { | ||
| 3240 | __cancel_balance(fs_info); | ||
| 3241 | } | ||
| 3242 | |||
| 3233 | wake_up(&fs_info->balance_wait_q); | 3243 | wake_up(&fs_info->balance_wait_q); |
| 3234 | 3244 | ||
| 3235 | return ret; | 3245 | return ret; |
diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 9fe17c6c2876..6ddc0bca56b2 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c | |||
| @@ -952,6 +952,7 @@ static struct file_system_type ceph_fs_type = { | |||
| 952 | .kill_sb = ceph_kill_sb, | 952 | .kill_sb = ceph_kill_sb, |
| 953 | .fs_flags = FS_RENAME_DOES_D_MOVE, | 953 | .fs_flags = FS_RENAME_DOES_D_MOVE, |
| 954 | }; | 954 | }; |
| 955 | MODULE_ALIAS_FS("ceph"); | ||
| 955 | 956 | ||
| 956 | #define _STRINGIFY(x) #x | 957 | #define _STRINGIFY(x) #x |
| 957 | #define STRINGIFY(x) _STRINGIFY(x) | 958 | #define STRINGIFY(x) _STRINGIFY(x) |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 7353bc5d73d7..8e2e799e7a24 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
| @@ -1909,12 +1909,12 @@ cifs_writev_requeue(struct cifs_writedata *wdata) | |||
| 1909 | } while (rc == -EAGAIN); | 1909 | } while (rc == -EAGAIN); |
| 1910 | 1910 | ||
| 1911 | for (i = 0; i < wdata->nr_pages; i++) { | 1911 | for (i = 0; i < wdata->nr_pages; i++) { |
| 1912 | unlock_page(wdata->pages[i]); | ||
| 1912 | if (rc != 0) { | 1913 | if (rc != 0) { |
| 1913 | SetPageError(wdata->pages[i]); | 1914 | SetPageError(wdata->pages[i]); |
| 1914 | end_page_writeback(wdata->pages[i]); | 1915 | end_page_writeback(wdata->pages[i]); |
| 1915 | page_cache_release(wdata->pages[i]); | 1916 | page_cache_release(wdata->pages[i]); |
| 1916 | } | 1917 | } |
| 1917 | unlock_page(wdata->pages[i]); | ||
| 1918 | } | 1918 | } |
| 1919 | 1919 | ||
| 1920 | mapping_set_error(inode->i_mapping, rc); | 1920 | mapping_set_error(inode->i_mapping, rc); |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 54125e04fd0c..991c63c6bdd0 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
| @@ -97,7 +97,7 @@ enum { | |||
| 97 | Opt_user, Opt_pass, Opt_ip, | 97 | Opt_user, Opt_pass, Opt_ip, |
| 98 | Opt_unc, Opt_domain, | 98 | Opt_unc, Opt_domain, |
| 99 | Opt_srcaddr, Opt_prefixpath, | 99 | Opt_srcaddr, Opt_prefixpath, |
| 100 | Opt_iocharset, Opt_sockopt, | 100 | Opt_iocharset, |
| 101 | Opt_netbiosname, Opt_servern, | 101 | Opt_netbiosname, Opt_servern, |
| 102 | Opt_ver, Opt_vers, Opt_sec, Opt_cache, | 102 | Opt_ver, Opt_vers, Opt_sec, Opt_cache, |
| 103 | 103 | ||
| @@ -202,7 +202,6 @@ static const match_table_t cifs_mount_option_tokens = { | |||
| 202 | { Opt_srcaddr, "srcaddr=%s" }, | 202 | { Opt_srcaddr, "srcaddr=%s" }, |
| 203 | { Opt_prefixpath, "prefixpath=%s" }, | 203 | { Opt_prefixpath, "prefixpath=%s" }, |
| 204 | { Opt_iocharset, "iocharset=%s" }, | 204 | { Opt_iocharset, "iocharset=%s" }, |
| 205 | { Opt_sockopt, "sockopt=%s" }, | ||
| 206 | { Opt_netbiosname, "netbiosname=%s" }, | 205 | { Opt_netbiosname, "netbiosname=%s" }, |
| 207 | { Opt_servern, "servern=%s" }, | 206 | { Opt_servern, "servern=%s" }, |
| 208 | { Opt_ver, "ver=%s" }, | 207 | { Opt_ver, "ver=%s" }, |
| @@ -1752,19 +1751,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
| 1752 | */ | 1751 | */ |
| 1753 | cFYI(1, "iocharset set to %s", string); | 1752 | cFYI(1, "iocharset set to %s", string); |
| 1754 | break; | 1753 | break; |
| 1755 | case Opt_sockopt: | ||
| 1756 | string = match_strdup(args); | ||
| 1757 | if (string == NULL) | ||
| 1758 | goto out_nomem; | ||
| 1759 | |||
| 1760 | if (strnicmp(string, "TCP_NODELAY", 11) == 0) { | ||
| 1761 | printk(KERN_WARNING "CIFS: the " | ||
| 1762 | "sockopt=TCP_NODELAY option has been " | ||
| 1763 | "deprecated and will be removed " | ||
| 1764 | "in 3.9\n"); | ||
| 1765 | vol->sockopt_tcp_nodelay = 1; | ||
| 1766 | } | ||
| 1767 | break; | ||
| 1768 | case Opt_netbiosname: | 1754 | case Opt_netbiosname: |
| 1769 | string = match_strdup(args); | 1755 | string = match_strdup(args); |
| 1770 | if (string == NULL) | 1756 | if (string == NULL) |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 83f2606c76d0..0079696305c9 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
| @@ -995,6 +995,15 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry, | |||
| 995 | return PTR_ERR(tlink); | 995 | return PTR_ERR(tlink); |
| 996 | tcon = tlink_tcon(tlink); | 996 | tcon = tlink_tcon(tlink); |
| 997 | 997 | ||
| 998 | /* | ||
| 999 | * We cannot rename the file if the server doesn't support | ||
| 1000 | * CAP_INFOLEVEL_PASSTHRU | ||
| 1001 | */ | ||
| 1002 | if (!(tcon->ses->capabilities & CAP_INFOLEVEL_PASSTHRU)) { | ||
| 1003 | rc = -EBUSY; | ||
| 1004 | goto out; | ||
| 1005 | } | ||
| 1006 | |||
| 998 | rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, | 1007 | rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, |
| 999 | DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR, | 1008 | DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR, |
| 1000 | &netfid, &oplock, NULL, cifs_sb->local_nls, | 1009 | &netfid, &oplock, NULL, cifs_sb->local_nls, |
| @@ -1023,7 +1032,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry, | |||
| 1023 | current->tgid); | 1032 | current->tgid); |
| 1024 | /* although we would like to mark the file hidden | 1033 | /* although we would like to mark the file hidden |
| 1025 | if that fails we will still try to rename it */ | 1034 | if that fails we will still try to rename it */ |
| 1026 | if (rc != 0) | 1035 | if (!rc) |
| 1027 | cifsInode->cifsAttrs = dosattr; | 1036 | cifsInode->cifsAttrs = dosattr; |
| 1028 | else | 1037 | else |
| 1029 | dosattr = origattr; /* since not able to change them */ | 1038 | dosattr = origattr; /* since not able to change them */ |
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index c9c7aa7ed966..bceffe7b8f8d 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
| @@ -744,4 +744,5 @@ struct smb_version_values smb30_values = { | |||
| 744 | .cap_unix = 0, | 744 | .cap_unix = 0, |
| 745 | .cap_nt_find = SMB2_NT_FIND, | 745 | .cap_nt_find = SMB2_NT_FIND, |
| 746 | .cap_large_files = SMB2_LARGE_FILES, | 746 | .cap_large_files = SMB2_LARGE_FILES, |
| 747 | .oplock_read = SMB2_OPLOCK_LEVEL_II, | ||
| 747 | }; | 748 | }; |
diff --git a/fs/coda/inode.c b/fs/coda/inode.c index dada9d0abede..4dcc0d81a7aa 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c | |||
| @@ -329,4 +329,5 @@ struct file_system_type coda_fs_type = { | |||
| 329 | .kill_sb = kill_anon_super, | 329 | .kill_sb = kill_anon_super, |
| 330 | .fs_flags = FS_BINARY_MOUNTDATA, | 330 | .fs_flags = FS_BINARY_MOUNTDATA, |
| 331 | }; | 331 | }; |
| 332 | MODULE_ALIAS_FS("coda"); | ||
| 332 | 333 | ||
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c index aee0a7ebbd8e..7f26c3cf75ae 100644 --- a/fs/configfs/mount.c +++ b/fs/configfs/mount.c | |||
| @@ -114,6 +114,7 @@ static struct file_system_type configfs_fs_type = { | |||
| 114 | .mount = configfs_do_mount, | 114 | .mount = configfs_do_mount, |
| 115 | .kill_sb = kill_litter_super, | 115 | .kill_sb = kill_litter_super, |
| 116 | }; | 116 | }; |
| 117 | MODULE_ALIAS_FS("configfs"); | ||
| 117 | 118 | ||
| 118 | struct dentry *configfs_pin_fs(void) | 119 | struct dentry *configfs_pin_fs(void) |
| 119 | { | 120 | { |
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 3ceb9ec976e1..35b1c7bd18b7 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c | |||
| @@ -573,6 +573,7 @@ static struct file_system_type cramfs_fs_type = { | |||
| 573 | .kill_sb = kill_block_super, | 573 | .kill_sb = kill_block_super, |
| 574 | .fs_flags = FS_REQUIRES_DEV, | 574 | .fs_flags = FS_REQUIRES_DEV, |
| 575 | }; | 575 | }; |
| 576 | MODULE_ALIAS_FS("cramfs"); | ||
| 576 | 577 | ||
| 577 | static int __init init_cramfs_fs(void) | 578 | static int __init init_cramfs_fs(void) |
| 578 | { | 579 | { |
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 0c4f80b447fb..4888cb3fdef7 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c | |||
| @@ -299,6 +299,7 @@ static struct file_system_type debug_fs_type = { | |||
| 299 | .mount = debug_mount, | 299 | .mount = debug_mount, |
| 300 | .kill_sb = kill_litter_super, | 300 | .kill_sb = kill_litter_super, |
| 301 | }; | 301 | }; |
| 302 | MODULE_ALIAS_FS("debugfs"); | ||
| 302 | 303 | ||
| 303 | static struct dentry *__create_file(const char *name, umode_t mode, | 304 | static struct dentry *__create_file(const char *name, umode_t mode, |
| 304 | struct dentry *parent, void *data, | 305 | struct dentry *parent, void *data, |
diff --git a/fs/ecryptfs/Kconfig b/fs/ecryptfs/Kconfig index e15ef38c24fa..434aa313f077 100644 --- a/fs/ecryptfs/Kconfig +++ b/fs/ecryptfs/Kconfig | |||
| @@ -12,3 +12,11 @@ config ECRYPT_FS | |||
| 12 | 12 | ||
| 13 | To compile this file system support as a module, choose M here: the | 13 | To compile this file system support as a module, choose M here: the |
| 14 | module will be called ecryptfs. | 14 | module will be called ecryptfs. |
| 15 | |||
| 16 | config ECRYPT_FS_MESSAGING | ||
| 17 | bool "Enable notifications for userspace key wrap/unwrap" | ||
| 18 | depends on ECRYPT_FS | ||
| 19 | help | ||
| 20 | Enables the /dev/ecryptfs entry for use by ecryptfsd. This allows | ||
| 21 | for userspace to wrap/unwrap file encryption keys by other | ||
| 22 | backends, like OpenSSL. | ||
diff --git a/fs/ecryptfs/Makefile b/fs/ecryptfs/Makefile index 2cc9ee4ad2eb..49678a69947d 100644 --- a/fs/ecryptfs/Makefile +++ b/fs/ecryptfs/Makefile | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | # | 1 | # |
| 2 | # Makefile for the Linux 2.6 eCryptfs | 2 | # Makefile for the Linux eCryptfs |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-$(CONFIG_ECRYPT_FS) += ecryptfs.o | 5 | obj-$(CONFIG_ECRYPT_FS) += ecryptfs.o |
| 6 | 6 | ||
| 7 | ecryptfs-objs := dentry.o file.o inode.o main.o super.o mmap.o read_write.o crypto.o keystore.o messaging.o miscdev.o kthread.o debug.o | 7 | ecryptfs-y := dentry.o file.o inode.o main.o super.o mmap.o read_write.o \ |
| 8 | crypto.o keystore.o kthread.o debug.o | ||
| 9 | |||
| 10 | ecryptfs-$(CONFIG_ECRYPT_FS_MESSAGING) += messaging.o miscdev.o | ||
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index a7b0c2dfb3db..d5c25db4398f 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
| @@ -301,17 +301,14 @@ int virt_to_scatterlist(const void *addr, int size, struct scatterlist *sg, | |||
| 301 | while (size > 0 && i < sg_size) { | 301 | while (size > 0 && i < sg_size) { |
| 302 | pg = virt_to_page(addr); | 302 | pg = virt_to_page(addr); |
| 303 | offset = offset_in_page(addr); | 303 | offset = offset_in_page(addr); |
| 304 | if (sg) | 304 | sg_set_page(&sg[i], pg, 0, offset); |
| 305 | sg_set_page(&sg[i], pg, 0, offset); | ||
| 306 | remainder_of_page = PAGE_CACHE_SIZE - offset; | 305 | remainder_of_page = PAGE_CACHE_SIZE - offset; |
| 307 | if (size >= remainder_of_page) { | 306 | if (size >= remainder_of_page) { |
| 308 | if (sg) | 307 | sg[i].length = remainder_of_page; |
| 309 | sg[i].length = remainder_of_page; | ||
| 310 | addr += remainder_of_page; | 308 | addr += remainder_of_page; |
| 311 | size -= remainder_of_page; | 309 | size -= remainder_of_page; |
| 312 | } else { | 310 | } else { |
| 313 | if (sg) | 311 | sg[i].length = size; |
| 314 | sg[i].length = size; | ||
| 315 | addr += size; | 312 | addr += size; |
| 316 | size = 0; | 313 | size = 0; |
| 317 | } | 314 | } |
diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c index 1b5d9af937df..bf12ba5dd223 100644 --- a/fs/ecryptfs/dentry.c +++ b/fs/ecryptfs/dentry.c | |||
| @@ -45,14 +45,12 @@ | |||
| 45 | static int ecryptfs_d_revalidate(struct dentry *dentry, unsigned int flags) | 45 | static int ecryptfs_d_revalidate(struct dentry *dentry, unsigned int flags) |
| 46 | { | 46 | { |
| 47 | struct dentry *lower_dentry; | 47 | struct dentry *lower_dentry; |
| 48 | struct vfsmount *lower_mnt; | ||
| 49 | int rc = 1; | 48 | int rc = 1; |
| 50 | 49 | ||
| 51 | if (flags & LOOKUP_RCU) | 50 | if (flags & LOOKUP_RCU) |
| 52 | return -ECHILD; | 51 | return -ECHILD; |
| 53 | 52 | ||
| 54 | lower_dentry = ecryptfs_dentry_to_lower(dentry); | 53 | lower_dentry = ecryptfs_dentry_to_lower(dentry); |
| 55 | lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry); | ||
| 56 | if (!lower_dentry->d_op || !lower_dentry->d_op->d_revalidate) | 54 | if (!lower_dentry->d_op || !lower_dentry->d_op->d_revalidate) |
| 57 | goto out; | 55 | goto out; |
| 58 | rc = lower_dentry->d_op->d_revalidate(lower_dentry, flags); | 56 | rc = lower_dentry->d_op->d_revalidate(lower_dentry, flags); |
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h index 7e2c6f5d7985..dd299b389d4e 100644 --- a/fs/ecryptfs/ecryptfs_kernel.h +++ b/fs/ecryptfs/ecryptfs_kernel.h | |||
| @@ -172,6 +172,19 @@ ecryptfs_get_key_payload_data(struct key *key) | |||
| 172 | #define ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE 24 | 172 | #define ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE 24 |
| 173 | #define ECRYPTFS_ENCRYPTED_DENTRY_NAME_LEN (18 + 1 + 4 + 1 + 32) | 173 | #define ECRYPTFS_ENCRYPTED_DENTRY_NAME_LEN (18 + 1 + 4 + 1 + 32) |
| 174 | 174 | ||
| 175 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
| 176 | # define ECRYPTFS_VERSIONING_MASK_MESSAGING (ECRYPTFS_VERSIONING_DEVMISC \ | ||
| 177 | | ECRYPTFS_VERSIONING_PUBKEY) | ||
| 178 | #else | ||
| 179 | # define ECRYPTFS_VERSIONING_MASK_MESSAGING 0 | ||
| 180 | #endif | ||
| 181 | |||
| 182 | #define ECRYPTFS_VERSIONING_MASK (ECRYPTFS_VERSIONING_PASSPHRASE \ | ||
| 183 | | ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH \ | ||
| 184 | | ECRYPTFS_VERSIONING_XATTR \ | ||
| 185 | | ECRYPTFS_VERSIONING_MULTKEY \ | ||
| 186 | | ECRYPTFS_VERSIONING_MASK_MESSAGING \ | ||
| 187 | | ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION) | ||
| 175 | struct ecryptfs_key_sig { | 188 | struct ecryptfs_key_sig { |
| 176 | struct list_head crypt_stat_list; | 189 | struct list_head crypt_stat_list; |
| 177 | char keysig[ECRYPTFS_SIG_SIZE_HEX + 1]; | 190 | char keysig[ECRYPTFS_SIG_SIZE_HEX + 1]; |
| @@ -399,7 +412,9 @@ struct ecryptfs_daemon { | |||
| 399 | struct hlist_node euid_chain; | 412 | struct hlist_node euid_chain; |
| 400 | }; | 413 | }; |
| 401 | 414 | ||
| 415 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
| 402 | extern struct mutex ecryptfs_daemon_hash_mux; | 416 | extern struct mutex ecryptfs_daemon_hash_mux; |
| 417 | #endif | ||
| 403 | 418 | ||
| 404 | static inline size_t | 419 | static inline size_t |
| 405 | ecryptfs_lower_header_size(struct ecryptfs_crypt_stat *crypt_stat) | 420 | ecryptfs_lower_header_size(struct ecryptfs_crypt_stat *crypt_stat) |
| @@ -610,6 +625,7 @@ int | |||
| 610 | ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value, | 625 | ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value, |
| 611 | size_t size, int flags); | 626 | size_t size, int flags); |
| 612 | int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode); | 627 | int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode); |
| 628 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
| 613 | int ecryptfs_process_response(struct ecryptfs_daemon *daemon, | 629 | int ecryptfs_process_response(struct ecryptfs_daemon *daemon, |
| 614 | struct ecryptfs_message *msg, u32 seq); | 630 | struct ecryptfs_message *msg, u32 seq); |
| 615 | int ecryptfs_send_message(char *data, int data_len, | 631 | int ecryptfs_send_message(char *data, int data_len, |
| @@ -618,6 +634,24 @@ int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx, | |||
| 618 | struct ecryptfs_message **emsg); | 634 | struct ecryptfs_message **emsg); |
| 619 | int ecryptfs_init_messaging(void); | 635 | int ecryptfs_init_messaging(void); |
| 620 | void ecryptfs_release_messaging(void); | 636 | void ecryptfs_release_messaging(void); |
| 637 | #else | ||
| 638 | static inline int ecryptfs_init_messaging(void) | ||
| 639 | { | ||
| 640 | return 0; | ||
| 641 | } | ||
| 642 | static inline void ecryptfs_release_messaging(void) | ||
| 643 | { } | ||
| 644 | static inline int ecryptfs_send_message(char *data, int data_len, | ||
| 645 | struct ecryptfs_msg_ctx **msg_ctx) | ||
| 646 | { | ||
| 647 | return -ENOTCONN; | ||
| 648 | } | ||
| 649 | static inline int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx, | ||
| 650 | struct ecryptfs_message **emsg) | ||
| 651 | { | ||
| 652 | return -ENOMSG; | ||
| 653 | } | ||
| 654 | #endif | ||
| 621 | 655 | ||
| 622 | void | 656 | void |
| 623 | ecryptfs_write_header_metadata(char *virt, | 657 | ecryptfs_write_header_metadata(char *virt, |
| @@ -655,12 +689,11 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs, | |||
| 655 | size_t offset_in_page, size_t size, | 689 | size_t offset_in_page, size_t size, |
| 656 | struct inode *ecryptfs_inode); | 690 | struct inode *ecryptfs_inode); |
| 657 | struct page *ecryptfs_get_locked_page(struct inode *inode, loff_t index); | 691 | struct page *ecryptfs_get_locked_page(struct inode *inode, loff_t index); |
| 658 | int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon); | ||
| 659 | int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon); | ||
| 660 | int ecryptfs_parse_packet_length(unsigned char *data, size_t *size, | 692 | int ecryptfs_parse_packet_length(unsigned char *data, size_t *size, |
| 661 | size_t *length_size); | 693 | size_t *length_size); |
| 662 | int ecryptfs_write_packet_length(char *dest, size_t size, | 694 | int ecryptfs_write_packet_length(char *dest, size_t size, |
| 663 | size_t *packet_size_length); | 695 | size_t *packet_size_length); |
| 696 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
| 664 | int ecryptfs_init_ecryptfs_miscdev(void); | 697 | int ecryptfs_init_ecryptfs_miscdev(void); |
| 665 | void ecryptfs_destroy_ecryptfs_miscdev(void); | 698 | void ecryptfs_destroy_ecryptfs_miscdev(void); |
| 666 | int ecryptfs_send_miscdev(char *data, size_t data_size, | 699 | int ecryptfs_send_miscdev(char *data, size_t data_size, |
| @@ -669,6 +702,9 @@ int ecryptfs_send_miscdev(char *data, size_t data_size, | |||
| 669 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx); | 702 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx); |
| 670 | int | 703 | int |
| 671 | ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, struct file *file); | 704 | ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, struct file *file); |
| 705 | int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon); | ||
| 706 | int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon); | ||
| 707 | #endif | ||
| 672 | int ecryptfs_init_kthread(void); | 708 | int ecryptfs_init_kthread(void); |
| 673 | void ecryptfs_destroy_kthread(void); | 709 | void ecryptfs_destroy_kthread(void); |
| 674 | int ecryptfs_privileged_open(struct file **lower_file, | 710 | int ecryptfs_privileged_open(struct file **lower_file, |
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index 53acc9d0c138..63b1f54b6a1f 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
| @@ -199,7 +199,6 @@ static int ecryptfs_open(struct inode *inode, struct file *file) | |||
| 199 | struct dentry *ecryptfs_dentry = file->f_path.dentry; | 199 | struct dentry *ecryptfs_dentry = file->f_path.dentry; |
| 200 | /* Private value of ecryptfs_dentry allocated in | 200 | /* Private value of ecryptfs_dentry allocated in |
| 201 | * ecryptfs_lookup() */ | 201 | * ecryptfs_lookup() */ |
| 202 | struct dentry *lower_dentry; | ||
| 203 | struct ecryptfs_file_info *file_info; | 202 | struct ecryptfs_file_info *file_info; |
| 204 | 203 | ||
| 205 | mount_crypt_stat = &ecryptfs_superblock_to_private( | 204 | mount_crypt_stat = &ecryptfs_superblock_to_private( |
| @@ -222,7 +221,6 @@ static int ecryptfs_open(struct inode *inode, struct file *file) | |||
| 222 | rc = -ENOMEM; | 221 | rc = -ENOMEM; |
| 223 | goto out; | 222 | goto out; |
| 224 | } | 223 | } |
| 225 | lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry); | ||
| 226 | crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat; | 224 | crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat; |
| 227 | mutex_lock(&crypt_stat->cs_mutex); | 225 | mutex_lock(&crypt_stat->cs_mutex); |
| 228 | if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED)) { | 226 | if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED)) { |
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index e0f07fb6d56b..5eab400e2590 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
| @@ -999,8 +999,8 @@ out: | |||
| 999 | return rc; | 999 | return rc; |
| 1000 | } | 1000 | } |
| 1001 | 1001 | ||
| 1002 | int ecryptfs_getattr_link(struct vfsmount *mnt, struct dentry *dentry, | 1002 | static int ecryptfs_getattr_link(struct vfsmount *mnt, struct dentry *dentry, |
| 1003 | struct kstat *stat) | 1003 | struct kstat *stat) |
| 1004 | { | 1004 | { |
| 1005 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; | 1005 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; |
| 1006 | int rc = 0; | 1006 | int rc = 0; |
| @@ -1021,8 +1021,8 @@ int ecryptfs_getattr_link(struct vfsmount *mnt, struct dentry *dentry, | |||
| 1021 | return rc; | 1021 | return rc; |
| 1022 | } | 1022 | } |
| 1023 | 1023 | ||
| 1024 | int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry, | 1024 | static int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry, |
| 1025 | struct kstat *stat) | 1025 | struct kstat *stat) |
| 1026 | { | 1026 | { |
| 1027 | struct kstat lower_stat; | 1027 | struct kstat lower_stat; |
| 1028 | int rc; | 1028 | int rc; |
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index 2333203a120b..7d52806c2119 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c | |||
| @@ -1150,7 +1150,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | |||
| 1150 | struct ecryptfs_message *msg = NULL; | 1150 | struct ecryptfs_message *msg = NULL; |
| 1151 | char *auth_tok_sig; | 1151 | char *auth_tok_sig; |
| 1152 | char *payload; | 1152 | char *payload; |
| 1153 | size_t payload_len; | 1153 | size_t payload_len = 0; |
| 1154 | int rc; | 1154 | int rc; |
| 1155 | 1155 | ||
| 1156 | rc = ecryptfs_get_auth_tok_sig(&auth_tok_sig, auth_tok); | 1156 | rc = ecryptfs_get_auth_tok_sig(&auth_tok_sig, auth_tok); |
| @@ -1168,7 +1168,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | |||
| 1168 | rc = ecryptfs_send_message(payload, payload_len, &msg_ctx); | 1168 | rc = ecryptfs_send_message(payload, payload_len, &msg_ctx); |
| 1169 | if (rc) { | 1169 | if (rc) { |
| 1170 | ecryptfs_printk(KERN_ERR, "Error sending message to " | 1170 | ecryptfs_printk(KERN_ERR, "Error sending message to " |
| 1171 | "ecryptfsd\n"); | 1171 | "ecryptfsd: %d\n", rc); |
| 1172 | goto out; | 1172 | goto out; |
| 1173 | } | 1173 | } |
| 1174 | rc = ecryptfs_wait_for_response(msg_ctx, &msg); | 1174 | rc = ecryptfs_wait_for_response(msg_ctx, &msg); |
| @@ -1202,8 +1202,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | |||
| 1202 | crypt_stat->key_size); | 1202 | crypt_stat->key_size); |
| 1203 | } | 1203 | } |
| 1204 | out: | 1204 | out: |
| 1205 | if (msg) | 1205 | kfree(msg); |
| 1206 | kfree(msg); | ||
| 1207 | return rc; | 1206 | return rc; |
| 1208 | } | 1207 | } |
| 1209 | 1208 | ||
| @@ -1989,7 +1988,7 @@ pki_encrypt_session_key(struct key *auth_tok_key, | |||
| 1989 | rc = ecryptfs_send_message(payload, payload_len, &msg_ctx); | 1988 | rc = ecryptfs_send_message(payload, payload_len, &msg_ctx); |
| 1990 | if (rc) { | 1989 | if (rc) { |
| 1991 | ecryptfs_printk(KERN_ERR, "Error sending message to " | 1990 | ecryptfs_printk(KERN_ERR, "Error sending message to " |
| 1992 | "ecryptfsd\n"); | 1991 | "ecryptfsd: %d\n", rc); |
| 1993 | goto out; | 1992 | goto out; |
| 1994 | } | 1993 | } |
| 1995 | rc = ecryptfs_wait_for_response(msg_ctx, &msg); | 1994 | rc = ecryptfs_wait_for_response(msg_ctx, &msg); |
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 4e0886c9e5c4..e924cf45aad9 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
| @@ -629,6 +629,7 @@ static struct file_system_type ecryptfs_fs_type = { | |||
| 629 | .kill_sb = ecryptfs_kill_block_super, | 629 | .kill_sb = ecryptfs_kill_block_super, |
| 630 | .fs_flags = 0 | 630 | .fs_flags = 0 |
| 631 | }; | 631 | }; |
| 632 | MODULE_ALIAS_FS("ecryptfs"); | ||
| 632 | 633 | ||
| 633 | /** | 634 | /** |
| 634 | * inode_info_init_once | 635 | * inode_info_init_once |
diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c index 8d7a577ae497..49ff8ea08f1c 100644 --- a/fs/ecryptfs/messaging.c +++ b/fs/ecryptfs/messaging.c | |||
| @@ -97,8 +97,7 @@ static void ecryptfs_msg_ctx_free_to_alloc(struct ecryptfs_msg_ctx *msg_ctx) | |||
| 97 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx) | 97 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx) |
| 98 | { | 98 | { |
| 99 | list_move(&(msg_ctx->node), &ecryptfs_msg_ctx_free_list); | 99 | list_move(&(msg_ctx->node), &ecryptfs_msg_ctx_free_list); |
| 100 | if (msg_ctx->msg) | 100 | kfree(msg_ctx->msg); |
| 101 | kfree(msg_ctx->msg); | ||
| 102 | msg_ctx->msg = NULL; | 101 | msg_ctx->msg = NULL; |
| 103 | msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_FREE; | 102 | msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_FREE; |
| 104 | } | 103 | } |
| @@ -283,7 +282,7 @@ ecryptfs_send_message_locked(char *data, int data_len, u8 msg_type, | |||
| 283 | int rc; | 282 | int rc; |
| 284 | 283 | ||
| 285 | rc = ecryptfs_find_daemon_by_euid(&daemon); | 284 | rc = ecryptfs_find_daemon_by_euid(&daemon); |
| 286 | if (rc || !daemon) { | 285 | if (rc) { |
| 287 | rc = -ENOTCONN; | 286 | rc = -ENOTCONN; |
| 288 | goto out; | 287 | goto out; |
| 289 | } | 288 | } |
diff --git a/fs/efs/super.c b/fs/efs/super.c index 2002431ef9a0..c6f57a74a559 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c | |||
| @@ -33,6 +33,7 @@ static struct file_system_type efs_fs_type = { | |||
| 33 | .kill_sb = kill_block_super, | 33 | .kill_sb = kill_block_super, |
| 34 | .fs_flags = FS_REQUIRES_DEV, | 34 | .fs_flags = FS_REQUIRES_DEV, |
| 35 | }; | 35 | }; |
| 36 | MODULE_ALIAS_FS("efs"); | ||
| 36 | 37 | ||
| 37 | static struct pt_types sgi_pt_types[] = { | 38 | static struct pt_types sgi_pt_types[] = { |
| 38 | {0x00, "SGI vh"}, | 39 | {0x00, "SGI vh"}, |
diff --git a/fs/exofs/super.c b/fs/exofs/super.c index 5e59280d42d7..9d9763328734 100644 --- a/fs/exofs/super.c +++ b/fs/exofs/super.c | |||
| @@ -1010,6 +1010,7 @@ static struct file_system_type exofs_type = { | |||
| 1010 | .mount = exofs_mount, | 1010 | .mount = exofs_mount, |
| 1011 | .kill_sb = generic_shutdown_super, | 1011 | .kill_sb = generic_shutdown_super, |
| 1012 | }; | 1012 | }; |
| 1013 | MODULE_ALIAS_FS("exofs"); | ||
| 1013 | 1014 | ||
| 1014 | static int __init init_exofs(void) | 1015 | static int __init init_exofs(void) |
| 1015 | { | 1016 | { |
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 7f68c8114026..288534920fe5 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
| @@ -1536,6 +1536,7 @@ static struct file_system_type ext2_fs_type = { | |||
| 1536 | .kill_sb = kill_block_super, | 1536 | .kill_sb = kill_block_super, |
| 1537 | .fs_flags = FS_REQUIRES_DEV, | 1537 | .fs_flags = FS_REQUIRES_DEV, |
| 1538 | }; | 1538 | }; |
| 1539 | MODULE_ALIAS_FS("ext2"); | ||
| 1539 | 1540 | ||
| 1540 | static int __init init_ext2_fs(void) | 1541 | static int __init init_ext2_fs(void) |
| 1541 | { | 1542 | { |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 5546ca225ffe..1d6e2ed85322 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
| @@ -3068,6 +3068,7 @@ static struct file_system_type ext3_fs_type = { | |||
| 3068 | .kill_sb = kill_block_super, | 3068 | .kill_sb = kill_block_super, |
| 3069 | .fs_flags = FS_REQUIRES_DEV, | 3069 | .fs_flags = FS_REQUIRES_DEV, |
| 3070 | }; | 3070 | }; |
| 3071 | MODULE_ALIAS_FS("ext3"); | ||
| 3071 | 3072 | ||
| 3072 | static int __init init_ext3_fs(void) | 3073 | static int __init init_ext3_fs(void) |
| 3073 | { | 3074 | { |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 5e6c87836193..34e855219231 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -90,6 +90,7 @@ static struct file_system_type ext2_fs_type = { | |||
| 90 | .kill_sb = kill_block_super, | 90 | .kill_sb = kill_block_super, |
| 91 | .fs_flags = FS_REQUIRES_DEV, | 91 | .fs_flags = FS_REQUIRES_DEV, |
| 92 | }; | 92 | }; |
| 93 | MODULE_ALIAS_FS("ext2"); | ||
| 93 | #define IS_EXT2_SB(sb) ((sb)->s_bdev->bd_holder == &ext2_fs_type) | 94 | #define IS_EXT2_SB(sb) ((sb)->s_bdev->bd_holder == &ext2_fs_type) |
| 94 | #else | 95 | #else |
| 95 | #define IS_EXT2_SB(sb) (0) | 96 | #define IS_EXT2_SB(sb) (0) |
| @@ -104,6 +105,7 @@ static struct file_system_type ext3_fs_type = { | |||
| 104 | .kill_sb = kill_block_super, | 105 | .kill_sb = kill_block_super, |
| 105 | .fs_flags = FS_REQUIRES_DEV, | 106 | .fs_flags = FS_REQUIRES_DEV, |
| 106 | }; | 107 | }; |
| 108 | MODULE_ALIAS_FS("ext3"); | ||
| 107 | #define IS_EXT3_SB(sb) ((sb)->s_bdev->bd_holder == &ext3_fs_type) | 109 | #define IS_EXT3_SB(sb) ((sb)->s_bdev->bd_holder == &ext3_fs_type) |
| 108 | #else | 110 | #else |
| 109 | #define IS_EXT3_SB(sb) (0) | 111 | #define IS_EXT3_SB(sb) (0) |
| @@ -5152,7 +5154,6 @@ static inline int ext2_feature_set_ok(struct super_block *sb) | |||
| 5152 | return 0; | 5154 | return 0; |
| 5153 | return 1; | 5155 | return 1; |
| 5154 | } | 5156 | } |
| 5155 | MODULE_ALIAS("ext2"); | ||
| 5156 | #else | 5157 | #else |
| 5157 | static inline void register_as_ext2(void) { } | 5158 | static inline void register_as_ext2(void) { } |
| 5158 | static inline void unregister_as_ext2(void) { } | 5159 | static inline void unregister_as_ext2(void) { } |
| @@ -5185,7 +5186,6 @@ static inline int ext3_feature_set_ok(struct super_block *sb) | |||
| 5185 | return 0; | 5186 | return 0; |
| 5186 | return 1; | 5187 | return 1; |
| 5187 | } | 5188 | } |
| 5188 | MODULE_ALIAS("ext3"); | ||
| 5189 | #else | 5189 | #else |
| 5190 | static inline void register_as_ext3(void) { } | 5190 | static inline void register_as_ext3(void) { } |
| 5191 | static inline void unregister_as_ext3(void) { } | 5191 | static inline void unregister_as_ext3(void) { } |
| @@ -5199,6 +5199,7 @@ static struct file_system_type ext4_fs_type = { | |||
| 5199 | .kill_sb = kill_block_super, | 5199 | .kill_sb = kill_block_super, |
| 5200 | .fs_flags = FS_REQUIRES_DEV, | 5200 | .fs_flags = FS_REQUIRES_DEV, |
| 5201 | }; | 5201 | }; |
| 5202 | MODULE_ALIAS_FS("ext4"); | ||
| 5202 | 5203 | ||
| 5203 | static int __init ext4_init_feat_adverts(void) | 5204 | static int __init ext4_init_feat_adverts(void) |
| 5204 | { | 5205 | { |
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 8c117649a035..fea6e582a2ed 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
| @@ -687,6 +687,7 @@ static struct file_system_type f2fs_fs_type = { | |||
| 687 | .kill_sb = kill_block_super, | 687 | .kill_sb = kill_block_super, |
| 688 | .fs_flags = FS_REQUIRES_DEV, | 688 | .fs_flags = FS_REQUIRES_DEV, |
| 689 | }; | 689 | }; |
| 690 | MODULE_ALIAS_FS("f2fs"); | ||
| 690 | 691 | ||
| 691 | static int __init init_inodecache(void) | 692 | static int __init init_inodecache(void) |
| 692 | { | 693 | { |
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c index e2cfda94a28d..081b759cff83 100644 --- a/fs/fat/namei_msdos.c +++ b/fs/fat/namei_msdos.c | |||
| @@ -668,6 +668,7 @@ static struct file_system_type msdos_fs_type = { | |||
| 668 | .kill_sb = kill_block_super, | 668 | .kill_sb = kill_block_super, |
| 669 | .fs_flags = FS_REQUIRES_DEV, | 669 | .fs_flags = FS_REQUIRES_DEV, |
| 670 | }; | 670 | }; |
| 671 | MODULE_ALIAS_FS("msdos"); | ||
| 671 | 672 | ||
| 672 | static int __init init_msdos_fs(void) | 673 | static int __init init_msdos_fs(void) |
| 673 | { | 674 | { |
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c index ac959d655e7d..2da952036a3d 100644 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c | |||
| @@ -1073,6 +1073,7 @@ static struct file_system_type vfat_fs_type = { | |||
| 1073 | .kill_sb = kill_block_super, | 1073 | .kill_sb = kill_block_super, |
| 1074 | .fs_flags = FS_REQUIRES_DEV, | 1074 | .fs_flags = FS_REQUIRES_DEV, |
| 1075 | }; | 1075 | }; |
| 1076 | MODULE_ALIAS_FS("vfat"); | ||
| 1076 | 1077 | ||
| 1077 | static int __init init_vfat_fs(void) | 1078 | static int __init init_vfat_fs(void) |
| 1078 | { | 1079 | { |
diff --git a/fs/filesystems.c b/fs/filesystems.c index da165f6adcbf..92567d95ba6a 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c | |||
| @@ -273,7 +273,7 @@ struct file_system_type *get_fs_type(const char *name) | |||
| 273 | int len = dot ? dot - name : strlen(name); | 273 | int len = dot ? dot - name : strlen(name); |
| 274 | 274 | ||
| 275 | fs = __get_fs_type(name, len); | 275 | fs = __get_fs_type(name, len); |
| 276 | if (!fs && (request_module("%.*s", len, name) == 0)) | 276 | if (!fs && (request_module("fs-%.*s", len, name) == 0)) |
| 277 | fs = __get_fs_type(name, len); | 277 | fs = __get_fs_type(name, len); |
| 278 | 278 | ||
| 279 | if (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) { | 279 | if (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) { |
diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c index fed2c8afb3a9..455074308069 100644 --- a/fs/freevxfs/vxfs_super.c +++ b/fs/freevxfs/vxfs_super.c | |||
| @@ -52,7 +52,6 @@ MODULE_AUTHOR("Christoph Hellwig"); | |||
| 52 | MODULE_DESCRIPTION("Veritas Filesystem (VxFS) driver"); | 52 | MODULE_DESCRIPTION("Veritas Filesystem (VxFS) driver"); |
| 53 | MODULE_LICENSE("Dual BSD/GPL"); | 53 | MODULE_LICENSE("Dual BSD/GPL"); |
| 54 | 54 | ||
| 55 | MODULE_ALIAS("vxfs"); /* makes mount -t vxfs autoload the module */ | ||
| 56 | 55 | ||
| 57 | 56 | ||
| 58 | static void vxfs_put_super(struct super_block *); | 57 | static void vxfs_put_super(struct super_block *); |
| @@ -258,6 +257,7 @@ static struct file_system_type vxfs_fs_type = { | |||
| 258 | .kill_sb = kill_block_super, | 257 | .kill_sb = kill_block_super, |
| 259 | .fs_flags = FS_REQUIRES_DEV, | 258 | .fs_flags = FS_REQUIRES_DEV, |
| 260 | }; | 259 | }; |
| 260 | MODULE_ALIAS_FS("vxfs"); /* makes mount -t vxfs autoload the module */ | ||
| 261 | 261 | ||
| 262 | static int __init | 262 | static int __init |
| 263 | vxfs_init(void) | 263 | vxfs_init(void) |
diff --git a/fs/fuse/control.c b/fs/fuse/control.c index b7978b9f75ef..a0b0855d00a9 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c | |||
| @@ -341,6 +341,7 @@ static struct file_system_type fuse_ctl_fs_type = { | |||
| 341 | .mount = fuse_ctl_mount, | 341 | .mount = fuse_ctl_mount, |
| 342 | .kill_sb = fuse_ctl_kill_sb, | 342 | .kill_sb = fuse_ctl_kill_sb, |
| 343 | }; | 343 | }; |
| 344 | MODULE_ALIAS_FS("fusectl"); | ||
| 344 | 345 | ||
| 345 | int __init fuse_ctl_init(void) | 346 | int __init fuse_ctl_init(void) |
| 346 | { | 347 | { |
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index df00993ed108..137185c3884f 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
| @@ -1117,6 +1117,7 @@ static struct file_system_type fuse_fs_type = { | |||
| 1117 | .mount = fuse_mount, | 1117 | .mount = fuse_mount, |
| 1118 | .kill_sb = fuse_kill_sb_anon, | 1118 | .kill_sb = fuse_kill_sb_anon, |
| 1119 | }; | 1119 | }; |
| 1120 | MODULE_ALIAS_FS("fuse"); | ||
| 1120 | 1121 | ||
| 1121 | #ifdef CONFIG_BLOCK | 1122 | #ifdef CONFIG_BLOCK |
| 1122 | static struct dentry *fuse_mount_blk(struct file_system_type *fs_type, | 1123 | static struct dentry *fuse_mount_blk(struct file_system_type *fs_type, |
| @@ -1146,6 +1147,7 @@ static struct file_system_type fuseblk_fs_type = { | |||
| 1146 | .kill_sb = fuse_kill_sb_blk, | 1147 | .kill_sb = fuse_kill_sb_blk, |
| 1147 | .fs_flags = FS_REQUIRES_DEV | FS_HAS_SUBTYPE, | 1148 | .fs_flags = FS_REQUIRES_DEV | FS_HAS_SUBTYPE, |
| 1148 | }; | 1149 | }; |
| 1150 | MODULE_ALIAS_FS("fuseblk"); | ||
| 1149 | 1151 | ||
| 1150 | static inline int register_fuseblk(void) | 1152 | static inline int register_fuseblk(void) |
| 1151 | { | 1153 | { |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 1b612be4b873..60ede2a0f43f 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/gfs2_ondisk.h> | 20 | #include <linux/gfs2_ondisk.h> |
| 21 | #include <linux/quotaops.h> | 21 | #include <linux/quotaops.h> |
| 22 | #include <linux/lockdep.h> | 22 | #include <linux/lockdep.h> |
| 23 | #include <linux/module.h> | ||
| 23 | 24 | ||
| 24 | #include "gfs2.h" | 25 | #include "gfs2.h" |
| 25 | #include "incore.h" | 26 | #include "incore.h" |
| @@ -1425,6 +1426,7 @@ struct file_system_type gfs2_fs_type = { | |||
| 1425 | .kill_sb = gfs2_kill_sb, | 1426 | .kill_sb = gfs2_kill_sb, |
| 1426 | .owner = THIS_MODULE, | 1427 | .owner = THIS_MODULE, |
| 1427 | }; | 1428 | }; |
| 1429 | MODULE_ALIAS_FS("gfs2"); | ||
| 1428 | 1430 | ||
| 1429 | struct file_system_type gfs2meta_fs_type = { | 1431 | struct file_system_type gfs2meta_fs_type = { |
| 1430 | .name = "gfs2meta", | 1432 | .name = "gfs2meta", |
| @@ -1432,4 +1434,4 @@ struct file_system_type gfs2meta_fs_type = { | |||
| 1432 | .mount = gfs2_mount_meta, | 1434 | .mount = gfs2_mount_meta, |
| 1433 | .owner = THIS_MODULE, | 1435 | .owner = THIS_MODULE, |
| 1434 | }; | 1436 | }; |
| 1435 | 1437 | MODULE_ALIAS_FS("gfs2meta"); | |
diff --git a/fs/hfs/super.c b/fs/hfs/super.c index e93ddaadfd1e..bbaaa8a4ee64 100644 --- a/fs/hfs/super.c +++ b/fs/hfs/super.c | |||
| @@ -466,6 +466,7 @@ static struct file_system_type hfs_fs_type = { | |||
| 466 | .kill_sb = kill_block_super, | 466 | .kill_sb = kill_block_super, |
| 467 | .fs_flags = FS_REQUIRES_DEV, | 467 | .fs_flags = FS_REQUIRES_DEV, |
| 468 | }; | 468 | }; |
| 469 | MODULE_ALIAS_FS("hfs"); | ||
| 469 | 470 | ||
| 470 | static void hfs_init_once(void *p) | 471 | static void hfs_init_once(void *p) |
| 471 | { | 472 | { |
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 974c26f96fae..7b87284e46dc 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c | |||
| @@ -654,6 +654,7 @@ static struct file_system_type hfsplus_fs_type = { | |||
| 654 | .kill_sb = kill_block_super, | 654 | .kill_sb = kill_block_super, |
| 655 | .fs_flags = FS_REQUIRES_DEV, | 655 | .fs_flags = FS_REQUIRES_DEV, |
| 656 | }; | 656 | }; |
| 657 | MODULE_ALIAS_FS("hfsplus"); | ||
| 657 | 658 | ||
| 658 | static void hfsplus_init_once(void *p) | 659 | static void hfsplus_init_once(void *p) |
| 659 | { | 660 | { |
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c index 74f55703be49..126d3c2e2dee 100644 --- a/fs/hppfs/hppfs.c +++ b/fs/hppfs/hppfs.c | |||
| @@ -748,6 +748,7 @@ static struct file_system_type hppfs_type = { | |||
| 748 | .kill_sb = kill_anon_super, | 748 | .kill_sb = kill_anon_super, |
| 749 | .fs_flags = 0, | 749 | .fs_flags = 0, |
| 750 | }; | 750 | }; |
| 751 | MODULE_ALIAS_FS("hppfs"); | ||
| 751 | 752 | ||
| 752 | static int __init init_hppfs(void) | 753 | static int __init init_hppfs(void) |
| 753 | { | 754 | { |
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 7f94e0cbc69c..84e3d856e91d 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
| @@ -896,6 +896,7 @@ static struct file_system_type hugetlbfs_fs_type = { | |||
| 896 | .mount = hugetlbfs_mount, | 896 | .mount = hugetlbfs_mount, |
| 897 | .kill_sb = kill_litter_super, | 897 | .kill_sb = kill_litter_super, |
| 898 | }; | 898 | }; |
| 899 | MODULE_ALIAS_FS("hugetlbfs"); | ||
| 899 | 900 | ||
| 900 | static struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE]; | 901 | static struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE]; |
| 901 | 902 | ||
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 67ce52507d7d..a67f16e846a2 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c | |||
| @@ -1556,6 +1556,7 @@ static struct file_system_type iso9660_fs_type = { | |||
| 1556 | .kill_sb = kill_block_super, | 1556 | .kill_sb = kill_block_super, |
| 1557 | .fs_flags = FS_REQUIRES_DEV, | 1557 | .fs_flags = FS_REQUIRES_DEV, |
| 1558 | }; | 1558 | }; |
| 1559 | MODULE_ALIAS_FS("iso9660"); | ||
| 1559 | 1560 | ||
| 1560 | static int __init init_iso9660_fs(void) | 1561 | static int __init init_iso9660_fs(void) |
| 1561 | { | 1562 | { |
| @@ -1593,5 +1594,3 @@ static void __exit exit_iso9660_fs(void) | |||
| 1593 | module_init(init_iso9660_fs) | 1594 | module_init(init_iso9660_fs) |
| 1594 | module_exit(exit_iso9660_fs) | 1595 | module_exit(exit_iso9660_fs) |
| 1595 | MODULE_LICENSE("GPL"); | 1596 | MODULE_LICENSE("GPL"); |
| 1596 | /* Actual filesystem name is iso9660, as requested in filesystems.c */ | ||
| 1597 | MODULE_ALIAS("iso9660"); | ||
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index d3d8799e2187..0defb1cc2a35 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c | |||
| @@ -356,6 +356,7 @@ static struct file_system_type jffs2_fs_type = { | |||
| 356 | .mount = jffs2_mount, | 356 | .mount = jffs2_mount, |
| 357 | .kill_sb = jffs2_kill_sb, | 357 | .kill_sb = jffs2_kill_sb, |
| 358 | }; | 358 | }; |
| 359 | MODULE_ALIAS_FS("jffs2"); | ||
| 359 | 360 | ||
| 360 | static int __init init_jffs2_fs(void) | 361 | static int __init init_jffs2_fs(void) |
| 361 | { | 362 | { |
diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 060ba638becb..2003e830ed1c 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c | |||
| @@ -833,6 +833,7 @@ static struct file_system_type jfs_fs_type = { | |||
| 833 | .kill_sb = kill_block_super, | 833 | .kill_sb = kill_block_super, |
| 834 | .fs_flags = FS_REQUIRES_DEV, | 834 | .fs_flags = FS_REQUIRES_DEV, |
| 835 | }; | 835 | }; |
| 836 | MODULE_ALIAS_FS("jfs"); | ||
| 836 | 837 | ||
| 837 | static void init_once(void *foo) | 838 | static void init_once(void *foo) |
| 838 | { | 839 | { |
diff --git a/fs/logfs/super.c b/fs/logfs/super.c index 345c24b8a6f8..54360293bcb5 100644 --- a/fs/logfs/super.c +++ b/fs/logfs/super.c | |||
| @@ -608,6 +608,7 @@ static struct file_system_type logfs_fs_type = { | |||
| 608 | .fs_flags = FS_REQUIRES_DEV, | 608 | .fs_flags = FS_REQUIRES_DEV, |
| 609 | 609 | ||
| 610 | }; | 610 | }; |
| 611 | MODULE_ALIAS_FS("logfs"); | ||
| 611 | 612 | ||
| 612 | static int __init logfs_init(void) | 613 | static int __init logfs_init(void) |
| 613 | { | 614 | { |
diff --git a/fs/minix/inode.c b/fs/minix/inode.c index 99541cceb584..df122496f328 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c | |||
| @@ -660,6 +660,7 @@ static struct file_system_type minix_fs_type = { | |||
| 660 | .kill_sb = kill_block_super, | 660 | .kill_sb = kill_block_super, |
| 661 | .fs_flags = FS_REQUIRES_DEV, | 661 | .fs_flags = FS_REQUIRES_DEV, |
| 662 | }; | 662 | }; |
| 663 | MODULE_ALIAS_FS("minix"); | ||
| 663 | 664 | ||
| 664 | static int __init init_minix_fs(void) | 665 | static int __init init_minix_fs(void) |
| 665 | { | 666 | { |
diff --git a/fs/namei.c b/fs/namei.c index 961bc1268366..57ae9c8c66bf 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
| @@ -689,8 +689,6 @@ void nd_jump_link(struct nameidata *nd, struct path *path) | |||
| 689 | nd->path = *path; | 689 | nd->path = *path; |
| 690 | nd->inode = nd->path.dentry->d_inode; | 690 | nd->inode = nd->path.dentry->d_inode; |
| 691 | nd->flags |= LOOKUP_JUMPED; | 691 | nd->flags |= LOOKUP_JUMPED; |
| 692 | |||
| 693 | BUG_ON(nd->inode->i_op->follow_link); | ||
| 694 | } | 692 | } |
| 695 | 693 | ||
| 696 | static inline void put_link(struct nameidata *nd, struct path *link, void *cookie) | 694 | static inline void put_link(struct nameidata *nd, struct path *link, void *cookie) |
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 7dafd6899a62..26910c8154da 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c | |||
| @@ -1051,6 +1051,7 @@ static struct file_system_type ncp_fs_type = { | |||
| 1051 | .kill_sb = kill_anon_super, | 1051 | .kill_sb = kill_anon_super, |
| 1052 | .fs_flags = FS_BINARY_MOUNTDATA, | 1052 | .fs_flags = FS_BINARY_MOUNTDATA, |
| 1053 | }; | 1053 | }; |
| 1054 | MODULE_ALIAS_FS("ncpfs"); | ||
| 1054 | 1055 | ||
| 1055 | static int __init init_ncp_fs(void) | 1056 | static int __init init_ncp_fs(void) |
| 1056 | { | 1057 | { |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 17b32b722457..95cdcb208dfb 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
| @@ -294,6 +294,7 @@ struct file_system_type nfs_fs_type = { | |||
| 294 | .kill_sb = nfs_kill_super, | 294 | .kill_sb = nfs_kill_super, |
| 295 | .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, | 295 | .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, |
| 296 | }; | 296 | }; |
| 297 | MODULE_ALIAS_FS("nfs"); | ||
| 297 | EXPORT_SYMBOL_GPL(nfs_fs_type); | 298 | EXPORT_SYMBOL_GPL(nfs_fs_type); |
| 298 | 299 | ||
| 299 | struct file_system_type nfs_xdev_fs_type = { | 300 | struct file_system_type nfs_xdev_fs_type = { |
| @@ -333,6 +334,7 @@ struct file_system_type nfs4_fs_type = { | |||
| 333 | .kill_sb = nfs_kill_super, | 334 | .kill_sb = nfs_kill_super, |
| 334 | .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, | 335 | .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, |
| 335 | }; | 336 | }; |
| 337 | MODULE_ALIAS_FS("nfs4"); | ||
| 336 | EXPORT_SYMBOL_GPL(nfs4_fs_type); | 338 | EXPORT_SYMBOL_GPL(nfs4_fs_type); |
| 337 | 339 | ||
| 338 | static int __init register_nfs4_fs(void) | 340 | static int __init register_nfs4_fs(void) |
| @@ -2717,6 +2719,5 @@ module_param(send_implementation_id, ushort, 0644); | |||
| 2717 | MODULE_PARM_DESC(send_implementation_id, | 2719 | MODULE_PARM_DESC(send_implementation_id, |
| 2718 | "Send implementation ID with NFSv4.1 exchange_id"); | 2720 | "Send implementation ID with NFSv4.1 exchange_id"); |
| 2719 | MODULE_PARM_DESC(nfs4_unique_id, "nfs_client_id4 uniquifier string"); | 2721 | MODULE_PARM_DESC(nfs4_unique_id, "nfs_client_id4 uniquifier string"); |
| 2720 | MODULE_ALIAS("nfs4"); | ||
| 2721 | 2722 | ||
| 2722 | #endif /* CONFIG_NFS_V4 */ | 2723 | #endif /* CONFIG_NFS_V4 */ |
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 13a21c8fca49..f33455b4d957 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
| @@ -1090,6 +1090,7 @@ static struct file_system_type nfsd_fs_type = { | |||
| 1090 | .mount = nfsd_mount, | 1090 | .mount = nfsd_mount, |
| 1091 | .kill_sb = nfsd_umount, | 1091 | .kill_sb = nfsd_umount, |
| 1092 | }; | 1092 | }; |
| 1093 | MODULE_ALIAS_FS("nfsd"); | ||
| 1093 | 1094 | ||
| 1094 | #ifdef CONFIG_PROC_FS | 1095 | #ifdef CONFIG_PROC_FS |
| 1095 | static int create_proc_exports_entry(void) | 1096 | static int create_proc_exports_entry(void) |
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 3c991dc84f2f..c7d1f9f18b09 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
| @@ -1361,6 +1361,7 @@ struct file_system_type nilfs_fs_type = { | |||
| 1361 | .kill_sb = kill_block_super, | 1361 | .kill_sb = kill_block_super, |
| 1362 | .fs_flags = FS_REQUIRES_DEV, | 1362 | .fs_flags = FS_REQUIRES_DEV, |
| 1363 | }; | 1363 | }; |
| 1364 | MODULE_ALIAS_FS("nilfs2"); | ||
| 1364 | 1365 | ||
| 1365 | static void nilfs_inode_init_once(void *obj) | 1366 | static void nilfs_inode_init_once(void *obj) |
| 1366 | { | 1367 | { |
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 4a8289f8b16c..82650d52d916 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
| @@ -3079,6 +3079,7 @@ static struct file_system_type ntfs_fs_type = { | |||
| 3079 | .kill_sb = kill_block_super, | 3079 | .kill_sb = kill_block_super, |
| 3080 | .fs_flags = FS_REQUIRES_DEV, | 3080 | .fs_flags = FS_REQUIRES_DEV, |
| 3081 | }; | 3081 | }; |
| 3082 | MODULE_ALIAS_FS("ntfs"); | ||
| 3082 | 3083 | ||
| 3083 | /* Stable names for the slab caches. */ | 3084 | /* Stable names for the slab caches. */ |
| 3084 | static const char ntfs_index_ctx_cache_name[] = "ntfs_index_ctx_cache"; | 3085 | static const char ntfs_index_ctx_cache_name[] = "ntfs_index_ctx_cache"; |
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index 4c5fc8d77dc2..12bafb7265ce 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c | |||
| @@ -640,6 +640,7 @@ static struct file_system_type dlmfs_fs_type = { | |||
| 640 | .mount = dlmfs_mount, | 640 | .mount = dlmfs_mount, |
| 641 | .kill_sb = kill_litter_super, | 641 | .kill_sb = kill_litter_super, |
| 642 | }; | 642 | }; |
| 643 | MODULE_ALIAS_FS("ocfs2_dlmfs"); | ||
| 643 | 644 | ||
| 644 | static int __init init_dlmfs_fs(void) | 645 | static int __init init_dlmfs_fs(void) |
| 645 | { | 646 | { |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 9b6910dec4ba..01b85165552b 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
| @@ -1266,6 +1266,7 @@ static struct file_system_type ocfs2_fs_type = { | |||
| 1266 | .fs_flags = FS_REQUIRES_DEV|FS_RENAME_DOES_D_MOVE, | 1266 | .fs_flags = FS_REQUIRES_DEV|FS_RENAME_DOES_D_MOVE, |
| 1267 | .next = NULL | 1267 | .next = NULL |
| 1268 | }; | 1268 | }; |
| 1269 | MODULE_ALIAS_FS("ocfs2"); | ||
| 1269 | 1270 | ||
| 1270 | static int ocfs2_check_set_options(struct super_block *sb, | 1271 | static int ocfs2_check_set_options(struct super_block *sb, |
| 1271 | struct mount_options *options) | 1272 | struct mount_options *options) |
diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 25d715c7c87a..d8b0afde2179 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c | |||
| @@ -572,6 +572,7 @@ static struct file_system_type omfs_fs_type = { | |||
| 572 | .kill_sb = kill_block_super, | 572 | .kill_sb = kill_block_super, |
| 573 | .fs_flags = FS_REQUIRES_DEV, | 573 | .fs_flags = FS_REQUIRES_DEV, |
| 574 | }; | 574 | }; |
| 575 | MODULE_ALIAS_FS("omfs"); | ||
| 575 | 576 | ||
| 576 | static int __init init_omfs_fs(void) | 577 | static int __init init_omfs_fs(void) |
| 577 | { | 578 | { |
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index ae47fa7efb9d..75885ffde44e 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c | |||
| @@ -432,6 +432,7 @@ static struct file_system_type openprom_fs_type = { | |||
| 432 | .mount = openprom_mount, | 432 | .mount = openprom_mount, |
| 433 | .kill_sb = kill_anon_super, | 433 | .kill_sb = kill_anon_super, |
| 434 | }; | 434 | }; |
| 435 | MODULE_ALIAS_FS("openpromfs"); | ||
| 435 | 436 | ||
| 436 | static void op_inode_init_once(void *data) | 437 | static void op_inode_init_once(void *data) |
| 437 | { | 438 | { |
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c index b7a47196c8c3..66b51c0383da 100644 --- a/fs/proc/namespaces.c +++ b/fs/proc/namespaces.c | |||
| @@ -118,7 +118,7 @@ static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
| 118 | struct super_block *sb = inode->i_sb; | 118 | struct super_block *sb = inode->i_sb; |
| 119 | struct proc_inode *ei = PROC_I(inode); | 119 | struct proc_inode *ei = PROC_I(inode); |
| 120 | struct task_struct *task; | 120 | struct task_struct *task; |
| 121 | struct dentry *ns_dentry; | 121 | struct path ns_path; |
| 122 | void *error = ERR_PTR(-EACCES); | 122 | void *error = ERR_PTR(-EACCES); |
| 123 | 123 | ||
| 124 | task = get_proc_task(inode); | 124 | task = get_proc_task(inode); |
| @@ -128,14 +128,14 @@ static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
| 128 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) | 128 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) |
| 129 | goto out_put_task; | 129 | goto out_put_task; |
| 130 | 130 | ||
| 131 | ns_dentry = proc_ns_get_dentry(sb, task, ei->ns_ops); | 131 | ns_path.dentry = proc_ns_get_dentry(sb, task, ei->ns_ops); |
| 132 | if (IS_ERR(ns_dentry)) { | 132 | if (IS_ERR(ns_path.dentry)) { |
| 133 | error = ERR_CAST(ns_dentry); | 133 | error = ERR_CAST(ns_path.dentry); |
| 134 | goto out_put_task; | 134 | goto out_put_task; |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | dput(nd->path.dentry); | 137 | ns_path.mnt = mntget(nd->path.mnt); |
| 138 | nd->path.dentry = ns_dentry; | 138 | nd_jump_link(nd, &ns_path); |
| 139 | error = NULL; | 139 | error = NULL; |
| 140 | 140 | ||
| 141 | out_put_task: | 141 | out_put_task: |
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index 43098bb5723a..2e8caa62da78 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c | |||
| @@ -412,6 +412,7 @@ static struct file_system_type qnx4_fs_type = { | |||
| 412 | .kill_sb = kill_block_super, | 412 | .kill_sb = kill_block_super, |
| 413 | .fs_flags = FS_REQUIRES_DEV, | 413 | .fs_flags = FS_REQUIRES_DEV, |
| 414 | }; | 414 | }; |
| 415 | MODULE_ALIAS_FS("qnx4"); | ||
| 415 | 416 | ||
| 416 | static int __init init_qnx4_fs(void) | 417 | static int __init init_qnx4_fs(void) |
| 417 | { | 418 | { |
diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c index 57199a52a351..8d941edfefa1 100644 --- a/fs/qnx6/inode.c +++ b/fs/qnx6/inode.c | |||
| @@ -672,6 +672,7 @@ static struct file_system_type qnx6_fs_type = { | |||
| 672 | .kill_sb = kill_block_super, | 672 | .kill_sb = kill_block_super, |
| 673 | .fs_flags = FS_REQUIRES_DEV, | 673 | .fs_flags = FS_REQUIRES_DEV, |
| 674 | }; | 674 | }; |
| 675 | MODULE_ALIAS_FS("qnx6"); | ||
| 675 | 676 | ||
| 676 | static int __init init_qnx6_fs(void) | 677 | static int __init init_qnx6_fs(void) |
| 677 | { | 678 | { |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 418bdc3a57da..194113b1b11b 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
| @@ -2434,6 +2434,7 @@ struct file_system_type reiserfs_fs_type = { | |||
| 2434 | .kill_sb = reiserfs_kill_sb, | 2434 | .kill_sb = reiserfs_kill_sb, |
| 2435 | .fs_flags = FS_REQUIRES_DEV, | 2435 | .fs_flags = FS_REQUIRES_DEV, |
| 2436 | }; | 2436 | }; |
| 2437 | MODULE_ALIAS_FS("reiserfs"); | ||
| 2437 | 2438 | ||
| 2438 | MODULE_DESCRIPTION("ReiserFS journaled filesystem"); | 2439 | MODULE_DESCRIPTION("ReiserFS journaled filesystem"); |
| 2439 | MODULE_AUTHOR("Hans Reiser <reiser@namesys.com>"); | 2440 | MODULE_AUTHOR("Hans Reiser <reiser@namesys.com>"); |
diff --git a/fs/romfs/super.c b/fs/romfs/super.c index 7e8d3a80bdab..15cbc41ee365 100644 --- a/fs/romfs/super.c +++ b/fs/romfs/super.c | |||
| @@ -599,6 +599,7 @@ static struct file_system_type romfs_fs_type = { | |||
| 599 | .kill_sb = romfs_kill_sb, | 599 | .kill_sb = romfs_kill_sb, |
| 600 | .fs_flags = FS_REQUIRES_DEV, | 600 | .fs_flags = FS_REQUIRES_DEV, |
| 601 | }; | 601 | }; |
| 602 | MODULE_ALIAS_FS("romfs"); | ||
| 602 | 603 | ||
| 603 | /* | 604 | /* |
| 604 | * inode storage initialiser | 605 | * inode storage initialiser |
diff --git a/fs/sysv/super.c b/fs/sysv/super.c index a38e87bdd78d..a39938b1feea 100644 --- a/fs/sysv/super.c +++ b/fs/sysv/super.c | |||
| @@ -545,6 +545,7 @@ static struct file_system_type sysv_fs_type = { | |||
| 545 | .kill_sb = kill_block_super, | 545 | .kill_sb = kill_block_super, |
| 546 | .fs_flags = FS_REQUIRES_DEV, | 546 | .fs_flags = FS_REQUIRES_DEV, |
| 547 | }; | 547 | }; |
| 548 | MODULE_ALIAS_FS("sysv"); | ||
| 548 | 549 | ||
| 549 | static struct file_system_type v7_fs_type = { | 550 | static struct file_system_type v7_fs_type = { |
| 550 | .owner = THIS_MODULE, | 551 | .owner = THIS_MODULE, |
| @@ -553,6 +554,7 @@ static struct file_system_type v7_fs_type = { | |||
| 553 | .kill_sb = kill_block_super, | 554 | .kill_sb = kill_block_super, |
| 554 | .fs_flags = FS_REQUIRES_DEV, | 555 | .fs_flags = FS_REQUIRES_DEV, |
| 555 | }; | 556 | }; |
| 557 | MODULE_ALIAS_FS("v7"); | ||
| 556 | 558 | ||
| 557 | static int __init init_sysv_fs(void) | 559 | static int __init init_sysv_fs(void) |
| 558 | { | 560 | { |
| @@ -586,5 +588,4 @@ static void __exit exit_sysv_fs(void) | |||
| 586 | 588 | ||
| 587 | module_init(init_sysv_fs) | 589 | module_init(init_sysv_fs) |
| 588 | module_exit(exit_sysv_fs) | 590 | module_exit(exit_sysv_fs) |
| 589 | MODULE_ALIAS("v7"); | ||
| 590 | MODULE_LICENSE("GPL"); | 591 | MODULE_LICENSE("GPL"); |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index ddc0f6ae65e9..ac838b844936 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
| @@ -2174,6 +2174,7 @@ static struct file_system_type ubifs_fs_type = { | |||
| 2174 | .mount = ubifs_mount, | 2174 | .mount = ubifs_mount, |
| 2175 | .kill_sb = kill_ubifs_super, | 2175 | .kill_sb = kill_ubifs_super, |
| 2176 | }; | 2176 | }; |
| 2177 | MODULE_ALIAS_FS("ubifs"); | ||
| 2177 | 2178 | ||
| 2178 | /* | 2179 | /* |
| 2179 | * Inode slab cache constructor. | 2180 | * Inode slab cache constructor. |
diff --git a/fs/ufs/super.c b/fs/ufs/super.c index dc8e3a861d0f..329f2f53b7ed 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c | |||
| @@ -1500,6 +1500,7 @@ static struct file_system_type ufs_fs_type = { | |||
| 1500 | .kill_sb = kill_block_super, | 1500 | .kill_sb = kill_block_super, |
| 1501 | .fs_flags = FS_REQUIRES_DEV, | 1501 | .fs_flags = FS_REQUIRES_DEV, |
| 1502 | }; | 1502 | }; |
| 1503 | MODULE_ALIAS_FS("ufs"); | ||
| 1503 | 1504 | ||
| 1504 | static int __init init_ufs_fs(void) | 1505 | static int __init init_ufs_fs(void) |
| 1505 | { | 1506 | { |
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index c407121873b4..ea341cea68cb 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c | |||
| @@ -1561,6 +1561,7 @@ static struct file_system_type xfs_fs_type = { | |||
| 1561 | .kill_sb = kill_block_super, | 1561 | .kill_sb = kill_block_super, |
| 1562 | .fs_flags = FS_REQUIRES_DEV, | 1562 | .fs_flags = FS_REQUIRES_DEV, |
| 1563 | }; | 1563 | }; |
| 1564 | MODULE_ALIAS_FS("xfs"); | ||
| 1564 | 1565 | ||
| 1565 | STATIC int __init | 1566 | STATIC int __init |
| 1566 | xfs_init_zones(void) | 1567 | xfs_init_zones(void) |
