internal.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /* RomFS internal definitions
  3. *
  4. * Copyright © 2007 Red Hat, Inc. All Rights Reserved.
  5. * Written by David Howells (dhowells@redhat.com)
  6. */
  7. #include <linux/romfs_fs.h>
  8. struct romfs_inode_info {
  9. struct inode vfs_inode;
  10. unsigned long i_metasize; /* size of non-data area */
  11. unsigned long i_dataoffset; /* from the start of fs */
  12. };
  13. static inline size_t romfs_maxsize(struct super_block *sb)
  14. {
  15. return (size_t) (unsigned long) sb->s_fs_info;
  16. }
  17. static inline struct romfs_inode_info *ROMFS_I(struct inode *inode)
  18. {
  19. return container_of(inode, struct romfs_inode_info, vfs_inode);
  20. }
  21. /*
  22. * mmap-nommu.c
  23. */
  24. #if !defined(CONFIG_MMU) && defined(CONFIG_ROMFS_ON_MTD)
  25. extern const struct file_operations romfs_ro_fops;
  26. #else
  27. #define romfs_ro_fops generic_ro_fops
  28. #endif
  29. /*
  30. * storage.c
  31. */
  32. extern int romfs_dev_read(struct super_block *sb, unsigned long pos,
  33. void *buf, size_t buflen);
  34. extern ssize_t romfs_dev_strnlen(struct super_block *sb,
  35. unsigned long pos, size_t maxlen);
  36. extern int romfs_dev_strcmp(struct super_block *sb, unsigned long pos,
  37. const char *str, size_t size);