Re: [PATCH 5 of 11] XFS: Use SEEK_{SET, CUR, END} instead of hardcoded values
From: David Chinner
Date: Tue Sep 19 2006 - 00:02:17 EST
On Mon, Sep 18, 2006 at 11:30:35AM +0100, David Howells wrote:
> David Chinner <dgc@xxxxxxx> wrote:
>
> > The hard coded values used in xfs_change_file_space() are documented as part
> > of the API to the userspace functions that use this interface in xfsctl(3).
>
> Hmmm... that's a good point. I think you're right on this account, and so the
> comments in:
>
> case 0: /*SEEK_SET*/
> break;
> case 1: /*SEEK_CUR*/
> bf->l_start += offset;
> break;
> case 2: /*SEEK_END*/
> bf->l_start += ip->i_d.di_size;
> break;
>
> should be stripped off as they are not exactly correct.
Sure, they're not _exactly_ the same as seek semantics, but the
comment is informative enough to tell you what the magic numbers
are supposed to mean as you read the code.
If you really want to strip these out these comments, can you please
replace them with a new comment that documents the magic number
behaviour?
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/