linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* path_lookup function
@ 2006-02-13 14:30 UZAIR LAKHANI
  2006-02-13 15:16 ` Avishay Traeger
  0 siblings, 1 reply; 2+ messages in thread
From: UZAIR LAKHANI @ 2006-02-13 14:30 UTC (permalink / raw)
  To: linux-fsdevel

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 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: path_lookup function
  2006-02-13 14:30 path_lookup function UZAIR LAKHANI
@ 2006-02-13 15:16 ` Avishay Traeger
  0 siblings, 0 replies; 2+ messages in thread
From: Avishay Traeger @ 2006-02-13 15:16 UTC (permalink / raw)
  To: UZAIR LAKHANI; +Cc: linux-fsdevel

On Mon, 2006-02-13 at 06:30 -0800, UZAIR LAKHANI wrote:
> 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.

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/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-13 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-13 14:30 path_lookup function UZAIR LAKHANI
2006-02-13 15:16 ` Avishay Traeger

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).