0001
0002
0003
0004
0005
0006
0007
0008 #include <linux/romfs_fs.h>
0009
0010 struct romfs_inode_info {
0011 struct inode vfs_inode;
0012 unsigned long i_metasize;
0013 unsigned long i_dataoffset;
0014 };
0015
0016 static inline size_t romfs_maxsize(struct super_block *sb)
0017 {
0018 return (size_t) (unsigned long) sb->s_fs_info;
0019 }
0020
0021 static inline struct romfs_inode_info *ROMFS_I(struct inode *inode)
0022 {
0023 return container_of(inode, struct romfs_inode_info, vfs_inode);
0024 }
0025
0026
0027
0028
0029 #if !defined(CONFIG_MMU) && defined(CONFIG_ROMFS_ON_MTD)
0030 extern const struct file_operations romfs_ro_fops;
0031 #else
0032 #define romfs_ro_fops generic_ro_fops
0033 #endif
0034
0035
0036
0037
0038 extern int romfs_dev_read(struct super_block *sb, unsigned long pos,
0039 void *buf, size_t buflen);
0040 extern ssize_t romfs_dev_strnlen(struct super_block *sb,
0041 unsigned long pos, size_t maxlen);
0042 extern int romfs_dev_strcmp(struct super_block *sb, unsigned long pos,
0043 const char *str, size_t size);