nfs4: Add get_vnode_name hook

This commit is contained in:
Pawel Dziepak 2012-06-05 19:01:25 +02:00
parent 87c6b83293
commit 96b7b14a96
2 changed files with 19 additions and 1 deletions

View File

@ -25,6 +25,7 @@ public:
inline ino_t ID() const;
inline mode_t Type() const;
inline const char* Name() const;
status_t LookUp(const char* name, ino_t* id);
status_t Stat(struct stat* st);
@ -79,5 +80,12 @@ Inode::Type() const
}
inline const char*
Inode::Name() const
{
return fName;
}
#endif // INODE_H

View File

@ -111,6 +111,16 @@ nfs4_lookup(fs_volume* volume, fs_vnode* dir, const char* name, ino_t* _id)
}
static status_t
nfs4_get_vnode_name(fs_volume* volume, fs_vnode* vnode, char* buffer,
size_t bufferSize)
{
Inode* inode = reinterpret_cast<Inode*>(vnode->private_node);
strncpy(buffer, inode->Name(), bufferSize);
return B_OK;
}
static status_t
nfs4_put_vnode(fs_volume* volume, fs_vnode* vnode, bool reenter)
{
@ -242,7 +252,7 @@ fs_volume_ops gNFSv4VolumeOps = {
fs_vnode_ops gNFSv4VnodeOps = {
nfs4_lookup,
NULL, // get_vnode_name()
nfs4_get_vnode_name,
nfs4_put_vnode,
NULL, // remove_vnode()