linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Aristeu Rozanski <aris@redhat.com>
Cc: linux-kernel@vger.kernel.org, Li Zefan <lizefan@huawei.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH v2] fs: xattr: rewrite simple_xattr_set()
Date: Wed, 31 Oct 2012 14:11:04 -0700	[thread overview]
Message-ID: <20121031211104.GY2945@htj.dyndns.org> (raw)
In-Reply-To: <20121025183018.GI14085@redhat.com>

Hello, sorry about the delay.

Just one nitpick.

On Thu, Oct 25, 2012 at 02:30:18PM -0400, Aristeu Rozanski wrote:
> +static int __simple_xattr_remove(struct simple_xattrs *xattrs,
> +				 const char *name)
> +{
> +	struct simple_xattr *xattr;
> +
> +	xattr = __find_xattr(xattrs, name);
>  	if (xattr) {
> +		list_del(&xattr->list);
>  		kfree(xattr->name);
>  		kfree(xattr);
> +		return 0;
>  	}
> -	return err;
>  
> +	return -ENODATA;
> +}
> +
> +/*
> + * xattr REMOVE operation for in-memory/pseudo filesystems
> + */
> +int simple_xattr_remove(struct simple_xattrs *xattrs, const char *name)
> +{
> +	int rc;
> +
> +	spin_lock(&xattrs->lock);
> +	rc = __simple_xattr_remove(xattrs, name);
> +	spin_unlock(&xattrs->lock);
> +
> +	return rc;

Do we need these two functions?  Can't you either collapse
__simple_xttar_remove() into simple_xattr_remove() or just call
__simple_xattr_remove() directly from simple_xattr_set() with locking
handled there?  Also, why doesn't simple_xattr_remove() have static?

Thanks.

-- 
tejun

      reply	other threads:[~2012-10-31 21:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25 15:26 [PATCH] fs: xattr: rewrite simple_xattr_set() Aristeu Rozanski
2012-10-25 17:33 ` Tejun Heo
2012-10-25 17:54   ` Aristeu Rozanski
2012-10-25 17:59     ` Tejun Heo
2012-10-25 18:12       ` Aristeu Rozanski
2012-10-25 18:30       ` [PATCH v2] " Aristeu Rozanski
2012-10-31 21:11         ` Tejun Heo [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=20121031211104.GY2945@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=aris@redhat.com \
    --cc=hughd@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).