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 1.1.1.1 2008/10/15 03:27:30 james26_jang Exp $ 9 * 10 */ 11#ifndef _LINUX_MOUNT_H 12#define _LINUX_MOUNT_H 13#ifdef __KERNEL__ 14 15#define MNT_NOSUID 1 16#define MNT_NODEV 2 17#define MNT_NOEXEC 4 18 19struct vfsmount 20{ 21 struct list_head mnt_hash; 22 struct vfsmount *mnt_parent; /* fs we are mounted on */ 23 struct dentry *mnt_mountpoint; /* dentry of mountpoint */ 24 struct dentry *mnt_root; /* root of the mounted tree */ 25 struct super_block *mnt_sb; /* pointer to superblock */ 26 struct list_head mnt_mounts; /* list of children, anchored here */ 27 struct list_head mnt_child; /* and going through their mnt_child */ 28 atomic_t mnt_count; 29 int mnt_flags; 30 char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ 31 struct list_head mnt_list; 32}; 33 34static inline struct vfsmount *mntget(struct vfsmount *mnt) 35{ 36 if (mnt) 37 atomic_inc(&mnt->mnt_count); 38 return mnt; 39} 40 41extern void __mntput(struct vfsmount *mnt); 42 43static inline void mntput(struct vfsmount *mnt) 44{ 45 if (mnt) { 46 if (atomic_dec_and_test(&mnt->mnt_count)) 47 __mntput(mnt); 48 } 49} 50 51#endif 52#endif /* _LINUX_MOUNT_H */ 53