4 * Copyright (C) 2001-2002 Will Dyson <will_dyson@pobox.com>
5 * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
11 #include "befs_fs_types.h"
14 #define BEFS_VERSION "0.9.3"
17 typedef u64 befs_blocknr_t
;
19 * BeFS in memory structures
22 typedef struct befs_mount_options
{
31 typedef struct befs_sb_info
{
36 befs_off_t num_blocks
;
37 befs_off_t used_blocks
;
41 /* Allocation group information */
46 /* jornal log entry */
47 befs_block_run log_blocks
;
51 befs_inode_addr root_dir
;
52 befs_inode_addr indices
;
55 befs_mount_options mount_opts
;
56 struct nls_table
*nls
;
60 typedef struct befs_inode_info
{
64 befs_inode_addr i_inode_num
;
65 befs_inode_addr i_parent
;
66 befs_inode_addr i_attribute
;
70 char symlink
[BEFS_SYMLINK_LEN
];
73 struct inode vfs_inode
;
89 /****************************/
92 void befs_error(const struct super_block
*sb
, const char *fmt
, ...);
94 void befs_warning(const struct super_block
*sb
, const char *fmt
, ...);
96 void befs_debug(const struct super_block
*sb
, const char *fmt
, ...);
98 void befs_dump_super_block(const struct super_block
*sb
, befs_super_block
*);
99 void befs_dump_inode(const struct super_block
*sb
, befs_inode
*);
100 void befs_dump_index_entry(const struct super_block
*sb
, befs_disk_btree_super
*);
101 void befs_dump_index_node(const struct super_block
*sb
, befs_btree_nodehead
*);
102 /****************************/
105 /* Gets a pointer to the private portion of the super_block
106 * structure from the public part
108 static inline befs_sb_info
*
109 BEFS_SB(const struct super_block
*super
)
111 return (befs_sb_info
*) super
->s_fs_info
;
114 static inline befs_inode_info
*
115 BEFS_I(const struct inode
*inode
)
117 return list_entry(inode
, struct befs_inode_info
, vfs_inode
);
120 static inline befs_blocknr_t
121 iaddr2blockno(struct super_block
*sb
, befs_inode_addr
* iaddr
)
123 return ((iaddr
->allocation_group
<< BEFS_SB(sb
)->ag_shift
) +
127 static inline befs_inode_addr
128 blockno2iaddr(struct super_block
*sb
, befs_blocknr_t blockno
)
130 befs_inode_addr iaddr
;
131 iaddr
.allocation_group
= blockno
>> BEFS_SB(sb
)->ag_shift
;
133 blockno
- (iaddr
.allocation_group
<< BEFS_SB(sb
)->ag_shift
);
139 static inline unsigned int
140 befs_iaddrs_per_block(struct super_block
*sb
)
142 return BEFS_SB(sb
)->block_size
/ sizeof (befs_disk_inode_addr
);
146 befs_iaddr_is_empty(befs_inode_addr
* iaddr
)
148 return (!iaddr
->allocation_group
) && (!iaddr
->start
) && (!iaddr
->len
);
152 befs_brun_size(struct super_block
*sb
, befs_block_run run
)
154 return BEFS_SB(sb
)->block_size
* run
.len
;
159 #endif /* _LINUX_BEFS_H */