xfs
[Top] [All Lists]

Re: [PATCH 1/2 v2] convert xfs_getbmap to take formatter functions

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 1/2 v2] convert xfs_getbmap to take formatter functions
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Sat, 25 Oct 2008 15:28:46 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <20081025202743.GH28002@xxxxxxxxxxxxx>
References: <49031E81.7040807@xxxxxxxxxxx> <49032017.6070408@xxxxxxxxxxx> <20081025202743.GH28002@xxxxxxxxxxxxx>
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)
Christoph Hellwig wrote:
>> +int xfs_getbmapx_format(void __user **ap, struct getbmapx *bmv, int *filled)
>> +{
>> +    *filled = 0;
>> +    if (copy_to_user(*ap, bmv, sizeof(struct getbmapx)))
>> +            return XFS_ERROR(EFAULT);
>> +
>> +    *ap += sizeof(struct getbmapx);
>> +    *filled = 1;
>> +    return 0;
>> +}
>> +
>> +int xfs_getbmap_format(void __user **ap, struct getbmapx *bmv, int *filled)
>> +{
>> +    *filled = 0;
>> +    /* copy only getbmap portion (not getbmapx) */
>> +    if (copy_to_user(*ap, bmv, sizeof(struct getbmap)))
>> +            return XFS_ERROR(EFAULT);
>> +
>> +    *ap += sizeof(struct getbmap);
>> +    *filled = 1;
>> +    return 0;
>> +}
> 
> Probably makes sense to have these two helpers in xfs_ioctl.c, where
> they are used, similar to how fiemap is implemented.
> 

Ok, that makes sense.  Will change that & the other suggestions.

(I did run sparse once, but made changes after that and forgot to re-run...)

-Eric

<Prev in Thread] Current Thread [Next in Thread>