4 * The affs filesystem constants/structures
7 #include <linux/types.h>
9 #define AFFS_SUPER_MAGIC 0xadff
11 /* Get the filesystem block size given an inode. */
12 #define AFFS_I2BSIZE(inode) ((inode)->i_sb->s_blocksize)
14 /* Get the filesystem hash table size given an inode. */
15 #define AFFS_I2HSIZE(inode) ((inode)->i_sb->u.affs_sb.s_hashsize)
17 /* Get the block number bits given an inode */
18 #define AFFS_I2BITS(inode) ((inode)->i_sb->s_blocksize_bits)
20 /* Get the fs type given an inode */
21 #define AFFS_I2FSTYPE(inode) ((inode)->i_sb->u.affs_sb.s_flags & SF_INTL)
30 /* --- Prototypes ----------------------------------------------------------------------------- */
34 extern int affs_get_key_entry(int bsize
, void *data
, int entry_pos
);
35 extern int affs_get_file_name(int bsize
, void *fh_data
, unsigned char **name
);
36 extern u32
affs_checksum_block(int bsize
, void *data
, s32
*ptype
, s32
*stype
);
37 extern void affs_fix_checksum(int bsize
, void *data
, int cspos
);
38 extern void secs_to_datestamp(time_t secs
, struct DateStamp
*ds
);
39 extern int prot_to_mode(unsigned int prot
);
40 extern u32
mode_to_prot(int mode
);
41 extern int affs_insert_hash(unsigned long dir_ino
, struct buffer_head
*header
,
43 extern int affs_remove_hash(struct buffer_head
*bh
, struct inode
*inode
);
44 extern int affs_remove_link(struct buffer_head
*bh
, struct inode
*inode
);
45 extern int affs_remove_header(struct buffer_head
*bh
, struct inode
*inode
);
46 extern void affs_error(struct super_block
*sb
, const char *function
, const char *fmt
, ...);
47 extern void affs_warning(struct super_block
*sb
, const char *function
, const char *fmt
, ...);
48 extern int affs_check_name(const unsigned char *name
, int len
);
49 extern int affs_copy_name(unsigned char *bstr
, const unsigned char *name
);
53 extern int affs_count_free_blocks(struct super_block
*s
);
54 extern int affs_count_free_bits(int blocksize
, const char *data
);
55 extern void affs_free_block(struct super_block
*sb
, s32 block
);
56 extern s32
affs_new_header(struct inode
*inode
);
57 extern s32
affs_new_data(struct inode
*inode
);
58 extern void affs_make_zones(struct super_block
*sb
);
62 extern int affs_hash_name(const unsigned char *name
, int len
, int intl
, int hashsize
);
63 extern struct dentry
*affs_lookup(struct inode
*dir
, struct dentry
*dentry
);
64 extern int affs_unlink(struct inode
*dir
, struct dentry
*dentry
);
65 extern int affs_create(struct inode
*dir
, struct dentry
*dentry
, int mode
);
66 extern int affs_mkdir(struct inode
*dir
, struct dentry
*dentry
, int mode
);
67 extern int affs_rmdir(struct inode
*dir
, struct dentry
*dentry
);
68 extern int affs_link(struct dentry
*olddentry
, struct inode
*dir
,
69 struct dentry
*dentry
);
70 extern int affs_symlink(struct inode
*dir
, struct dentry
*dentry
,
72 extern int affs_rename(struct inode
*old_dir
, struct dentry
*old_dentry
,
73 struct inode
*new_dir
, struct dentry
*new_dentry
);
77 extern struct buffer_head
*affs_bread(kdev_t dev
, int block
, int size
);
78 extern void affs_brelse(struct buffer_head
*buf
);
79 extern unsigned long affs_parent_ino(struct inode
*dir
);
80 extern struct inode
*affs_new_inode(const struct inode
*dir
);
81 extern int affs_notify_change(struct dentry
*dentry
, struct iattr
*attr
);
82 extern int affs_add_entry(struct inode
*dir
, struct inode
*link
,
83 struct inode
*inode
, struct dentry
*dentry
, s32 type
);
84 extern void affs_put_inode(struct inode
*inode
);
85 extern void affs_delete_inode(struct inode
*inode
);
86 extern void affs_read_inode(struct inode
*inode
);
87 extern void affs_write_inode(struct inode
*inode
, int);
91 extern int affs_fs(void);
95 void affs_free_prealloc(struct inode
*inode
);
96 extern void affs_truncate(struct inode
*);
100 extern void affs_dir_truncate(struct inode
*);
104 extern struct inode_operations affs_file_inode_operations
;
105 extern struct inode_operations affs_dir_inode_operations
;
106 extern struct inode_operations affs_symlink_inode_operations
;
107 extern struct file_operations affs_file_operations
;
108 extern struct file_operations affs_file_operations_ofs
;
109 extern struct file_operations affs_dir_operations
;
110 extern struct address_space_operations affs_symlink_aops
;
111 extern struct address_space_operations affs_aops
;
113 extern struct dentry_operations affs_dentry_operations
;
114 extern struct dentry_operations affs_dentry_operations_intl
;
116 extern int affs_bmap(struct inode
*, int);