Back to home page

LXR

 
 

    


0001 #include <linux/kernel.h>
0002 #include <linux/blkdev.h>
0003 #include <linux/init.h>
0004 #include <linux/syscalls.h>
0005 #include <linux/unistd.h>
0006 #include <linux/slab.h>
0007 #include <linux/mount.h>
0008 #include <linux/major.h>
0009 #include <linux/root_dev.h>
0010 
0011 void  change_floppy(char *fmt, ...);
0012 void  mount_block_root(char *name, int flags);
0013 void  mount_root(void);
0014 extern int root_mountflags;
0015 
0016 static inline int create_dev(char *name, dev_t dev)
0017 {
0018     sys_unlink(name);
0019     return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
0020 }
0021 
0022 #if BITS_PER_LONG == 32
0023 static inline u32 bstat(char *name)
0024 {
0025     struct stat64 stat;
0026     if (sys_stat64(name, &stat) != 0)
0027         return 0;
0028     if (!S_ISBLK(stat.st_mode))
0029         return 0;
0030     if (stat.st_rdev != (u32)stat.st_rdev)
0031         return 0;
0032     return stat.st_rdev;
0033 }
0034 #else
0035 static inline u32 bstat(char *name)
0036 {
0037     struct stat stat;
0038     if (sys_newstat(name, &stat) != 0)
0039         return 0;
0040     if (!S_ISBLK(stat.st_mode))
0041         return 0;
0042     return stat.st_rdev;
0043 }
0044 #endif
0045 
0046 #ifdef CONFIG_BLK_DEV_RAM
0047 
0048 int __init rd_load_disk(int n);
0049 int __init rd_load_image(char *from);
0050 
0051 #else
0052 
0053 static inline int rd_load_disk(int n) { return 0; }
0054 static inline int rd_load_image(char *from) { return 0; }
0055 
0056 #endif
0057 
0058 #ifdef CONFIG_BLK_DEV_INITRD
0059 
0060 bool __init initrd_load(void);
0061 
0062 #else
0063 
0064 static inline bool initrd_load(void) { return false; }
0065 
0066 #endif
0067 
0068 #ifdef CONFIG_BLK_DEV_MD
0069 
0070 void md_run_setup(void);
0071 
0072 #else
0073 
0074 static inline void md_run_setup(void) {}
0075 
0076 #endif