linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: "Myklebust, Trond" <Trond.Myklebust@netapp.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"J. Bruce Fields" <bfields@fieldses.org>
Subject: Re: [PATCH 1/2] rpc_pipe: export simple_dentry_operations and have rpc_pipefs use it
Date: Mon, 1 Jul 2013 12:22:01 -0400	[thread overview]
Message-ID: <20130701122201.6a8fc966@tlielax.poochiereds.net> (raw)
In-Reply-To: <1372174611.5968.28.camel@leira.trondhjem.org>

On Tue, 25 Jun 2013 15:36:54 +0000
"Myklebust, Trond" <Trond.Myklebust@netapp.com> wrote:

> On Mon, 2013-06-24 at 21:05 -0400, Jeff Layton wrote:
> > ...instead of replicating a copy of them.
> > 
> > Signed-off-by: Jeff Layton <jlayton@redhat.com>
> > ---
> >  fs/libfs.c            |  9 +++++----
> >  include/linux/fs.h    |  1 +
> >  net/sunrpc/rpc_pipe.c | 11 +----------
> >  3 files changed, 7 insertions(+), 14 deletions(-)
> > 
> 
> Can you please get an ACK from Al on this patch.
> 
> Cheers
>   Trond
> 

Al, could you weigh in on this? The only real change to generic VFS
code is that I'm exporting simple_dentry_operations here.

Thanks,
Jeff

> > diff --git a/fs/libfs.c b/fs/libfs.c
> > index 916da8c..69793f7 100644
> > --- a/fs/libfs.c
> > +++ b/fs/libfs.c
> > @@ -49,16 +49,16 @@ static int simple_delete_dentry(const struct dentry *dentry)
> >  	return 1;
> >  }
> >  
> > +const struct dentry_operations simple_dentry_operations = {
> > +	.d_delete = simple_delete_dentry,
> > +};
> > +
> >  /*
> >   * Lookup the data. This is trivial - if the dentry didn't already
> >   * exist, we know it is negative.  Set d_op to delete negative dentries.
> >   */
> >  struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
> >  {
> > -	static const struct dentry_operations simple_dentry_operations = {
> > -		.d_delete = simple_delete_dentry,
> > -	};
> > -
> >  	if (dentry->d_name.len > NAME_MAX)
> >  		return ERR_PTR(-ENAMETOOLONG);
> >  	d_set_d_op(dentry, &simple_dentry_operations);
> > @@ -987,6 +987,7 @@ EXPORT_SYMBOL(simple_write_begin);
> >  EXPORT_SYMBOL(simple_write_end);
> >  EXPORT_SYMBOL(simple_dir_inode_operations);
> >  EXPORT_SYMBOL(simple_dir_operations);
> > +EXPORT_SYMBOL(simple_dentry_operations);
> >  EXPORT_SYMBOL(simple_empty);
> >  EXPORT_SYMBOL(simple_fill_super);
> >  EXPORT_SYMBOL(simple_getattr);
> > diff --git a/include/linux/fs.h b/include/linux/fs.h
> > index 65c2be2..1d21364 100644
> > --- a/include/linux/fs.h
> > +++ b/include/linux/fs.h
> > @@ -2546,6 +2546,7 @@ extern int simple_write_end(struct file *file, struct address_space *mapping,
> >  extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags);
> >  extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
> >  extern const struct file_operations simple_dir_operations;
> > +extern const struct dentry_operations simple_dentry_operations;
> >  extern const struct inode_operations simple_dir_inode_operations;
> >  struct tree_descr { char *name; const struct file_operations *ops; int mode; };
> >  struct dentry *d_alloc_name(struct dentry *, const char *);
> > diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
> > index a816b3a..99cd7db 100644
> > --- a/net/sunrpc/rpc_pipe.c
> > +++ b/net/sunrpc/rpc_pipe.c
> > @@ -471,15 +471,6 @@ struct rpc_filelist {
> >  	umode_t mode;
> >  };
> >  
> > -static int rpc_delete_dentry(const struct dentry *dentry)
> > -{
> > -	return 1;
> > -}
> > -
> > -static const struct dentry_operations rpc_dentry_operations = {
> > -	.d_delete = rpc_delete_dentry,
> > -};
> > -
> >  static struct inode *
> >  rpc_get_inode(struct super_block *sb, umode_t mode)
> >  {
> > @@ -668,7 +659,7 @@ static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent,
> >  	}
> >  	if (dentry->d_inode == NULL) {
> >  		if (!dentry->d_op)
> > -			d_set_d_op(dentry, &rpc_dentry_operations);
> > +			d_set_d_op(dentry, &simple_dentry_operations);
> >  		return dentry;
> >  	}
> >  	dput(dentry);
> 
> 


-- 
Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2013-07-01 16:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25  1:05 [PATCH 0/2] rpc_pipe: clean up how dentry operations get set in rpc_pipefs Jeff Layton
2013-06-25  1:05 ` [PATCH 1/2] rpc_pipe: export simple_dentry_operations and have rpc_pipefs use it Jeff Layton
2013-06-25 15:36   ` Myklebust, Trond
2013-07-01 16:22     ` Jeff Layton [this message]
2013-07-02 15:29       ` Jeff Layton
2013-06-25  1:05 ` [PATCH 2/2] rpc_pipe: set dentry operations at d_alloc time Jeff Layton
2013-06-25 11:00   ` Jeff Layton
2013-07-02 17:00 ` [PATCH v2] " Jeff Layton
2013-07-14 14:00   ` Al Viro
2013-07-15 10:43     ` Jeff Layton

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=20130701122201.6a8fc966@tlielax.poochiereds.net \
    --to=jlayton@redhat.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --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).