From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 16 Apr 2005 15:20:36 -0700 Subject: Linux-2.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! --- include/linux/mount.h | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 include/linux/mount.h (limited to 'include/linux/mount.h') diff --git a/include/linux/mount.h b/include/linux/mount.h new file mode 100644 index 0000000..8b8d3b9 --- /dev/null +++ b/include/linux/mount.h @@ -0,0 +1,81 @@ +/* + * + * Definitions for mount interface. This describes the in the kernel build + * linkedlist with mounted filesystems. + * + * Author: Marco van Wieringen + * + * Version: $Id: mount.h,v 2.0 1996/11/17 16:48:14 mvw Exp mvw $ + * + */ +#ifndef _LINUX_MOUNT_H +#define _LINUX_MOUNT_H +#ifdef __KERNEL__ + +#include +#include +#include + +#define MNT_NOSUID 1 +#define MNT_NODEV 2 +#define MNT_NOEXEC 4 + +struct vfsmount +{ + struct list_head mnt_hash; + struct vfsmount *mnt_parent; /* fs we are mounted on */ + struct dentry *mnt_mountpoint; /* dentry of mountpoint */ + struct dentry *mnt_root; /* root of the mounted tree */ + struct super_block *mnt_sb; /* pointer to superblock */ + struct list_head mnt_mounts; /* list of children, anchored here */ + struct list_head mnt_child; /* and going through their mnt_child */ + atomic_t mnt_count; + int mnt_flags; + int mnt_expiry_mark; /* true if marked for expiry */ + char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ + struct list_head mnt_list; + struct list_head mnt_fslink; /* link in fs-specific expiry list */ + struct namespace *mnt_namespace; /* containing namespace */ +}; + +static inline struct vfsmount *mntget(struct vfsmount *mnt) +{ + if (mnt) + atomic_inc(&mnt->mnt_count); + return mnt; +} + +extern void __mntput(struct vfsmount *mnt); + +static inline void _mntput(struct vfsmount *mnt) +{ + if (mnt) { + if (atomic_dec_and_test(&mnt->mnt_count)) + __mntput(mnt); + } +} + +static inline void mntput(struct vfsmount *mnt) +{ + if (mnt) { + mnt->mnt_expiry_mark = 0; + _mntput(mnt); + } +} + +extern void free_vfsmnt(struct vfsmount *mnt); +extern struct vfsmount *alloc_vfsmnt(const char *name); +extern struct vfsmount *do_kern_mount(const char *fstype, int flags, + const char *name, void *data); + +struct nameidata; + +extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd, + int mnt_flags, struct list_head *fslist); + +extern void mark_mounts_for_expiry(struct list_head *mounts); + +extern spinlock_t vfsmount_lock; + +#endif +#endif /* _LINUX_MOUNT_H */ -- cgit v1.1