Skip to contentSkip to conversation

path_lookup function

DISCUSSION UZAIR LAKHANI 2 participants 2 messages Feb 13, 2006 VFS

lore
Share & tools
lore
#0 lore raw

Hello All,

I want to find some information regarding the path_lookup function. I use this function for getting the superblock and mount-point dentry of a mounted file system.

I use this function like

struct nameidata var;

path_lookup("/home", 0, &var)

My file system which is actually a wrapper (in my case on ext3) mounts (using the function get_sb_single) and unmounts (using the function kill_anon_super) correctly but when I reboot and when the kernel tries to unmount the /home, I get the error device or resouce busy.

Is there any other function which I must call after calling path_lookup function so that when I reboot the system, the /home can unmount cleanly.

OR should I use some other functions to get the superblock and dentry of a mounted file system.

Thanks,

Uzair Lakhani

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#1 lore raw
Quoted 20 lines · UZAIR LAKHANI

Hello All,

I want to find some information regarding the path_lookup function. I use this function for getting the superblock and mount-point dentry of a mounted file system.

I use this function like

struct nameidata var;

path_lookup("/home", 0, &var)

My file system which is actually a wrapper (in my case on ext3) mounts (using the function get_sb_single) and unmounts (using the function kill_anon_super) correctly but when I reboot and when the kernel tries to unmount the /home, I get the error device or resouce busy.

Quoted 6 lines

Is there any other function which I must call after calling path_lookup function so that when I reboot the system, the /home can unmount cleanly.

OR should I use some other functions to get the superblock and dentry of a mounted file system.

I believe that you need to call dput(var->dentry) and mntput(var->mnt). You can usually tell how you are supposed to use a function by looking at how others have used it in the kernel (LXR is your friend).

Avishay Traeger
http://www.fsl.cs.sunysb.edu/~avishay/