[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090408132727.GB5957@infradead.org>
Date: Wed, 8 Apr 2009 09:27:28 -0400
From: Christoph Hellwig <hch@...radead.org>
To: Oleg Drokin <green@...uxhacker.ru>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Separate out common fstatat code
On Wed, Apr 08, 2009 at 09:54:11AM +0400, Oleg Drokin wrote:
> Hello!
>
> It seems we have way too many copy&pasted fstatat code elsewhere which
> might not have been a problem until now, but with all the changes
> with "stat light" now and who knows what other additions in there in
> the future, it really helps if we have only one copy of the code.
>
> Hence this patch adds fstatat_common() that fills struct kstat with
> proper values and does all the AT flags parsing that's needed and
> then calls all the proper underlying functions, what's left to the
> caller now is to only copy filled out kstat buffer to the final
> destination.
Looks good and like a merge candidate even without any statlite-like
syscall.
But I would call it vfs_fstatat, not fstatat_common.
> --- linux-2.6.29.orig/arch/arm/kernel/sys_oabi-compat.c 2009-04-08 01:31:41.000000000 -0400
> +++ linux-2.6.29/arch/arm/kernel/sys_oabi-compat.c 2009-04-08 01:41:59.000000000 -0400
> @@ -176,20 +176,12 @@
> int flag)
> {
> struct kstat stat;
> + int error;
>
> + error = fstatat_common(dfd, filename, &stat, flag);
> if (!error)
> + error = cp_oldabi_stat64(&stat, statbuf);
>
> return error;
Also a
error = vfs_fstatat(dfd, filename, &stat, flag);
if (error)
return error;
return cp_oldabi_stat64(&stat, statbuf);
would looks slightly cleaner than that.
(Same for the various other duplicates)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists