From 25435e5ed611f310dda889940cbc4c45b3ecd9ec Mon Sep 17 00:00:00 2001 From: Abhi Das Date: Wed, 18 Mar 2015 12:04:37 -0500 Subject: gfs2: allow quota_check and inplace_reserve to return available blocks struct gfs2_alloc_parms is passed to gfs2_quota_check() and gfs2_inplace_reserve() with ap->target containing the number of blocks being requested for allocation in the current operation. We add a new field to struct gfs2_alloc_parms called 'allowed'. gfs2_quota_check() and gfs2_inplace_reserve() return the max blocks allowed by quota and the max blocks allowed by the chosen rgrp respectively in 'allowed'. A new field 'min_target', when non-zero, tells gfs2_quota_check() and gfs2_inplace_reserve() to not return -EDQUOT/-ENOSPC when there are atleast 'min_target' blocks allowable/available. The assumption is that the caller is ok with just 'min_target' blocks and will likely proceed with allocating them. Signed-off-by: Abhi Das Signed-off-by: Bob Peterson Acked-by: Steven Whitehouse --- fs/gfs2/incore.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs/gfs2/incore.h') diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 3a4ea50c9113..58b75abf6ab2 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -302,7 +302,9 @@ struct gfs2_blkreserv { */ struct gfs2_alloc_parms { u64 target; + u32 min_target; u32 aflags; + u64 allowed; }; enum { -- cgit v1.2.3-59-g8ed1b