[Ocfs2-devel] [PATCH 3/5] Quota support for disabling inline-data feature

Joel Becker Joel.Becker at oracle.com
Tue Oct 20 12:08:52 PDT 2009


On Wed, Oct 14, 2009 at 08:08:57PM +0200, Jan Kara wrote:
> When disabling inline-data feature, space occupied by files changes
> and thus we have to update quota information accordingly.
> 
> Signed-off-by: Jan Kara <jack at suse.cz>
> ---
>  tunefs.ocfs2/feature_inline_data.c |   42 +++++++++++++++++++++++++++++++----
>  1 file changed, 38 insertions(+), 6 deletions(-)
> 
> diff --git a/tunefs.ocfs2/feature_inline_data.c b/tunefs.ocfs2/feature_inline_data.c
> index 77ddb42..9e1d07f 100644
> --- a/tunefs.ocfs2/feature_inline_data.c
> +++ b/tunefs.ocfs2/feature_inline_data.c
> @@ -170,31 +170,63 @@ static void empty_inline_data_context(struct inline_data_context *ctxt)
>  static errcode_t expand_inline_data(ocfs2_filesys *fs,
>  				    struct inline_data_context *ctxt)
>  {
> -	errcode_t ret = 0;
> +	errcode_t ret = 0, err;
>  	struct list_head *pos;
>  	struct inline_data_inode *idi;
>  	ocfs2_cached_inode *ci = NULL;
>  	struct tools_progress *prog;
> +	struct ocfs2_super_block *super = OCFS2_RAW_SB(fs->fs_super);
> +	ocfs2_quota_hash *usrhash = NULL, *grphash = NULL;
> +	uint32_t uid, gid;
> +	long long change;
>  
>  	prog = tools_progress_start("Expanding inline files", "expanding",
>  				    ctxt->more_clusters);
>  	if (!ctxt->prog)
>  		return TUNEFS_ET_NO_MEMORY;
>  
> +	ret = ocfs2_load_fs_quota_info(fs);
> +	if (ret)
> +		goto out;
> +
> +	ret = ocfs2_init_quota_change(fs, &usrhash, &grphash);
> +	if (ret)
> +		goto out;

	This is so much nicer!

Joel

-- 

"You don't make the poor richer by making the rich poorer."
	- Sir Winston Churchill

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-devel mailing list