From owner-p4-projects@FreeBSD.ORG Thu Jul 15 11:12:46 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E3A1A1065675; Thu, 15 Jul 2010 11:12:45 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A82C5106564A for ; Thu, 15 Jul 2010 11:12:45 +0000 (UTC) (envelope-from lz@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3248FC19 for ; Thu, 15 Jul 2010 11:12:45 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o6FBCjel022973 for ; Thu, 15 Jul 2010 11:12:45 GMT (envelope-from lz@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o6FBCjdG022971 for perforce@freebsd.org; Thu, 15 Jul 2010 11:12:45 GMT (envelope-from lz@FreeBSD.org) Date: Thu, 15 Jul 2010 11:12:45 GMT Message-Id: <201007151112.o6FBCjdG022971@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to lz@FreeBSD.org using -f From: Zheng Liu To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 180987 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jul 2010 11:12:46 -0000 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); }