3 * Definitions for mount interface. This describes the in the kernel build
4 * linkedlist with mounted filesystems.
6 * Author: Marco van Wieringen <mvw@planets.elm.net>
8 * Version: $Id: mount.h,v 2.0 1996/11/17 16:48:14 mvw Exp mvw $
11 #ifndef _LINUX_MOUNT_H
12 #define _LINUX_MOUNT_H
15 #include <linux/types.h>
16 #include <linux/list.h>
17 #include <linux/spinlock.h>
18 #include <asm/atomic.h>
26 struct list_head mnt_hash;
27 struct vfsmount *mnt_parent; /* fs we are mounted on */
28 struct dentry *mnt_mountpoint; /* dentry of mountpoint */
29 struct dentry *mnt_root; /* root of the mounted tree */
30 struct super_block *mnt_sb; /* pointer to superblock */
31 struct list_head mnt_mounts; /* list of children, anchored here */
32 struct list_head mnt_child; /* and going through their mnt_child */
35 int mnt_expiry_mark; /* true if marked for expiry */
36 char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
37 struct list_head mnt_list;
38 struct list_head mnt_expire; /* link in fs-specific expiry list */
39 struct namespace *mnt_namespace; /* containing namespace */
42 static inline struct vfsmount *mntget(struct vfsmount *mnt)
45 atomic_inc(&mnt->mnt_count);
49 extern void __mntput(struct vfsmount *mnt);
51 static inline void mntput_no_expire(struct vfsmount *mnt)
54 if (atomic_dec_and_test(&mnt->mnt_count))
59 static inline void mntput(struct vfsmount *mnt)
62 mnt->mnt_expiry_mark = 0;
63 mntput_no_expire(mnt);
67 extern void free_vfsmnt(struct vfsmount *mnt);
68 extern struct vfsmount *alloc_vfsmnt(const char *name);
69 extern struct vfsmount *do_kern_mount(const char *fstype, int flags,
70 const char *name, void *data);
74 extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd,
75 int mnt_flags, struct list_head *fslist);
77 extern void mark_mounts_for_expiry(struct list_head *mounts);
79 extern spinlock_t vfsmount_lock;
80 extern dev_t name_to_dev_t(char *name);
83 #endif /* _LINUX_MOUNT_H */