Re: [PATCH 08/11] quota: make per-sb dq_data_lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 05-10-10 22:20:24, Dmitry Monakhov wrote:
> Currently dq_data_lock is global, which is bad for scalability.
> In fact different super_blocks has no shared quota's data.
> So we may simply convert global lock to per-sb lock.
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@xxxxxxxxx>
...
> @@ -657,9 +657,9 @@ static int ocfs2_write_dquot(struct dquot *dquot)
>  		mlog_errno(status);
>  		goto out;
>  	}
> -	mutex_lock(&dq_opt(dqopt)->dqio_mutex);
> +	mutex_lock(&dq_opt(dquot)->dqio_mutex);
>  	status = ocfs2_local_write_dquot(dquot);
> -	mutex_unlock(&dq_opt(dqopt)->dqio_mutex);
> +	mutex_unlock(&dq_opt(dquot)->dqio_mutex);
>  	ocfs2_commit_trans(osb, handle);
  I guess this hunk belongs to the first patch.

> diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c
> index dc78764..c078799 100644
> --- a/fs/ocfs2/quota_local.c
> +++ b/fs/ocfs2/quota_local.c
> @@ -288,14 +288,15 @@ static void olq_update_info(struct buffer_head *bh, void *private)
>  	struct mem_dqinfo *info = private;
>  	struct ocfs2_mem_dqinfo *oinfo = info->dqi_priv;
>  	struct ocfs2_local_disk_dqinfo *ldinfo;
> +	struct super_block *sb = oinfo->dqi_gqinode->i_sb;
  You can directly store struct quota_info *, here.

>  
>  	ldinfo = (struct ocfs2_local_disk_dqinfo *)(bh->b_data +
>  						OCFS2_LOCAL_INFO_OFF);
> -	spin_lock(&dq_data_lock);
> +	spin_lock(&sb_dqopt(sb)->dq_data_lock);
>  	ldinfo->dqi_flags = cpu_to_le32(info->dqi_flags & DQF_MASK);
>  	ldinfo->dqi_chunks = cpu_to_le32(oinfo->dqi_chunks);
>  	ldinfo->dqi_blocks = cpu_to_le32(oinfo->dqi_blocks);
> -	spin_unlock(&dq_data_lock);
> +	spin_unlock(&sb_dqopt(sb)->dq_data_lock);
>  }

									Honza
-- 
Jan Kara <jack@xxxxxxx>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux