xfs
[Top] [All Lists]

Re: [PATCH] Move attr log alloc size calculator to another function.

To: Niv Sardi <xaiki@xxxxxxx>
Subject: Re: [PATCH] Move attr log alloc size calculator to another function.
From: Timothy Shimmin <tes@xxxxxxx>
Date: Wed, 02 Jul 2008 16:38:00 +1000
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <nccprq31nz8.fsf@xxxxxxx>
References: <1214196150-5427-1-git-send-email-xaiki@xxxxxxx> <1214196150-5427-2-git-send-email-xaiki@xxxxxxx> <20080626082438.GB23954@xxxxxxxxxxxxx> <nccprq31nz8.fsf@xxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)
Niv Sardi wrote:
> Attached updated patch.
> 
> Christoph Hellwig <hch@xxxxxxxxxxxxx> writes:
>> On Mon, Jun 23, 2008 at 02:42:27PM +1000, Niv Sardi wrote:
>>> From: Niv Sardi <xaiki@xxxxxxxxxx>
>>>
>>> We will need that to be able to calculate the size of log we need for
>>> a specific attr (for parent pointers in create). We need the local so
>>> that we can fail if we run into ENOSPC when trying to alloc blocks
> 
> Updated Comments, structs instead of typdefs
>  
>>> Signed-off-by: Niv Sardi <xaiki@xxxxxxx>
>>> ---
>>>  fs/xfs/xfs_attr.c |   78 
>>> +++++++++++++++++++++++++++++++---------------------
>>>  fs/xfs/xfs_attr.h |    2 +-
>>>  2 files changed, 47 insertions(+), 33 deletions(-)
>>>
>>> diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
>>> index e58f321..0d19e90 100644
>>> --- a/fs/xfs/xfs_attr.c
>>> +++ b/fs/xfs/xfs_attr.c
>>> @@ -185,6 +185,43 @@ xfs_attr_get(
>>>  }
>>>  
>>>  int
>>> +xfs_attr_calc_size(
>> should be marked STATIC,
> 
> The whole idea is to be able to use it in xfs_create().
>
I guess in isolation it just looks weird as the only caller is within
the file.
In isolation it would make sense to be STATIC.
(Then again, in isolation, it looks strange returning the "local" parameter -
 as you said, you need it elsewhere).
And I guess, Christoph's point was that it could go in as an isolated
cleanup patch if it was made static.

--Tim


<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH] Move attr log alloc size calculator to another function., Timothy Shimmin <=