diff options
author | pfg <pfg@FreeBSD.org> | 2013-08-13 15:40:43 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2013-08-13 15:40:43 +0000 |
commit | 1d7e5a040e9e45c0417e66c77735c9dd9fad8ee1 (patch) | |
tree | b9f3dee80edb10d7fdf255006fdc5f23c5e588ba /sys/fs/ext2fs/ext2_extern.h | |
parent | 33afc0388b6fdde2fe8879b8589ed3dfee555904 (diff) | |
download | FreeBSD-src-1d7e5a040e9e45c0417e66c77735c9dd9fad8ee1.zip FreeBSD-src-1d7e5a040e9e45c0417e66c77735c9dd9fad8ee1.tar.gz |
Define ext2fs local types and use them.
Add definitions for e2fs_daddr_t, e4fs_daddr_t in addition
to the already existing e2fs_lbn_t and adjust them for ext4.
Other than making the code more readable these changes should
fix problems related to big filesystems.
Setting the proper types can be tricky so the process was
helped by looking at UFS. In our implementation, logical block
numbers can be negative and the code depends on it. In ext2,
block numbers are unsigned so it is convenient to keep
e2fs_daddr_t unsigned and use the complete 32 bits. In the
case of e4fs_daddr_t, while the value should be unsigned, for
ext4 we only need to support 48 bits so preserving an extra
bit from the sign is not an issue.
While here also drop the ext2_setblock() prototype that was
never used.
Discussed with: mckusick, bde
MFC after: 3 weeks
Diffstat (limited to 'sys/fs/ext2fs/ext2_extern.h')
-rw-r--r-- | sys/fs/ext2fs/ext2_extern.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/fs/ext2fs/ext2_extern.h b/sys/fs/ext2fs/ext2_extern.h index 859a978..b6a7dfca 100644 --- a/sys/fs/ext2fs/ext2_extern.h +++ b/sys/fs/ext2fs/ext2_extern.h @@ -49,24 +49,24 @@ struct vfsconf; struct vnode; int ext2_add_entry(struct vnode *, struct ext2fs_direct_2 *); -int ext2_alloc(struct inode *, - int32_t, int32_t, int, struct ucred *, int32_t *); +int ext2_alloc(struct inode *, daddr_t, e4fs_daddr_t, int, + struct ucred *, e4fs_daddr_t *); int ext2_balloc(struct inode *, e2fs_lbn_t, int, struct ucred *, struct buf **, int); int ext2_blkatoff(struct vnode *, off_t, char **, struct buf **); -void ext2_blkfree(struct inode *, int32_t, long); -int32_t ext2_blkpref(struct inode *, e2fs_lbn_t, int, int32_t *, int32_t); +void ext2_blkfree(struct inode *, e4fs_daddr_t, long); +e4fs_daddr_t ext2_blkpref(struct inode *, e2fs_lbn_t, int, e2fs_daddr_t *, + e2fs_daddr_t); int ext2_bmap(struct vop_bmap_args *); -int ext2_bmaparray(struct vnode *, int32_t, int64_t *, int *, int *); +int ext2_bmaparray(struct vnode *, daddr_t, daddr_t *, int *, int *); void ext2_clusteracct(struct m_ext2fs *, char *, int, daddr_t, int); void ext2_dirbad(struct inode *ip, doff_t offset, char *how); void ext2_ei2i(struct ext2fs_dinode *, struct inode *); -int ext2_getlbns(struct vnode *, int32_t, struct indir *, int *); +int ext2_getlbns(struct vnode *, daddr_t, struct indir *, int *); void ext2_i2ei(struct inode *, struct ext2fs_dinode *); void ext2_itimes(struct vnode *vp); int ext2_reallocblks(struct vop_reallocblks_args *); int ext2_reclaim(struct vop_reclaim_args *); -void ext2_setblock(struct m_ext2fs *, u_char *, int32_t); int ext2_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *); int ext2_update(struct vnode *, int); int ext2_valloc(struct vnode *, int, struct ucred *, struct vnode **); |