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>
This commit is contained in:
Artem Bityutskiy 2014-06-29 16:55:02 +03:00
parent 39274a1e8d
commit 07e19dff63
4 changed files with 3 additions and 9 deletions

View File

@ -174,7 +174,6 @@ static int do_commit(struct ubifs_info *c)
if (err) if (err)
goto out; goto out;
mutex_lock(&c->mst_mutex);
c->mst_node->cmt_no = cpu_to_le64(c->cmt_no); c->mst_node->cmt_no = cpu_to_le64(c->cmt_no);
c->mst_node->log_lnum = cpu_to_le32(new_ltail_lnum); c->mst_node->log_lnum = cpu_to_le32(new_ltail_lnum);
c->mst_node->root_lnum = cpu_to_le32(zroot.lnum); c->mst_node->root_lnum = cpu_to_le32(zroot.lnum);
@ -204,7 +203,6 @@ static int do_commit(struct ubifs_info *c)
else else
c->mst_node->flags &= ~cpu_to_le32(UBIFS_MST_NO_ORPHS); c->mst_node->flags &= ~cpu_to_le32(UBIFS_MST_NO_ORPHS);
err = ubifs_write_master(c); err = ubifs_write_master(c);
mutex_unlock(&c->mst_mutex);
if (err) if (err)
goto out; goto out;

View File

@ -352,10 +352,9 @@ int ubifs_read_master(struct ubifs_info *c)
* ubifs_write_master - write master node. * ubifs_write_master - write master node.
* @c: UBIFS file-system description object * @c: UBIFS file-system description object
* *
* This function writes the master node. The caller has to take the * This function writes the master node. Returns zero in case of success and a
* @c->mst_mutex lock before calling this function. Returns zero in case of * negative error code in case of failure. The master node is written twice to
* success and a negative error code in case of failure. The master node is * enable recovery.
* written twice to enable recovery.
*/ */
int ubifs_write_master(struct ubifs_info *c) int ubifs_write_master(struct ubifs_info *c)
{ {

View File

@ -1963,7 +1963,6 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi)
mutex_init(&c->lp_mutex); mutex_init(&c->lp_mutex);
mutex_init(&c->tnc_mutex); mutex_init(&c->tnc_mutex);
mutex_init(&c->log_mutex); mutex_init(&c->log_mutex);
mutex_init(&c->mst_mutex);
mutex_init(&c->umount_mutex); mutex_init(&c->umount_mutex);
mutex_init(&c->bu_mutex); mutex_init(&c->bu_mutex);
mutex_init(&c->write_reserve_mutex); mutex_init(&c->write_reserve_mutex);

View File

@ -1049,7 +1049,6 @@ struct ubifs_debug_info;
* *
* @mst_node: master node * @mst_node: master node
* @mst_offs: offset of valid master node * @mst_offs: offset of valid master node
* @mst_mutex: protects the master node area, @mst_node, and @mst_offs
* *
* @max_bu_buf_len: maximum bulk-read buffer length * @max_bu_buf_len: maximum bulk-read buffer length
* @bu_mutex: protects the pre-allocated bulk-read buffer and @c->bu * @bu_mutex: protects the pre-allocated bulk-read buffer and @c->bu
@ -1290,7 +1289,6 @@ struct ubifs_info {
struct ubifs_mst_node *mst_node; struct ubifs_mst_node *mst_node;
int mst_offs; int mst_offs;
struct mutex mst_mutex;
int max_bu_buf_len; int max_bu_buf_len;
struct mutex bu_mutex; struct mutex bu_mutex;