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(), 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 2081 of file aci_data_structures.c.

References device_list_head, 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_check_acl(), 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().

02082   {
02083     struct rsbac_device_list_item_t * device_p;
02084     u_long dflags;
02085     struct super_block * sb_p;
02086 
02087     if(RSBAC_IS_AUTO_DEV(kdev))
02088       return NULL;
02089 
02090     /* get super_block-pointer */
02091     rsbac_read_lock(&device_list_head.lock, &dflags);
02092     device_p = lookup_device(kdev);
02093     if (!device_p)
02094       {
02095         rsbac_read_unlock(&device_list_head.lock, &dflags);
02096         down(&rsbac_write_sem);
02097         up(&rsbac_write_sem);
02098 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
02099         sb_p = user_get_super(kdev);
02100 #else
02101         sb_p = get_super(kdev);
02102 #endif
02103         if(!sb_p)
02104           { /* Wait a second and retry */
02105             DECLARE_WAIT_QUEUE_HEAD(auto_wait);
02106             struct timer_list auto_timer;
02107 
02108             rsbac_printk(KERN_INFO
02109                    "rsbac_get_super_block(): device %02u:%02u not yet available, sleeping\n",
02110                    RSBAC_MAJOR(kdev), RSBAC_MINOR(kdev));
02111             init_timer(&auto_timer);
02112             auto_timer.function = wakeup_auto;
02113             auto_timer.data = (u_long) &auto_wait;
02114             auto_timer.expires = jiffies + HZ;
02115             add_timer(&auto_timer);
02116             interruptible_sleep_on(&auto_wait);
02117 
02118 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
02119             sb_p = user_get_super(kdev);
02120 #else
02121             sb_p = get_super(kdev);
02122 #endif
02123           }
02124         if(sb_p)
02125           {
02126             device_p = lookup_device(kdev);
02127             if (!device_p)
02128               {
02129                 rsbac_printk(KERN_INFO
02130                        "rsbac_get_super_block(): auto-mounting device %02u:%02u\n",
02131                        RSBAC_MAJOR(kdev), RSBAC_MINOR(kdev));
02132                 rsbac_mount(sb_p, NULL);
02133               }
02134             /* free super_block pointer */
02135             drop_super(sb_p);
02136             rsbac_read_lock(&device_list_head.lock, &dflags);
02137             device_p = lookup_device(kdev);
02138             if (!device_p)
02139               {
02140                 rsbac_printk(KERN_WARNING
02141                        "rsbac_get_super_block(): unknown device %02u:%02u\n",
02142                        RSBAC_MAJOR(kdev), RSBAC_MINOR(kdev));
02143                 rsbac_read_unlock(&device_list_head.lock, &dflags);
02144                 return NULL;
02145               }
02146           }
02147         else
02148           {
02149             return NULL;
02150           }
02151       }
02152     sb_p = device_p->sb_p;
02153     rsbac_read_unlock(&device_list_head.lock, &dflags);
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_read_open(), and rsbac_write_open().


Generated on Sun May 21 14:30:57 2006 for RSBAC by  doxygen 1.4.2