diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-06-29 09:55:02 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-07-19 02:53:52 -0400 |
commit | 07e19dff63e3d5d6500d831e36554ac9b1b0560e (patch) | |
tree | e921a551f3f7aa3b38fa253829efb735e2421fbb | |
parent | 39274a1e8dd18d47e7ba76a90adc384f14f20a4f (diff) |
UBIFS: remove mst_mutex
The 'mst_mutex' is not needed since because 'ubifs_write_master()' is only
called on the mount path and commit path. The mount path is sequential and
there is no parallelism, and the commit path is also serialized - there is only
one commit going on at a time.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r-- | fs/ubifs/commit.c | 2 | ||||
-rw-r--r-- | fs/ubifs/master.c | 7 | ||||
-rw-r--r-- | fs/ubifs/super.c | 1 | ||||
-rw-r--r-- | fs/ubifs/ubifs.h | 2 |
4 files changed, 3 insertions, 9 deletions
diff --git a/fs/ubifs/commit.c b/fs/ubifs/commit.c index ff8229340cd5..aa13ad053b14 100644 --- a/fs/ubifs/commit.c +++ b/fs/ubifs/commit.c | |||
@@ -174,7 +174,6 @@ static int do_commit(struct ubifs_info *c) | |||
174 | if (err) | 174 | if (err) |
175 | goto out; | 175 | goto out; |
176 | 176 | ||
177 | mutex_lock(&c->mst_mutex); | ||
178 | c->mst_node->cmt_no = cpu_to_le64(c->cmt_no); | 177 | c->mst_node->cmt_no = cpu_to_le64(c->cmt_no); |
179 | c->mst_node->log_lnum = cpu_to_le32(new_ltail_lnum); | 178 | c->mst_node->log_lnum = cpu_to_le32(new_ltail_lnum); |
180 | c->mst_node->root_lnum = cpu_to_le32(zroot.lnum); | 179 | c->mst_node->root_lnum = cpu_to_le32(zroot.lnum); |
@@ -204,7 +203,6 @@ static int do_commit(struct ubifs_info *c) | |||
204 | else | 203 | else |
205 | c->mst_node->flags &= ~cpu_to_le32(UBIFS_MST_NO_ORPHS); | 204 | c->mst_node->flags &= ~cpu_to_le32(UBIFS_MST_NO_ORPHS); |
206 | err = ubifs_write_master(c); | 205 | err = ubifs_write_master(c); |
207 | mutex_unlock(&c->mst_mutex); | ||
208 | if (err) | 206 | if (err) |
209 | goto out; | 207 | goto out; |
210 | 208 | ||
diff --git a/fs/ubifs/master.c b/fs/ubifs/master.c index ab83ace9910a..1a4bb9e8b3b8 100644 --- a/fs/ubifs/master.c +++ b/fs/ubifs/master.c | |||
@@ -352,10 +352,9 @@ int ubifs_read_master(struct ubifs_info *c) | |||
352 | * ubifs_write_master - write master node. | 352 | * ubifs_write_master - write master node. |
353 | * @c: UBIFS file-system description object | 353 | * @c: UBIFS file-system description object |
354 | * | 354 | * |
355 | * This function writes the master node. The caller has to take the | 355 | * This function writes the master node. Returns zero in case of success and a |
356 | * @c->mst_mutex lock before calling this function. Returns zero in case of | 356 | * negative error code in case of failure. The master node is written twice to |
357 | * success and a negative error code in case of failure. The master node is | 357 | * enable recovery. |
358 | * written twice to enable recovery. | ||
359 | */ | 358 | */ |
360 | int ubifs_write_master(struct ubifs_info *c) | 359 | int ubifs_write_master(struct ubifs_info *c) |
361 | { | 360 | { |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index bed5ebfb7c71..106bf20629ce 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -1963,7 +1963,6 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi) | |||
1963 | mutex_init(&c->lp_mutex); | 1963 | mutex_init(&c->lp_mutex); |
1964 | mutex_init(&c->tnc_mutex); | 1964 | mutex_init(&c->tnc_mutex); |
1965 | mutex_init(&c->log_mutex); | 1965 | mutex_init(&c->log_mutex); |
1966 | mutex_init(&c->mst_mutex); | ||
1967 | mutex_init(&c->umount_mutex); | 1966 | mutex_init(&c->umount_mutex); |
1968 | mutex_init(&c->bu_mutex); | 1967 | mutex_init(&c->bu_mutex); |
1969 | mutex_init(&c->write_reserve_mutex); | 1968 | mutex_init(&c->write_reserve_mutex); |
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 977a01bf1720..c4fe900c67ab 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -1049,7 +1049,6 @@ struct ubifs_debug_info; | |||
1049 | * | 1049 | * |
1050 | * @mst_node: master node | 1050 | * @mst_node: master node |
1051 | * @mst_offs: offset of valid master node | 1051 | * @mst_offs: offset of valid master node |
1052 | * @mst_mutex: protects the master node area, @mst_node, and @mst_offs | ||
1053 | * | 1052 | * |
1054 | * @max_bu_buf_len: maximum bulk-read buffer length | 1053 | * @max_bu_buf_len: maximum bulk-read buffer length |
1055 | * @bu_mutex: protects the pre-allocated bulk-read buffer and @c->bu | 1054 | * @bu_mutex: protects the pre-allocated bulk-read buffer and @c->bu |
@@ -1290,7 +1289,6 @@ struct ubifs_info { | |||
1290 | 1289 | ||
1291 | struct ubifs_mst_node *mst_node; | 1290 | struct ubifs_mst_node *mst_node; |
1292 | int mst_offs; | 1291 | int mst_offs; |
1293 | struct mutex mst_mutex; | ||
1294 | 1292 | ||
1295 | int max_bu_buf_len; | 1293 | int max_bu_buf_len; |
1296 | struct mutex bu_mutex; | 1294 | struct mutex bu_mutex; |