linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] Implement renaming for debugfs
Date: Mon, 7 May 2007 09:28:30 -0700	[thread overview]
Message-ID: <20070507162830.GA23216@kroah.com> (raw)
In-Reply-To: <20070504141428.GA20516@duck.suse.cz>

On Fri, May 04, 2007 at 04:14:28PM +0200, Jan Kara wrote:
> On Thu 03-05-07 17:16:02, Greg KH wrote:
> > On Thu, May 03, 2007 at 11:54:52AM +0200, Jan Kara wrote:
> > > On Tue 01-05-07 20:26:27, Greg KH wrote:
> > > > On Mon, Apr 30, 2007 at 07:55:36PM +0200, Jan Kara wrote:
> > > > >   Hello,
> > > > > 
> > > > >   attached patch implements renaming for debugfs. I was asked for this
> > > > > feature by WLAN guys and I guess it makes sence (they have some debug info
> > > > > in the directory identified by interface name and that can change...).
> > > > > Could someone have a look at what I wrote whether it looks reasonable?
> > > > > Thanks.
> > > > > 
> > > > > 								Honza
> > > > > 
> > > > > -- 
> > > > > Jan Kara <jack@suse.cz>
> > > > > SuSE CR Labs
> > > > 
> > > > > Implement debugfs_rename() to allow renaming files/directories in debugfs.
> > > > 
> > > > I think you are going to need more infrastructure here, the caller
> > > > doesn't want to have to allocate a new dentry themselves, they just want
> > > > to pass in the new filename :)
> > >   Actually, I wanted the call to be in the spirit of other debugfs calls.
> > > So we have for example:
> > > void debugfs_remove(struct dentry *dentry)
> > 
> > That is because 'debugfs_create' returns a dentry.
> > 
> > > struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
> > > etc.
> > 
> > Same here, you already have a dentry to place this directory into, _and_
> > all the user needs to provide is a name for the new directory.  They
> > don't ever create a dentry themselves, which is what your function
> > required them to do.
> > 
> > Try using your function and you'll see what I mean :)
>   I've tried it when testing the function :). The code looked like:
> dir1 = debugfs_create_dir("dir1", NULL);
> dir2 = debugfs_create_dir("dir2", NULL);
> file1 = debugfs_create_file("file1", 0644, dir1, NULL, NULL);
> file2 = debugfs_rename(dir1, file1, dir2, "new_name");
>   No new dentries needed to be created...

Ah, ok, sorry, that makes more sense, I missed that the dentry's passed
in was the new directory location.  This will still work if you use the
same directory like:
	debugfs_rename(dir1, file1, dir1, "new_name");

right?

thanks,

greg k-h

  reply	other threads:[~2007-05-07 16:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30 17:55 [PATCH] Implement renaming for debugfs Jan Kara
2007-05-02  3:26 ` Greg KH
2007-05-03  9:54   ` Jan Kara
2007-05-04  0:16     ` Greg KH
2007-05-04 14:14       ` Jan Kara
2007-05-07 16:28         ` Greg KH [this message]
2007-05-09 11:19           ` Jan Kara

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=20070507162830.GA23216@kroah.com \
    --to=greg@kroah.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@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).