fs.h

Go to the documentation of this file.
00001 /************************************* */
00002 /* Rule Set Based Access Control       */
00003 /* Author and (c) 1999-2004: Amon Ott  */
00004 /* File system                         */
00005 /* helper functions for all parts      */
00006 /* Last modified: 30/Apr/2004          */
00007 /************************************* */
00008 
00009 #ifndef __RSBAC_FS_H
00010 #define __RSBAC_FS_H
00011 
00012 #include <linux/fs.h>
00013 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
00014 #include <linux/major.h>
00015 #include <linux/root_dev.h>
00016 #include <linux/sched.h>
00017 #endif
00018 
00019 /* original lookup_dentry function without rsbac patch for adf call */
00020 
00021 struct dentry * rsbac_lookup_hash(struct qstr *name, struct dentry * base);
00022 struct dentry * rsbac_lookup_one_len(const char * name, struct dentry * base, int len);
00023 
00024 #ifndef SOCKFS_MAGIC
00025 #define SOCKFS_MAGIC 0x534F434B
00026 #endif
00027 
00028 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
00029 #ifndef SYSFS_MAGIC
00030 #define SYSFS_MAGIC 0x62656572
00031 #endif
00032 #endif
00033 
00034 struct super_block * rsbac_get_super_block(kdev_t kdev);
00035 
00036 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
00037 extern void FASTCALL(__fput(struct file *));
00038 #else
00039 #ifndef __fput
00040 extern void __fput(struct file *);
00041 #endif
00042 #endif
00043 
00044 #ifndef SHM_FS_MAGIC
00045 #define SHM_FS_MAGIC 0x02011994
00046 #endif
00047 
00048 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
00049 static inline int init_private_file(struct file *filp, struct dentry *dentry, int mode)
00050 {
00051         memset(filp, 0, sizeof(*filp));
00052         filp->f_mode   = mode;
00053         atomic_set(&filp->f_count, 1);
00054         filp->f_dentry = dentry;
00055         filp->f_uid    = current->fsuid;
00056         filp->f_gid    = current->fsgid;
00057         filp->f_op     = dentry->d_inode->i_fop;
00058 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
00059         filp->f_mapping     = dentry->d_inode->i_mapping;
00060         file_ra_state_init(&filp->f_ra, filp->f_mapping);
00061 #endif
00062         if (filp->f_op->open)
00063                 return filp->f_op->open(dentry->d_inode, filp);
00064         else
00065                 return 0;
00066 }
00067 #endif
00068 
00069 #endif

Generated on Fri Jun 17 09:45:18 2005 for RSBAC by  doxygen 1.4.2