1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef __LINUX_ROMFS_FS_H
3 #define __LINUX_ROMFS_FS_H
5 #include <linux/types.h>
8 /* The basic structures of the romfs filesystem */
10 #define ROMBSIZE BLOCK_SIZE
11 #define ROMBSBITS BLOCK_SIZE_BITS
12 #define ROMBMASK (ROMBSIZE-1)
13 #define ROMFS_MAGIC 0x7275
15 #define ROMFS_MAXFN 128
17 #define __mkw(h,l) (((h)&0x00ff)<< 8|((l)&0x00ff))
18 #define __mkl(h,l) (((h)&0xffff)<<16|((l)&0xffff))
19 #define __mk4(a,b,c,d) cpu_to_be32(__mkl(__mkw(a,b),__mkw(c,d)))
20 #define ROMSB_WORD0 __mk4('-','r','o','m')
21 #define ROMSB_WORD1 __mk4('1','f','s','-')
23 /* On-disk "super block" */
25 struct romfs_super_block {
30 char name[]; /* volume name */
36 __be32 next; /* low 4 bits see ROMFH_ */
57 #define ROMFH_PAD (ROMFH_SIZE-1)
58 #define ROMFH_MASK (~ROMFH_PAD)