Blame view

include/linux/bfs_fs.h 1.79 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
  /*
   *	include/linux/bfs_fs.h - BFS data structures on disk.
   *	Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com>
   */
  
  #ifndef _LINUX_BFS_FS_H
  #define _LINUX_BFS_FS_H
1da9ebd5a   Jaswinder Singh Rajput   headers_check fix...
8
  #include <linux/types.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
9
10
11
12
13
14
15
16
  #define BFS_BSIZE_BITS		9
  #define BFS_BSIZE		(1<<BFS_BSIZE_BITS)
  
  #define BFS_MAGIC		0x1BADFACE
  #define BFS_ROOT_INO		2
  #define BFS_INODES_PER_BLOCK	8
  
  /* SVR4 vnode type values (bfs_inode->i_vtype) */
fac92becd   Andrew Stribblehill   [PATCH] bfs: fix ...
17
18
  #define BFS_VDIR 2L
  #define BFS_VREG 1L
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
19
20
  /* BFS inode layout on disk */
  struct bfs_inode {
ce0fe7e70   Alexey Dobriyan   [PATCH] bfs endia...
21
  	__le16 i_ino;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
22
  	__u16 i_unused;
ce0fe7e70   Alexey Dobriyan   [PATCH] bfs endia...
23
24
25
26
27
28
29
30
31
32
33
  	__le32 i_sblock;
  	__le32 i_eblock;
  	__le32 i_eoffset;
  	__le32 i_vtype;
  	__le32 i_mode;
  	__le32 i_uid;
  	__le32 i_gid;
  	__le32 i_nlink;
  	__le32 i_atime;
  	__le32 i_mtime;
  	__le32 i_ctime;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
34
35
36
37
38
39
40
41
  	__u32 i_padding[4];
  };
  
  #define BFS_NAMELEN		14	
  #define BFS_DIRENT_SIZE		16
  #define BFS_DIRS_PER_BLOCK	32
  
  struct bfs_dirent {
ce0fe7e70   Alexey Dobriyan   [PATCH] bfs endia...
42
  	__le16 ino;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
43
44
45
46
47
  	char name[BFS_NAMELEN];
  };
  
  /* BFS superblock layout on disk */
  struct bfs_super_block {
ce0fe7e70   Alexey Dobriyan   [PATCH] bfs endia...
48
49
50
51
52
  	__le32 s_magic;
  	__le32 s_start;
  	__le32 s_end;
  	__le32 s_from;
  	__le32 s_to;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
53
54
55
56
57
58
  	__s32 s_bfrom;
  	__s32 s_bto;
  	char  s_fsname[6];
  	char  s_volume[6];
  	__u32 s_padding[118];
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
59
60
61
62
63
64
  
  #define BFS_OFF2INO(offset) \
          ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO)
  
  #define BFS_INO2OFF(ino) \
  	((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
fac92becd   Andrew Stribblehill   [PATCH] bfs: fix ...
65
  #define BFS_NZFILESIZE(ip) \
ce0fe7e70   Alexey Dobriyan   [PATCH] bfs endia...
66
          ((le32_to_cpu((ip)->i_eoffset) + 1) -  le32_to_cpu((ip)->i_sblock) * BFS_BSIZE)
fac92becd   Andrew Stribblehill   [PATCH] bfs: fix ...
67
68
69
  
  #define BFS_FILESIZE(ip) \
          ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
70

fac92becd   Andrew Stribblehill   [PATCH] bfs: fix ...
71
  #define BFS_FILEBLOCKS(ip) \
ce0fe7e70   Alexey Dobriyan   [PATCH] bfs endia...
72
          ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) -  le32_to_cpu((ip)->i_sblock))
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
73
  #define BFS_UNCLEAN(bfs_sb, sb)	\
ce0fe7e70   Alexey Dobriyan   [PATCH] bfs endia...
74
  	((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY))
fac92becd   Andrew Stribblehill   [PATCH] bfs: fix ...
75

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
76
77
  
  #endif	/* _LINUX_BFS_FS_H */