/linux-2.6.21.1-rsbac-1.3.4/include/rsbac/fs.h File Reference

#include <linux/fs.h>
#include <linux/major.h>
#include <linux/root_dev.h>
#include <linux/sched.h>

Go to the source code of this file.

Defines

#define SOCKFS_MAGIC   0x534F434B
#define SYSFS_MAGIC   0x62656572
#define SHM_FS_MAGIC   0x02011994

Functions

dentry * rsbac_lookup_hash (struct qstr *name, struct dentry *base)
dentry * rsbac_lookup_one_len (const char *name, struct dentry *base, int len)
super_block * rsbac_get_super_block (kdev_t kdev)
void FASTCALL (__fput(struct file *))
static int init_private_file (struct file *filp, struct dentry *dentry, int mode)


Define Documentation

#define SHM_FS_MAGIC   0x02011994

Definition at line 45 of file fs.h.

#define SOCKFS_MAGIC   0x534F434B

Definition at line 25 of file fs.h.

Referenced by lookup_aci_path_dentry(), rsbac_handle_filldir(), and writable().

#define SYSFS_MAGIC   0x62656572

Definition at line 30 of file fs.h.

Referenced by rsbac_mount(), rsbac_umount(), and writable().


Function Documentation

void FASTCALL ( __fput(struct file *)   ) 

static int init_private_file ( struct file *  filp,
struct dentry *  dentry,
int  mode 
) [inline, static]

Definition at line 49 of file fs.h.

Referenced by rsbac_read_open(), and rsbac_write_open().

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 }

struct super_block* rsbac_get_super_block ( kdev_t  kdev  ) 

Definition at line 2063 of file aci_data_structures.c.

References device_hash(), device_list_locks, lookup_device(), NULL, rsbac_mount(), rsbac_printk(), rsbac_write_sem, and wakeup_auto().

Referenced by lookup_aci_path_dentry(), rsbac_acl_add_to_acl_entry(), rsbac_acl_get_mask(), rsbac_acl_get_rights(), rsbac_acl_get_single_right(), rsbac_acl_get_tlist(), rsbac_acl_remove_acl(), rsbac_acl_remove_acl_entry(), rsbac_acl_remove_from_acl_entry(), rsbac_acl_set_acl_entry(), rsbac_acl_set_mask(), rsbac_adf_request_int(), rsbac_adf_set_attr(), rsbac_auth_add_to_f_capset(), rsbac_auth_clear_f_capset(), rsbac_auth_copy_fp_capset(), rsbac_auth_get_f_caplist(), rsbac_auth_remove_from_f_capset(), rsbac_mac_add_to_f_truset(), rsbac_mac_clear_f_truset(), rsbac_mac_copy_fp_truset(), rsbac_mac_get_f_trulist(), rsbac_mac_remove_from_f_truset(), and rsbac_write_open().

02064 {
02065         struct rsbac_device_list_item_t *device_p;
02066 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
02067         u_long dflags;
02068 #endif
02069         struct super_block *sb_p;
02070         u_int hash;
02071 
02072         if (RSBAC_IS_AUTO_DEV(kdev))
02073                 return NULL;
02074 
02075         hash = device_hash(kdev);
02076         /* get super_block-pointer */
02077 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
02078         rcu_read_lock();
02079 #else
02080         rsbac_read_lock(&device_list_locks[hash], &dflags);
02081 #endif
02082         device_p = lookup_device(kdev, hash);
02083         if (!device_p) {
02084 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
02085                 rcu_read_unlock();
02086 #else
02087                 rsbac_read_unlock(&device_list_locks[hash], &dflags);
02088 #endif
02089                 down(&rsbac_write_sem);
02090                 up(&rsbac_write_sem);
02091 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
02092                 sb_p = user_get_super(kdev);
02093 #else
02094                 sb_p = get_super(kdev);
02095 #endif
02096                 if (!sb_p) {    /* Wait a second and retry */
02097                         DECLARE_WAIT_QUEUE_HEAD(auto_wait);
02098                         struct timer_list auto_timer;
02099 
02100                         rsbac_printk(KERN_INFO "rsbac_get_super_block(): device %02u:%02u not yet available, sleeping\n",
02101                                      RSBAC_MAJOR(kdev), RSBAC_MINOR(kdev));
02102                         init_timer(&auto_timer);
02103                         auto_timer.function = wakeup_auto;
02104                         auto_timer.data = (u_long) & auto_wait;
02105                         auto_timer.expires = jiffies + HZ;
02106                         add_timer(&auto_timer);
02107                         interruptible_sleep_on(&auto_wait);
02108 
02109 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
02110                         sb_p = user_get_super(kdev);
02111 #else
02112                         sb_p = get_super(kdev);
02113 #endif
02114                 }
02115                 if (sb_p) {
02116                         device_p = lookup_device(kdev, hash);
02117                         /* Never auto-mount <= 01:xx devices */
02118                         if (!device_p && (RSBAC_MAJOR(kdev) <= 1)) {
02119                                 rsbac_printk(KERN_INFO "rsbac_get_super_block(): auto-mounting device %02u:%02u\n",
02120                                              RSBAC_MAJOR(kdev),
02121                                              RSBAC_MINOR(kdev));
02122                                 rsbac_mount(sb_p, NULL);
02123                         }
02124                         /* free super_block pointer */
02125                         drop_super(sb_p);
02126 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
02127                         rcu_read_lock();
02128 #else
02129                         rsbac_read_lock(&device_list_locks[hash], &dflags);
02130 #endif
02131                         device_p = lookup_device(kdev, hash);
02132                         if (!device_p) {
02133                                 rsbac_printk(KERN_WARNING "rsbac_get_super_block(): unknown device %02u:%02u\n",
02134                                              RSBAC_MAJOR(kdev),
02135                                              RSBAC_MINOR(kdev));
02136 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
02137                                 rcu_read_unlock();
02138 #else
02139                                 rsbac_read_unlock(&device_list_locks[hash],
02140                                                   &dflags);
02141 #endif
02142                                 return NULL;
02143                         }
02144                 } else {
02145                         return NULL;
02146                 }
02147         }
02148         sb_p = device_p->sb_p;
02149 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
02150         rcu_read_unlock();
02151 #else
02152         rsbac_read_unlock(&device_list_locks[hash], &dflags);
02153 #endif
02154         return sb_p;
02155 }

struct dentry* rsbac_lookup_hash ( struct qstr *  name,
struct dentry *  base 
)

struct dentry* rsbac_lookup_one_len ( const char *  name,
struct dentry *  base,
int  len 
)

Referenced by lookup_aci_path_dentry(), rsbac_do_init(), rsbac_handle_filldir(), rsbac_read_open(), and rsbac_write_open().


Generated on Wed May 16 11:53:56 2007 for RSBAC by  doxygen 1.5.1