efs_dir.h 844 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * efs_dir.h
  3. *
  4. * Copyright (c) 1999 Al Smith
  5. */
  6. #ifndef __EFS_DIR_H__
  7. #define __EFS_DIR_H__
  8. #define EFS_DIRBSIZE_BITS EFS_BLOCKSIZE_BITS
  9. #define EFS_DIRBSIZE (1 << EFS_DIRBSIZE_BITS)
  10. struct efs_dentry {
  11. __be32 inode;
  12. unsigned char namelen;
  13. char name[3];
  14. };
  15. #define EFS_DENTSIZE (sizeof(struct efs_dentry) - 3 + 1)
  16. #define EFS_MAXNAMELEN ((1 << (sizeof(char) * 8)) - 1)
  17. #define EFS_DIRBLK_HEADERSIZE 4
  18. #define EFS_DIRBLK_MAGIC 0xbeef /* moo */
  19. struct efs_dir {
  20. __be16 magic;
  21. unsigned char firstused;
  22. unsigned char slots;
  23. unsigned char space[EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE];
  24. };
  25. #define EFS_MAXENTS \
  26. ((EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE) / \
  27. (EFS_DENTSIZE + sizeof(char)))
  28. #define EFS_SLOTAT(dir, slot) EFS_REALOFF((dir)->space[slot])
  29. #define EFS_REALOFF(offset) ((offset << 1))
  30. #endif /* __EFS_DIR_H__ */