Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /* RomFS internal definitions
0003  *
0004  * Copyright © 2007 Red Hat, Inc. All Rights Reserved.
0005  * Written by David Howells (dhowells@redhat.com)
0006  */
0007 
0008 #include <linux/romfs_fs.h>
0009 
0010 struct romfs_inode_info {
0011     struct inode    vfs_inode;
0012     unsigned long   i_metasize; /* size of non-data area */
0013     unsigned long   i_dataoffset;   /* from the start of fs */
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  * mmap-nommu.c
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  * storage.c
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);