Date: Thu, 15 Jul 2010 11:12:45 GMT From: Zheng Liu <lz@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 180987 for review Message-ID: <201007151112.o6FBCjdG022971@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@180987?ac=10 Change 180987 by lz@gnehzuil-freebsd on 2010/07/15 11:12:04 Implement a ext4 cache. Affected files ... .. //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_extents.c#7 edit .. //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_extents.h#5 edit .. //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_readwrite.c#8 edit Differences ... ==== //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_extents.c#7 (text+ko) ==== @@ -118,6 +118,21 @@ } /* + * put a ext4_extent structure in ext4 cache. + */ +void +ext4_ext_put_cache(struct inode *ip, struct ext4_extent *ep, int type) +{ + struct ext4_extent_cache *ecp; + + ecp = &ip->i_ext_cache; + ecp->ec_type = type; + ecp->ec_blk = ep->e_blk; + ecp->ec_len = ep->e_len; + ecp->ec_start = (((daddr_t)(ep->e_start_hi) << 31) << 1) | ep->e_start_lo; +} + +/* * find a extent. */ struct ext4_extent_path * ==== //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_extents.h#5 (text+ko) ==== @@ -94,8 +94,9 @@ struct inode; struct m_ext2fs; -int ext4_ext_in_cache(struct inode *, daddr_t, struct ext4_extent *); -struct ext4_extent_path *ext4_ext_find_extent(struct m_ext2fs *fs, struct inode *, - daddr_t, struct ext4_extent_path *); +int ext4_ext_in_cache(struct inode *, daddr_t, struct ext4_extent *); +void ext4_ext_put_cache(struct inode *, struct ext4_extent *, int); +struct ext4_extent_path *ext4_ext_find_extent(struct m_ext2fs *fs, struct inode *, + daddr_t, struct ext4_extent_path *); #endif /* !_FS_EXT2FS_EXT2_EXTENTS_H_ */ ==== //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_readwrite.c#8 (text+ko) ==== @@ -122,6 +122,8 @@ if (ep == NULL) return (EIO); + ext4_ext_put_cache(ip, ep, EXT4_EXT_CACHE_IN); + newblk = lbn - ep->e_blk + (ep->e_start_lo | ((daddr_t)(ep->e_start_hi) << 31) << 1); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007151112.o6FBCjdG022971>