aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mount.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/mount.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/linux/mount.h')
-rw-r--r--include/linux/mount.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/include/linux/mount.h b/include/linux/mount.h
new file mode 100644
index 000000000000..8b8d3b9beefd
--- /dev/null
+++ b/include/linux/mount.h
@@ -0,0 +1,81 @@
1/*
2 *
3 * Definitions for mount interface. This describes the in the kernel build
4 * linkedlist with mounted filesystems.
5 *
6 * Author: Marco van Wieringen <mvw@planets.elm.net>
7 *
8 * Version: $Id: mount.h,v 2.0 1996/11/17 16:48:14 mvw Exp mvw $
9 *
10 */
11#ifndef _LINUX_MOUNT_H
12#define _LINUX_MOUNT_H
13#ifdef __KERNEL__
14
15#include <linux/list.h>
16#include <linux/spinlock.h>
17#include <asm/atomic.h>
18
19#define MNT_NOSUID 1
20#define MNT_NODEV 2
21#define MNT_NOEXEC 4
22
23struct vfsmount
24{
25 struct list_head mnt_hash;
26 struct vfsmount *mnt_parent; /* fs we are mounted on */
27 struct dentry *mnt_mountpoint; /* dentry of mountpoint */
28 struct dentry *mnt_root; /* root of the mounted tree */
29 struct super_block *mnt_sb; /* pointer to superblock */
30 struct list_head mnt_mounts; /* list of children, anchored here */
31 struct list_head mnt_child; /* and going through their mnt_child */
32 atomic_t mnt_count;
33 int mnt_flags;
34 int mnt_expiry_mark; /* true if marked for expiry */
35 char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
36 struct list_head mnt_list;
37 struct list_head mnt_fslink; /* link in fs-specific expiry list */
38 struct namespace *mnt_namespace; /* containing namespace */
39};
40
41static inline struct vfsmount *mntget(struct vfsmount *mnt)
42{
43 if (mnt)
44 atomic_inc(&mnt->mnt_count);
45 return mnt;
46}
47
48extern void __mntput(struct vfsmount *mnt);
49
50static inline void _mntput(struct vfsmount *mnt)
51{
52 if (mnt) {
53 if (atomic_dec_and_test(&mnt->mnt_count))
54 __mntput(mnt);
55 }
56}
57
58static inline void mntput(struct vfsmount *mnt)
59{
60 if (mnt) {
61 mnt->mnt_expiry_mark = 0;
62 _mntput(mnt);
63 }
64}
65
66extern void free_vfsmnt(struct vfsmount *mnt);
67extern struct vfsmount *alloc_vfsmnt(const char *name);
68extern struct vfsmount *do_kern_mount(const char *fstype, int flags,
69 const char *name, void *data);
70
71struct nameidata;
72
73extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd,
74 int mnt_flags, struct list_head *fslist);
75
76extern void mark_mounts_for_expiry(struct list_head *mounts);
77
78extern spinlock_t vfsmount_lock;
79
80#endif
81#endif /* _LINUX_MOUNT_H */