From owner-p4-projects@FreeBSD.ORG Sat Jun 13 15:12:03 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 27605106566B; Sat, 13 Jun 2009 15:12:03 +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 DB37A106566C for ; Sat, 13 Jun 2009 15:12:02 +0000 (UTC) (envelope-from truncs@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C8CBD8FC1B for ; Sat, 13 Jun 2009 15:12:02 +0000 (UTC) (envelope-from truncs@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DFC2I5086936 for ; Sat, 13 Jun 2009 15:12:02 GMT (envelope-from truncs@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5DFC2qm086934 for perforce@freebsd.org; Sat, 13 Jun 2009 15:12:02 GMT (envelope-from truncs@FreeBSD.org) Date: Sat, 13 Jun 2009 15:12:02 GMT Message-Id: <200906131512.n5DFC2qm086934@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to truncs@FreeBSD.org using -f From: Aditya Sarawgi To: Perforce Change Reviews Cc: Subject: PERFORCE change 164278 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 15:12:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=164278 Change 164278 by truncs@aditya on 2009/06/13 15:11:42 Renaming to the new on disk inode struct. Affected files ... .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_extern.h#5 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_fs.h#19 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_inode.c#4 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_inode_cnv.c#5 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c#8 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#11 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/fs.h#8 edit Differences ... ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_extern.h#5 (text+ko) ==== @@ -39,7 +39,7 @@ #ifndef _SYS_GNU_EXT2FS_EXT2_EXTERN_H_ #define _SYS_GNU_EXT2FS_EXT2_EXTERN_H_ -struct ext2_inode; +struct ext2fs_dinode; struct indir; struct inode; struct mount; @@ -56,9 +56,9 @@ int ext2_bmap(struct vop_bmap_args *); int ext2_bmaparray(struct vnode *, int32_t, int32_t *, int *, int *); void ext2_dirbad(struct inode *ip, doff_t offset, char *how); -void ext2_ei2i(struct ext2_inode *, struct inode *); +void ext2_ei2i(struct ext2fs_dinode *, struct inode *); int ext2_getlbns(struct vnode *, int32_t, struct indir *, int *); -void ext2_i2ei(struct inode *, struct ext2_inode *); +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 *); ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_fs.h#19 (text+ko) ==== @@ -272,7 +272,7 @@ u_int32_t e2di_nblock; /* 28: Blocks count */ u_int32_t e2di_flags; /* 32: Status flags (chflags) */ u_int32_t e2di_linux_reserved1; /* 36 */ - u_int32_t e2di_blocks[NDADDR+NIADDR]; /* 40: disk blocks */ + u_int32_t e2di_blocks[EXT2_N_BLOCKS]; /* 40: disk blocks */ u_int32_t e2di_gen; /* 100: generation number */ u_int32_t e2di_facl; /* 104: file ACL (not implemented) */ u_int32_t e2di_dacl; /* 108: dir ACL (not implemented) */ @@ -287,7 +287,7 @@ -#define i_size_high i_dir_acl +#define e2di_size_high e2di_dacl /* ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_inode.c#4 (text+ko) ==== @@ -89,7 +89,7 @@ brelse(bp); return (error); } - ext2_i2ei(ip, (struct ext2_inode *)((char *)bp->b_data + + ext2_i2ei(ip, (struct ext2fs_dinode *)((char *)bp->b_data + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number))); if (waitfor && (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) == 0) return (bwrite(bp)); ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_inode_cnv.c#5 (text+ko) ==== @@ -64,36 +64,36 @@ */ void ext2_ei2i(ei, ip) - struct ext2_inode *ei; + struct ext2fs_dinode *ei; struct inode *ip; { int i; - ip->i_nlink = ei->i_links_count; + ip->i_nlink = ei->e2di_nlink; /* Godmar thinks - if the link count is zero, then the inode is unused - according to ext2 standards. Ufs marks this fact by setting i_mode to zero - why ? I can see that this might lead to problems in an undelete. */ - ip->i_mode = ei->i_links_count ? ei->i_mode : 0; - ip->i_size = ei->i_size; + ip->i_mode = ei->e2di_nlink ? ei->e2di_mode : 0; + ip->i_size = ei->e2di_size; if (S_ISREG(ip->i_mode)) - ip->i_size |= ((u_int64_t)ei->i_size_high) << 32; - ip->i_atime = ei->i_atime; - ip->i_mtime = ei->i_mtime; - ip->i_ctime = ei->i_ctime; + ip->i_size |= ((u_int64_t)ei->e2di_size_high) << 32; + ip->i_atime = ei->e2di_atime; + ip->i_mtime = ei->e2di_mtime; + ip->i_ctime = ei->e2di_ctime; ip->i_flags = 0; - ip->i_flags |= (ei->i_flags & EXT2_APPEND_FL) ? SF_APPEND : 0; - ip->i_flags |= (ei->i_flags & EXT2_IMMUTABLE_FL) ? SF_IMMUTABLE : 0; - ip->i_blocks = ei->i_blocks; - ip->i_gen = ei->i_generation; - ip->i_uid = ei->i_uid; - ip->i_gid = ei->i_gid; + ip->i_flags |= (ei->e2di_flags & EXT2_APPEND_FL) ? SF_APPEND : 0; + ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE_FL) ? SF_IMMUTABLE : 0; + ip->i_blocks = ei->e2di_nblock; + ip->i_gen = ei->e2di_gen; + ip->i_uid = ei->e2di_uid; + ip->i_gid = ei->e2di_gid; /* XXX use memcpy */ for(i = 0; i < NDADDR; i++) - ip->i_db[i] = ei->i_block[i]; + ip->i_db[i] = ei->e2di_blocks[i]; for(i = 0; i < NIADDR; i++) - ip->i_ib[i] = ei->i_block[EXT2_NDIR_BLOCKS + i]; + ip->i_ib[i] = ei->e2di_blocks[EXT2_NDIR_BLOCKS + i]; } /* @@ -102,34 +102,34 @@ void ext2_i2ei(ip, ei) struct inode *ip; - struct ext2_inode *ei; + struct ext2fs_dinode *ei; { int i; - ei->i_mode = ip->i_mode; - ei->i_links_count = ip->i_nlink; + ei->e2di_mode = ip->i_mode; + ei->e2di_nlink = ip->i_nlink; /* Godmar thinks: if dtime is nonzero, ext2 says this inode has been deleted, this would correspond to a zero link count */ - ei->i_dtime = ei->i_links_count ? 0 : ip->i_mtime; - ei->i_size = ip->i_size; + ei->e2di_dtime = ei->e2di_nlink ? 0 : ip->i_mtime; + ei->e2di_size = ip->i_size; if (S_ISREG(ip->i_mode)) - ei->i_size_high = ip->i_size >> 32; - ei->i_atime = ip->i_atime; - ei->i_mtime = ip->i_mtime; - ei->i_ctime = ip->i_ctime; - ei->i_flags = ip->i_flags; - ei->i_flags = 0; - ei->i_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND_FL: 0; - ei->i_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE_FL: 0; - ei->i_blocks = ip->i_blocks; - ei->i_generation = ip->i_gen; - ei->i_uid = ip->i_uid; - ei->i_gid = ip->i_gid; + ei->e2di_size_high = ip->i_size >> 32; + ei->e2di_atime = ip->i_atime; + ei->e2di_mtime = ip->i_mtime; + ei->e2di_ctime = ip->i_ctime; + ei->e2di_flags = ip->i_flags; + ei->e2di_flags = 0; + ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND_FL: 0; + ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE_FL: 0; + ei->e2di_nblock = ip->i_blocks; + ei->e2di_gen = ip->i_gen; + ei->e2di_uid = ip->i_uid; + ei->e2di_gid = ip->i_gid; /* XXX use memcpy */ for(i = 0; i < NDADDR; i++) - ei->i_block[i] = ip->i_db[i]; + ei->e2di_blocks[i] = ip->i_db[i]; for(i = 0; i < NIADDR; i++) - ei->i_block[EXT2_NDIR_BLOCKS + i] = ip->i_ib[i]; + ei->e2di_blocks[EXT2_NDIR_BLOCKS + i] = ip->i_ib[i]; } ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c#8 (text+ko) ==== @@ -270,7 +270,7 @@ { unsigned long inode_block; struct buffer_head * bh; - struct ext2_inode * raw_inode; + struct ext2fs_dinode * raw_inode; inode_block = gdp->ext2bgd_i_tables + (((inode->i_number - 1) % (inode->i_sb->e2fs_ipg) /(inode->i_sb->e2fs_ipb))); @@ -282,7 +282,7 @@ inode->u.ext2_i.i_version = 1; return; } - raw_inode = ((struct ext2_inode *) bh->b_data) + + raw_inode = ((struct ext2fs_dinode *) bh->b_data) + (((inode->i_number - 1) % (inode->i_sb->e2fs_ipg)) % (inode->i_sb->e2fs_ipb)); raw_inode->i_version++; ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#11 (text+ko) ==== @@ -560,7 +560,7 @@ MNT_VNODE_FOREACH_ABORT(mp, mvp); return (error); } - ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data + + ext2_ei2i((struct ext2fs_dinode *) ((char *)bp->b_data + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)), ip); brelse(bp); VOP_UNLOCK(vp, 0); @@ -985,7 +985,7 @@ return (error); } /* convert ext2 inode to dinode */ - ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data + EXT2_INODE_SIZE(fs) * + ext2_ei2i((struct ext2fs_dinode *) ((char *)bp->b_data + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ino)), ip); ip->i_block_group = ino_to_cg(fs, ino); ip->i_next_alloc_block = 0; ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/fs.h#8 (text+ko) ====