1 /* fs/tunnel.c: utility functions to support VFS tunnelling
3 Copyright (C) 1999 Richard Gooch
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the Free
17 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 Richard Gooch may be reached by email at rgooch@atnf.csiro.au
20 The postal address is:
21 Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
25 19991121 Richard Gooch <rgooch@atnf.csiro.au>
28 #include <linux/types.h>
29 #include <linux/errno.h>
30 #include <linux/ctype.h>
31 #include <linux/module.h>
36 struct dentry
*vfs_tunnel_lookup (const struct dentry
*dentry
,
37 const struct dentry
*parent
,
38 const struct dentry
*covered
)
39 /* [SUMMARY] Lookup the corresponding dentry in the mounted-over FS.
40 <dentry> The dentry which is in the overmounting FS.
41 <parent> The parent of the dentry in the mounted-over FS. This may be NULL.
42 <covered> The dentry covered by the root dentry of the overmounting FS.
43 [RETURNS] A dentry on success, else NULL.
46 struct dentry
*root
= dentry
->d_sb
->s_root
;
48 if (covered
== root
) return NULL
;
49 if (parent
) return lookup_dentry (dentry
->d_name
.name
, parent
, 0);
50 } /* End Function vfs_tunnel_lookup */