1 #include <linux/types.h>
18 #define GET_END_PTR(st,p,sz) ((st *)((char *)(p)+((sz)-sizeof(st))))
19 #define AFFS_GET_HASHENTRY(data,hashkey) be32_to_cpu(((struct dir_front *)data)->hashtable[hashkey])
20 #define AFFS_BLOCK(sb, bh, blk) (AFFS_HEAD(bh)->table[AFFS_SB(sb)->s_hashsize-1-(blk)])
22 #define AFFS_HEAD(bh) ((struct affs_head *)(bh)->b_data)
23 #define AFFS_TAIL(sb, bh) ((struct affs_tail *)((bh)->b_data+(sb)->s_blocksize-sizeof(struct affs_tail)))
24 #define AFFS_ROOT_HEAD(bh) ((struct affs_root_head *)(bh)->b_data)
25 #define AFFS_ROOT_TAIL(sb, bh) ((struct affs_root_tail *)((bh)->b_data+(sb)->s_blocksize-sizeof(struct affs_root_tail)))
26 #define AFFS_DATA_HEAD(bh) ((struct affs_data_head *)(bh)->b_data)
27 #define AFFS_DATA(bh) (((struct affs_data_head *)(bh)->b_data)->data)
29 #define AFFS_CACHE_SIZE PAGE_SIZE
31 #define AFFS_MAX_PREALLOC 32
32 #define AFFS_LC_SIZE (AFFS_CACHE_SIZE/sizeof(u32)/2)
33 #define AFFS_AC_SIZE (AFFS_CACHE_SIZE/sizeof(struct affs_ext_key)/2)
34 #define AFFS_AC_MASK (AFFS_AC_SIZE-1)
48 #define i_hash_lock i_ext_lock
110 #define SF_INTL 0x0001
111 #define SF_BM_VALID 0x0002
112 #define SF_IMMUTABLE 0x0004
113 #define SF_QUIET 0x0008
114 #define SF_SETUID 0x0010
115 #define SF_SETGID 0x0020
116 #define SF_SETMODE 0x0040
117 #define SF_MUFS 0x0100
118 #define SF_OFS 0x0200
119 #define SF_PREFIX 0x0400
120 #define SF_VERBOSE 0x0800
164 const char *symname);
210 static inline struct buffer_head *
213 pr_debug(
"affs_bread: %d\n", block);
214 if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size)
215 return sb_bread(sb, block);
218 static inline struct buffer_head *
221 pr_debug(
"affs_getblk: %d\n", block);
222 if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size)
223 return sb_getblk(sb, block);
226 static inline struct buffer_head *
229 struct buffer_head *bh;
230 pr_debug(
"affs_getzeroblk: %d\n", block);
231 if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size) {
232 bh = sb_getblk(sb, block);
235 set_buffer_uptodate(bh);
241 static inline struct buffer_head *
242 affs_getemptyblk(
struct super_block *sb,
int block)
244 struct buffer_head *bh;
245 pr_debug(
"affs_getemptyblk: %d\n", block);
246 if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size) {
247 bh = sb_getblk(sb, block);
249 set_buffer_uptodate(bh);
255 affs_brelse(
struct buffer_head *bh)
258 pr_debug(
"affs_brelse: %lld\n", (
long long) bh->b_blocknr);
263 affs_adjust_checksum(
struct buffer_head *bh,
u32 val)
269 affs_adjust_bitmapchecksum(
struct buffer_head *bh,
u32 val)
278 down(&AFFS_I(inode)->i_link_lock);
281 affs_unlock_link(
struct inode *inode)
283 up(&AFFS_I(inode)->i_link_lock);
286 affs_lock_dir(
struct inode *inode)
291 affs_unlock_dir(
struct inode *inode)
296 affs_lock_ext(
struct inode *inode)
298 down(&AFFS_I(inode)->i_ext_lock);
301 affs_unlock_ext(
struct inode *inode)
303 up(&AFFS_I(inode)->i_ext_lock);