From owner-p4-projects@FreeBSD.ORG Sat Jun 26 07:10:31 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ECB971065673; Sat, 26 Jun 2010 07:10:30 +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 B1242106566C for ; Sat, 26 Jun 2010 07:10:30 +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 9E3868FC17 for ; Sat, 26 Jun 2010 07:10:30 +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 o5Q7AUOR057126 for ; Sat, 26 Jun 2010 07:10:30 GMT (envelope-from lz@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o5Q7AUsA057124 for perforce@freebsd.org; Sat, 26 Jun 2010 07:10:30 GMT (envelope-from lz@FreeBSD.org) Date: Sat, 26 Jun 2010 07:10:30 GMT Message-Id: <201006260710.o5Q7AUsA057124@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 180233 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: Sat, 26 Jun 2010 07:10:31 -0000 http://p4web.freebsd.org/@@180233?ac=10 Change 180233 by lz@gnehzuil-freebsd on 2010/06/26 07:10:18 Modify ext2_vget to adapt ext4 file system. Affected files ... .. //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_dinode.h#3 edit .. //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_inode_cnv.c#3 edit .. //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_vfsops.c#3 edit .. //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/inode.h#3 edit Differences ... ==== //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_dinode.h#3 (text+ko) ==== @@ -63,14 +63,14 @@ struct ext2fs_dinode { u_int16_t e2di_mode; /* 0: IFMT, permissions; see below. */ u_int16_t e2di_uid; /* 2: Owner UID */ - u_int32_t e2di_size; /* 4: Size (in bytes) */ + u_int32_t e2di_size_lo; /* 4: Size (in bytes) */ u_int32_t e2di_atime; /* 8: Access time */ u_int32_t e2di_ctime; /* 12: Create time */ u_int32_t e2di_mtime; /* 16: Modification time */ u_int32_t e2di_dtime; /* 20: Deletion time */ u_int16_t e2di_gid; /* 24: Owner GID */ u_int16_t e2di_nlink; /* 26: File link count */ - u_int32_t e2di_nblock; /* 28: Blocks count */ + u_int32_t e2di_nblock_lo; /* 28: Blocks count */ u_int32_t e2di_flags; /* 32: Status flags (chflags) */ union { struct { @@ -92,6 +92,7 @@ union { struct { u_int16_t e2di_l_blk_high; +#define e2di_nblock_high osd2.linux2.e2di_l_blk_high u_int16_t e2di_l_facl_high; u_int16_t e2di_l_uid_high; u_int16_t e2di_l_gid_high; ==== //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_inode_cnv.c#3 (text+ko) ==== @@ -49,7 +49,7 @@ printf( "User: %5lu Group: %5lu Size: %lu\n", (unsigned long)in->i_uid, (unsigned long)in->i_gid, (unsigned long)in->i_size); - printf( "Links: %3d Blockcount: %d\n", + printf( "Links: %3d Blockcount: %lld\n", in->i_nlink, in->i_blocks); printf( "ctime: 0x%x", in->i_ctime); printf( "atime: 0x%x", in->i_atime); @@ -77,7 +77,7 @@ I can see that this might lead to problems in an undelete. */ ip->i_mode = ei->e2di_nlink ? ei->e2di_mode : 0; - ip->i_size = ei->e2di_size; + ip->i_size = ei->e2di_size_lo; if (S_ISREG(ip->i_mode)) ip->i_size |= ((u_int64_t)ei->e2di_size_high) << 32; ip->i_atime = ei->e2di_atime; @@ -87,7 +87,10 @@ ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0; ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0; ip->i_flags |= (ei->e2di_flags & EXT2_NODUMP) ? UF_NODUMP : 0; - ip->i_blocks = ei->e2di_nblock; + if (ip->i_e2fs->e2fs->e2fs_features_incompat & EXT4F_ROCOMPAT_HUGE_FILE) + ip->i_blocks = ((int64_t)(ei->e2di_nblock_high)) << 32 | ei->e2di_nblock_lo; + else + ip->i_blocks = ei->e2di_nblock_lo; ip->i_gen = ei->e2di_gen; ip->i_uid = ei->e2di_uid; ip->i_gid = ei->e2di_gid; @@ -115,7 +118,7 @@ has been deleted, this would correspond to a zero link count */ ei->e2di_dtime = ei->e2di_nlink ? 0 : ip->i_mtime; - ei->e2di_size = ip->i_size; + ei->e2di_size_lo = ip->i_size; if (S_ISREG(ip->i_mode)) ei->e2di_size_high = ip->i_size >> 32; ei->e2di_atime = ip->i_atime; @@ -126,7 +129,7 @@ ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0; ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0; ei->e2di_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP: 0; - ei->e2di_nblock = ip->i_blocks; + ei->e2di_nblock_lo = ip->i_blocks; ei->e2di_gen = ip->i_gen; ei->e2di_uid = ip->i_uid; ei->e2di_gid = ip->i_gid; ==== //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_vfsops.c#3 (text+ko) ==== @@ -61,6 +61,8 @@ #include #include #include +#include + static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); static int ext2_mountfs(struct vnode *, struct mount *); @@ -945,6 +947,7 @@ for(i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) ip->i_db[i] = 0; } + /* ext2_print_inode(ip); */ ==== //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/inode.h#3 (text+ko) ==== @@ -97,7 +97,7 @@ int32_t i_db[NDADDR]; /* Direct disk blocks. */ int32_t i_ib[NIADDR]; /* Indirect disk blocks. */ u_int32_t i_flags; /* Status flags (chflags). */ - int32_t i_blocks; /* Blocks actually held. */ + int64_t i_blocks; /* Blocks actually held. */ int32_t i_gen; /* Generation number. */ u_int32_t i_uid; /* File owner. */ u_int32_t i_gid; /* File group. */