internal.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* RomFS internal definitions
  2. *
  3. * Copyright © 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #include <linux/romfs_fs.h>
  12. struct romfs_inode_info {
  13. struct inode vfs_inode;
  14. unsigned long i_metasize; /* size of non-data area */
  15. unsigned long i_dataoffset; /* from the start of fs */
  16. };
  17. static inline size_t romfs_maxsize(struct super_block *sb)
  18. {
  19. return (size_t) (unsigned long) sb->s_fs_info;
  20. }
  21. static inline struct romfs_inode_info *ROMFS_I(struct inode *inode)
  22. {
  23. return container_of(inode, struct romfs_inode_info, vfs_inode);
  24. }
  25. /*
  26. * mmap-nommu.c
  27. */
  28. #if !defined(CONFIG_MMU) && defined(CONFIG_ROMFS_ON_MTD)
  29. extern const struct file_operations romfs_ro_fops;
  30. #else
  31. #define romfs_ro_fops generic_ro_fops
  32. #endif
  33. /*
  34. * storage.c
  35. */
  36. extern int romfs_dev_read(struct super_block *sb, unsigned long pos,
  37. void *buf, size_t buflen);
  38. extern ssize_t romfs_dev_strnlen(struct super_block *sb,
  39. unsigned long pos, size_t maxlen);
  40. extern int romfs_dev_strcmp(struct super_block *sb, unsigned long pos,
  41. const char *str, size_t size);