diff options
-rw-r--r-- | Documentation/filesystems/ubifs.txt | 7 | ||||
-rw-r--r-- | fs/ubifs/super.c | 50 | ||||
-rw-r--r-- | fs/ubifs/ubifs.h | 2 |
3 files changed, 5 insertions, 54 deletions
diff --git a/Documentation/filesystems/ubifs.txt b/Documentation/filesystems/ubifs.txt index 84da2a4ba25a..12fedb7834c6 100644 --- a/Documentation/filesystems/ubifs.txt +++ b/Documentation/filesystems/ubifs.txt | |||
@@ -79,13 +79,6 @@ Mount options | |||
79 | 79 | ||
80 | (*) == default. | 80 | (*) == default. |
81 | 81 | ||
82 | norm_unmount (*) commit on unmount; the journal is committed | ||
83 | when the file-system is unmounted so that the | ||
84 | next mount does not have to replay the journal | ||
85 | and it becomes very fast; | ||
86 | fast_unmount do not commit on unmount; this option makes | ||
87 | unmount faster, but the next mount slower | ||
88 | because of the need to replay the journal. | ||
89 | bulk_read read more in one go to take advantage of flash | 82 | bulk_read read more in one go to take advantage of flash |
90 | media that read faster sequentially | 83 | media that read faster sequentially |
91 | no_bulk_read (*) do not bulk-read | 84 | no_bulk_read (*) do not bulk-read |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index ab85eb8cce79..1182b66a5491 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -957,13 +957,16 @@ static int ubifs_parse_options(struct ubifs_info *c, char *options, | |||
957 | 957 | ||
958 | token = match_token(p, tokens, args); | 958 | token = match_token(p, tokens, args); |
959 | switch (token) { | 959 | switch (token) { |
960 | /* | ||
961 | * %Opt_fast_unmount and %Opt_norm_unmount options are ignored. | ||
962 | * We accepte them in order to be backware-compatible. But this | ||
963 | * should be removed at some point. | ||
964 | */ | ||
960 | case Opt_fast_unmount: | 965 | case Opt_fast_unmount: |
961 | c->mount_opts.unmount_mode = 2; | 966 | c->mount_opts.unmount_mode = 2; |
962 | c->fast_unmount = 1; | ||
963 | break; | 967 | break; |
964 | case Opt_norm_unmount: | 968 | case Opt_norm_unmount: |
965 | c->mount_opts.unmount_mode = 1; | 969 | c->mount_opts.unmount_mode = 1; |
966 | c->fast_unmount = 0; | ||
967 | break; | 970 | break; |
968 | case Opt_bulk_read: | 971 | case Opt_bulk_read: |
969 | c->mount_opts.bulk_read = 2; | 972 | c->mount_opts.bulk_read = 2; |
@@ -1359,7 +1362,6 @@ static int mount_ubifs(struct ubifs_info *c) | |||
1359 | c->uuid[4], c->uuid[5], c->uuid[6], c->uuid[7], | 1362 | c->uuid[4], c->uuid[5], c->uuid[6], c->uuid[7], |
1360 | c->uuid[8], c->uuid[9], c->uuid[10], c->uuid[11], | 1363 | c->uuid[8], c->uuid[9], c->uuid[10], c->uuid[11], |
1361 | c->uuid[12], c->uuid[13], c->uuid[14], c->uuid[15]); | 1364 | c->uuid[12], c->uuid[13], c->uuid[14], c->uuid[15]); |
1362 | dbg_msg("fast unmount: %d", c->fast_unmount); | ||
1363 | dbg_msg("big_lpt %d", c->big_lpt); | 1365 | dbg_msg("big_lpt %d", c->big_lpt); |
1364 | dbg_msg("log LEBs: %d (%d - %d)", | 1366 | dbg_msg("log LEBs: %d (%d - %d)", |
1365 | c->log_lebs, UBIFS_LOG_LNUM, c->log_last); | 1367 | c->log_lebs, UBIFS_LOG_LNUM, c->log_last); |
@@ -1616,38 +1618,6 @@ out: | |||
1616 | } | 1618 | } |
1617 | 1619 | ||
1618 | /** | 1620 | /** |
1619 | * commit_on_unmount - commit the journal when un-mounting. | ||
1620 | * @c: UBIFS file-system description object | ||
1621 | * | ||
1622 | * This function is called during un-mounting and re-mounting, and it commits | ||
1623 | * the journal unless the "fast unmount" mode is enabled. | ||
1624 | */ | ||
1625 | static void commit_on_unmount(struct ubifs_info *c) | ||
1626 | { | ||
1627 | long long bud_bytes; | ||
1628 | |||
1629 | if (!c->fast_unmount) { | ||
1630 | dbg_gen("skip committing - fast unmount enabled"); | ||
1631 | return; | ||
1632 | } | ||
1633 | |||
1634 | /* | ||
1635 | * This function is called before the background thread is stopped, so | ||
1636 | * we may race with ongoing commit, which means we have to take | ||
1637 | * @c->bud_lock to access @c->bud_bytes. | ||
1638 | */ | ||
1639 | spin_lock(&c->buds_lock); | ||
1640 | bud_bytes = c->bud_bytes; | ||
1641 | spin_unlock(&c->buds_lock); | ||
1642 | |||
1643 | if (bud_bytes) { | ||
1644 | dbg_gen("run commit"); | ||
1645 | ubifs_run_commit(c); | ||
1646 | } else | ||
1647 | dbg_gen("journal is empty, do not run commit"); | ||
1648 | } | ||
1649 | |||
1650 | /** | ||
1651 | * ubifs_remount_ro - re-mount in read-only mode. | 1621 | * ubifs_remount_ro - re-mount in read-only mode. |
1652 | * @c: UBIFS file-system description object | 1622 | * @c: UBIFS file-system description object |
1653 | * | 1623 | * |
@@ -1661,7 +1631,6 @@ static void ubifs_remount_ro(struct ubifs_info *c) | |||
1661 | ubifs_assert(!c->need_recovery); | 1631 | ubifs_assert(!c->need_recovery); |
1662 | ubifs_assert(!(c->vfs_sb->s_flags & MS_RDONLY)); | 1632 | ubifs_assert(!(c->vfs_sb->s_flags & MS_RDONLY)); |
1663 | 1633 | ||
1664 | commit_on_unmount(c); | ||
1665 | mutex_lock(&c->umount_mutex); | 1634 | mutex_lock(&c->umount_mutex); |
1666 | if (c->bgt) { | 1635 | if (c->bgt) { |
1667 | kthread_stop(c->bgt); | 1636 | kthread_stop(c->bgt); |
@@ -2077,15 +2046,6 @@ out_close: | |||
2077 | 2046 | ||
2078 | static void ubifs_kill_sb(struct super_block *sb) | 2047 | static void ubifs_kill_sb(struct super_block *sb) |
2079 | { | 2048 | { |
2080 | struct ubifs_info *c = sb->s_fs_info; | ||
2081 | |||
2082 | /* | ||
2083 | * We do 'commit_on_unmount()' here instead of 'ubifs_put_super()' | ||
2084 | * in order to be outside BKL. | ||
2085 | */ | ||
2086 | if (sb->s_root && !(sb->s_flags & MS_RDONLY)) | ||
2087 | commit_on_unmount(c); | ||
2088 | /* The un-mount routine is actually done in put_super() */ | ||
2089 | generic_shutdown_super(sb); | 2049 | generic_shutdown_super(sb); |
2090 | } | 2050 | } |
2091 | 2051 | ||
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 535f87426791..039a68bee29a 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -961,7 +961,6 @@ struct ubifs_debug_info; | |||
961 | * @cs_lock: commit state lock | 961 | * @cs_lock: commit state lock |
962 | * @cmt_wq: wait queue to sleep on if the log is full and a commit is running | 962 | * @cmt_wq: wait queue to sleep on if the log is full and a commit is running |
963 | * | 963 | * |
964 | * @fast_unmount: do not run journal commit before un-mounting | ||
965 | * @big_lpt: flag that LPT is too big to write whole during commit | 964 | * @big_lpt: flag that LPT is too big to write whole during commit |
966 | * @no_chk_data_crc: do not check CRCs when reading data nodes (except during | 965 | * @no_chk_data_crc: do not check CRCs when reading data nodes (except during |
967 | * recovery) | 966 | * recovery) |
@@ -1202,7 +1201,6 @@ struct ubifs_info { | |||
1202 | spinlock_t cs_lock; | 1201 | spinlock_t cs_lock; |
1203 | wait_queue_head_t cmt_wq; | 1202 | wait_queue_head_t cmt_wq; |
1204 | 1203 | ||
1205 | unsigned int fast_unmount:1; | ||
1206 | unsigned int big_lpt:1; | 1204 | unsigned int big_lpt:1; |
1207 | unsigned int no_chk_data_crc:1; | 1205 | unsigned int no_chk_data_crc:1; |
1208 | unsigned int bulk_read:1; | 1206 | unsigned int bulk_read:1; |