* Getting debugfs mountpoint?
@ 2012-09-15 1:49 Jacob Sowles
2012-09-15 1:57 ` Al Viro
2012-09-16 20:23 ` Rob Landley
0 siblings, 2 replies; 8+ messages in thread
From: Jacob Sowles @ 2012-09-15 1:49 UTC (permalink / raw)
To: linux-kernel
Is there an easy way to get the path to where debugfs is mounted? I
found a function called debugfs_find_mountpoint(), which is exactly
what I want, but it’s not exported, so I can’t use it. The only
exported debugfs functions that I could find are the ones that create,
remove, etc.
Jacob
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Getting debugfs mountpoint?
2012-09-15 1:49 Getting debugfs mountpoint? Jacob Sowles
@ 2012-09-15 1:57 ` Al Viro
2012-09-15 2:07 ` Jacob Sowles
2012-09-16 20:23 ` Rob Landley
1 sibling, 1 reply; 8+ messages in thread
From: Al Viro @ 2012-09-15 1:57 UTC (permalink / raw)
To: Jacob Sowles; +Cc: linux-kernel
On Fri, Sep 14, 2012 at 06:49:01PM -0700, Jacob Sowles wrote:
> Is there an easy way to get the path to where debugfs is mounted? I
> found a function called debugfs_find_mountpoint(), which is exactly
> what I want, but it’s not exported, so I can’t use it. The only
> exported debugfs functions that I could find are the ones that create,
> remove, etc.
More to the point, it's a userland function. Why would you want that
kernel-side?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Getting debugfs mountpoint?
2012-09-15 1:57 ` Al Viro
@ 2012-09-15 2:07 ` Jacob Sowles
2012-09-15 2:11 ` Al Viro
0 siblings, 1 reply; 8+ messages in thread
From: Jacob Sowles @ 2012-09-15 2:07 UTC (permalink / raw)
To: Al Viro; +Cc: linux-kernel
Multiple instances of my code can be run simultaneously, and all
instances use the same debugfs directory, so I need the path to the
debugfs root directory so that I can use filp_open to get the dentry
for that directory.
Jacob
On Fri, Sep 14, 2012 at 6:57 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Fri, Sep 14, 2012 at 06:49:01PM -0700, Jacob Sowles wrote:
>> Is there an easy way to get the path to where debugfs is mounted? I
>> found a function called debugfs_find_mountpoint(), which is exactly
>> what I want, but it’s not exported, so I can’t use it. The only
>> exported debugfs functions that I could find are the ones that create,
>> remove, etc.
>
> More to the point, it's a userland function. Why would you want that
> kernel-side?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Getting debugfs mountpoint?
2012-09-15 2:07 ` Jacob Sowles
@ 2012-09-15 2:11 ` Al Viro
2012-09-15 2:17 ` Jacob Sowles
0 siblings, 1 reply; 8+ messages in thread
From: Al Viro @ 2012-09-15 2:11 UTC (permalink / raw)
To: Jacob Sowles; +Cc: linux-kernel
On Fri, Sep 14, 2012 at 07:07:43PM -0700, Jacob Sowles wrote:
> Multiple instances of my code can be run simultaneously, and all
> instances use the same debugfs directory, so I need the path to the
> debugfs root directory so that I can use filp_open to get the dentry
> for that directory.
What's wrong with just storing a pointer to that dentry in a variable?
And what do you want an opened file (of a directory, at that) on debugfs?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Getting debugfs mountpoint?
2012-09-15 2:11 ` Al Viro
@ 2012-09-15 2:17 ` Jacob Sowles
2012-09-15 2:19 ` Jacob Sowles
2012-09-15 2:27 ` Al Viro
0 siblings, 2 replies; 8+ messages in thread
From: Jacob Sowles @ 2012-09-15 2:17 UTC (permalink / raw)
To: Al Viro; +Cc: linux-kernel
The first instance of my code calls debugfs_create_file and stores a
pointer to the dentry of that directory. But when the second instance
calls debugfs_create_file, the function returns NULL because that
directory already exists, so it doesn't return the dentry that I need.
On Fri, Sep 14, 2012 at 7:11 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Fri, Sep 14, 2012 at 07:07:43PM -0700, Jacob Sowles wrote:
>> Multiple instances of my code can be run simultaneously, and all
>> instances use the same debugfs directory, so I need the path to the
>> debugfs root directory so that I can use filp_open to get the dentry
>> for that directory.
>
> What's wrong with just storing a pointer to that dentry in a variable?
> And what do you want an opened file (of a directory, at that) on debugfs?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Getting debugfs mountpoint?
2012-09-15 2:17 ` Jacob Sowles
@ 2012-09-15 2:19 ` Jacob Sowles
2012-09-15 2:27 ` Al Viro
1 sibling, 0 replies; 8+ messages in thread
From: Jacob Sowles @ 2012-09-15 2:19 UTC (permalink / raw)
To: Al Viro; +Cc: linux-kernel
debugfs_create_dir, rather. Not debugfs_create_file.
On Fri, Sep 14, 2012 at 7:17 PM, Jacob Sowles <sowlesj@gmail.com> wrote:
> The first instance of my code calls debugfs_create_file and stores a
> pointer to the dentry of that directory. But when the second instance
> calls debugfs_create_file, the function returns NULL because that
> directory already exists, so it doesn't return the dentry that I need.
>
> On Fri, Sep 14, 2012 at 7:11 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>> On Fri, Sep 14, 2012 at 07:07:43PM -0700, Jacob Sowles wrote:
>>> Multiple instances of my code can be run simultaneously, and all
>>> instances use the same debugfs directory, so I need the path to the
>>> debugfs root directory so that I can use filp_open to get the dentry
>>> for that directory.
>>
>> What's wrong with just storing a pointer to that dentry in a variable?
>> And what do you want an opened file (of a directory, at that) on debugfs?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Getting debugfs mountpoint?
2012-09-15 2:17 ` Jacob Sowles
2012-09-15 2:19 ` Jacob Sowles
@ 2012-09-15 2:27 ` Al Viro
1 sibling, 0 replies; 8+ messages in thread
From: Al Viro @ 2012-09-15 2:27 UTC (permalink / raw)
To: Jacob Sowles; +Cc: linux-kernel
On Fri, Sep 14, 2012 at 07:17:12PM -0700, Jacob Sowles wrote:
> The first instance of my code calls debugfs_create_file and stores a
> pointer to the dentry of that directory. But when the second instance
> calls debugfs_create_file, the function returns NULL because that
> directory already exists, so it doesn't return the dentry that I need.
... and? Ever heard of that thing called "global variable"?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Getting debugfs mountpoint?
2012-09-15 1:49 Getting debugfs mountpoint? Jacob Sowles
2012-09-15 1:57 ` Al Viro
@ 2012-09-16 20:23 ` Rob Landley
1 sibling, 0 replies; 8+ messages in thread
From: Rob Landley @ 2012-09-16 20:23 UTC (permalink / raw)
To: Jacob Sowles; +Cc: linux-kernel
>From userspace? Something like:
grep " debugfs " /proc/mounts | awk '{print $2}' | xargs echo -e
>From kernel space? There isn't guaranteed to be _one_, you can mount
multiple instances of most filesystems, and with container support you can
even have multiple debugfs superblocks.
Rob
On Fri, Sep 14, 2012 at 8:49 PM, Jacob Sowles <sowlesj@gmail.com> wrote:
> Is there an easy way to get the path to where debugfs is mounted? I
> found a function called debugfs_find_mountpoint(), which is exactly
> what I want, but it’s not exported, so I can’t use it. The only
> exported debugfs functions that I could find are the ones that create,
> remove, etc.
>
> Jacob
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-09-16 20:23 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-15 1:49 Getting debugfs mountpoint? Jacob Sowles
2012-09-15 1:57 ` Al Viro
2012-09-15 2:07 ` Jacob Sowles
2012-09-15 2:11 ` Al Viro
2012-09-15 2:17 ` Jacob Sowles
2012-09-15 2:19 ` Jacob Sowles
2012-09-15 2:27 ` Al Viro
2012-09-16 20:23 ` Rob Landley
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).