linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Oleg Drokin <green@linuxhacker.ru>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Separate out common fstatat code
Date: Wed, 8 Apr 2009 09:27:28 -0400	[thread overview]
Message-ID: <20090408132727.GB5957@infradead.org> (raw)
In-Reply-To: <20090408055411.GA1615245@fiona.linuxhacker.ru>

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)

      reply	other threads:[~2009-04-08 13:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08  5:54 [PATCH] Separate out common fstatat code Oleg Drokin
2009-04-08 13:27 ` Christoph Hellwig [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090408132727.GB5957@infradead.org \
    --to=hch@infradead.org \
    --cc=green@linuxhacker.ru \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).