bfs.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * fs/bfs/bfs.h
  4. * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com>
  5. */
  6. #ifndef _FS_BFS_BFS_H
  7. #define _FS_BFS_BFS_H
  8. #include <linux/bfs_fs.h>
  9. /*
  10. * BFS file system in-core superblock info
  11. */
  12. struct bfs_sb_info {
  13. unsigned long si_blocks;
  14. unsigned long si_freeb;
  15. unsigned long si_freei;
  16. unsigned long si_lf_eblk;
  17. unsigned long si_lasti;
  18. unsigned long *si_imap;
  19. struct mutex bfs_lock;
  20. };
  21. /*
  22. * BFS file system in-core inode info
  23. */
  24. struct bfs_inode_info {
  25. unsigned long i_dsk_ino; /* inode number from the disk, can be 0 */
  26. unsigned long i_sblock;
  27. unsigned long i_eblock;
  28. struct inode vfs_inode;
  29. };
  30. static inline struct bfs_sb_info *BFS_SB(struct super_block *sb)
  31. {
  32. return sb->s_fs_info;
  33. }
  34. static inline struct bfs_inode_info *BFS_I(struct inode *inode)
  35. {
  36. return container_of(inode, struct bfs_inode_info, vfs_inode);
  37. }
  38. #define printf(format, args...) \
  39. printk(KERN_ERR "BFS-fs: %s(): " format, __func__, ## args)
  40. /* inode.c */
  41. extern struct inode *bfs_iget(struct super_block *sb, unsigned long ino);
  42. extern void bfs_dump_imap(const char *, struct super_block *);
  43. /* file.c */
  44. extern const struct inode_operations bfs_file_inops;
  45. extern const struct file_operations bfs_file_operations;
  46. extern const struct address_space_operations bfs_aops;
  47. /* dir.c */
  48. extern const struct inode_operations bfs_dir_inops;
  49. extern const struct file_operations bfs_dir_operations;
  50. #endif /* _FS_BFS_BFS_H */