Where's the create() pointer?
It's probably been this way for a long time, and I'm just noticing, but I can't seem to find the create() (among others) pointer for NFS filesystems.
Specifically, If I look at sb->s_root->d_inode->i_op there's no create there. How do I find it? I'm guessing that the ability to share mount structures between multiple NFS mounts resulted in some kind of fake superblock, but I just can't figure out where to find the functions.
-justinb
Signature · 3 lines
Justin Banks BakBone Software [email protected]
Quoted 7 lines · Justin Banks
It's probably been this way for a long time, and I'm just noticing, but I can't seem to find the
create()(among others) pointer for NFS filesystems.Specifically, If I look at
sb->s_root->d_inode->i_opthere's no create there. How do I find it? I'm guessing that the ability to share mount structures between multiple NFS mounts resulted in some kind of fake superblock, but I just can't figure out where to find the functions.
Why would you want to do this in the first place?
Anyhow, to answer the question: sb->s_root is not guaranteed to be a real file on NFS. The real mountpoints are usually in the anonymous dentry list.
Trond
Trond Myklebust wrote
Quoted 11 lines · Justin Banks
Quoted 7 lines
It's probably been this way for a long time, and I'm just noticing, but I can't seem to find the
create()(among others) pointer for NFS filesystems.Specifically, If I look at
sb->s_root->d_inode->i_opthere's no create there. How do I find it? I'm guessing that the ability to share mount structures between multiple NFS mounts resulted in some kind of fake superblock, but I just can't figure out where to find the functions.Why would you want to do this in the first place?
I'm just looking at trapping new creates on NFS, and so I need to find the pointer.
Quoted 3 lines
Anyhow, to answer the question:
sb->s_rootis not guaranteed to be a real file on NFS. The real mountpoints are usually in the anonymous dentry list.
Okay, I'll look there, thanks.
-justinb
Signature · 3 lines
Justin Banks BakBone Software [email protected]
Quoted 11 lines · Justin Banks
Trond Myklebust wrote
Quoted 10 lines · Justin Banks
Quoted 7 lines
It's probably been this way for a long time, and I'm just noticing, but I can't seem to find the
create()(among others) pointer for NFS filesystems.Specifically, If I look at
sb->s_root->d_inode->i_opthere's no create there. How do I find it? I'm guessing that the ability to share mount structures between multiple NFS mounts resulted in some kind of fake superblock, but I just can't figure out where to find the functions.
Quoted 4 lines
Quoted 1 line
Why would you want to do this in the first place?
I'm just looking at trapping new creates on NFS, and so I need to find the pointer.
What is your purpose in trapping creates on the client? Is this for accounting purposes? If so, why wouldn't inotify, or even a systemtap script suffice?
Anyhow, the simplest way to find the pointer is to grep for nfs_create in /proc/kallsyms.
Trond
Trond Myklebust wrote
Quoted 13 lines · Justin Banks
Quoted 11 lines
Trond Myklebust wrote
Quoted 10 lines · Justin Banks
Quoted 7 lines
It's probably been this way for a long time, and I'm just noticing, but I can't seem to find the
create()(among others) pointer for NFS filesystems.Specifically, If I look at
sb->s_root->d_inode->i_opthere's no create there. How do I find it? I'm guessing that the ability to share mount structures between multiple NFS mounts resulted in some kind of fake superblock, but I just can't figure out where to find the functions.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Why would you want to do this in the first place?
I'm just looking at trapping new creates on NFS, and so I need to find the pointer.
What is your purpose in trapping creates on the client? Is this for accounting purposes? If so, why wouldn't inotify, or even a systemtap script suffice?
Could do inotify, except on a large-ish filesystem, it's really unuseable, if you want to track everything that's going on.
Quoted 2 lines
Anyhow, the simplest way to find the pointer is to grep for
nfs_createin/proc/kallsyms.
Ugh. That's an ugly way, seems to me. Isn't there a way, given the superblock? I mean, the VFS does it that way, doesn't it?
-justinb
Signature · 3 lines
Justin Banks BakBone Software [email protected]