ext2_inode_cnv.c (274437) | ext2_inode_cnv.c (294653) |
---|---|
1/*- 2 * Copyright (c) 1995 The University of Utah and 3 * the Computer Systems Laboratory at the University of Utah (CSL). 4 * All rights reserved. 5 * 6 * Permission to use, copy, modify and distribute this software is hereby 7 * granted provided that (1) source code retains these copyright, permission, 8 * and disclaimer notices, and (2) redistributions including binaries --- 5 unchanged lines hidden (view full) --- 14 * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS 15 * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF 16 * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 17 * 18 * CSL requests users of this software to return to csl-dist@cs.utah.edu any 19 * improvements that they make and grant CSL redistribution rights. 20 * 21 * Utah $Hdr$ | 1/*- 2 * Copyright (c) 1995 The University of Utah and 3 * the Computer Systems Laboratory at the University of Utah (CSL). 4 * All rights reserved. 5 * 6 * Permission to use, copy, modify and distribute this software is hereby 7 * granted provided that (1) source code retains these copyright, permission, 8 * and disclaimer notices, and (2) redistributions including binaries --- 5 unchanged lines hidden (view full) --- 14 * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS 15 * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF 16 * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 17 * 18 * CSL requests users of this software to return to csl-dist@cs.utah.edu any 19 * improvements that they make and grant CSL redistribution rights. 20 * 21 * Utah $Hdr$ |
22 * $FreeBSD: head/sys/fs/ext2fs/ext2_inode_cnv.c 274437 2014-11-12 16:23:56Z pfg $ | 22 * $FreeBSD: head/sys/fs/ext2fs/ext2_inode_cnv.c 294653 2016-01-24 02:41:49Z pfg $ |
23 */ 24 25/* 26 * routines to convert on disk ext2 inodes into inodes and back 27 */ 28#include <sys/param.h> 29#include <sys/systm.h> 30#include <sys/endian.h> --- 74 unchanged lines hidden (view full) --- 105 ip->i_ctimensec = XTIME_TO_NSEC(ei->e2di_ctime_extra); 106 ip->i_birthtime = ei->e2di_crtime; 107 ip->i_birthnsec = XTIME_TO_NSEC(ei->e2di_crtime_extra); 108 } 109 ip->i_flags = 0; 110 ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0; 111 ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0; 112 ip->i_flags |= (ei->e2di_flags & EXT2_NODUMP) ? UF_NODUMP : 0; | 23 */ 24 25/* 26 * routines to convert on disk ext2 inodes into inodes and back 27 */ 28#include <sys/param.h> 29#include <sys/systm.h> 30#include <sys/endian.h> --- 74 unchanged lines hidden (view full) --- 105 ip->i_ctimensec = XTIME_TO_NSEC(ei->e2di_ctime_extra); 106 ip->i_birthtime = ei->e2di_crtime; 107 ip->i_birthnsec = XTIME_TO_NSEC(ei->e2di_crtime_extra); 108 } 109 ip->i_flags = 0; 110 ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0; 111 ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0; 112 ip->i_flags |= (ei->e2di_flags & EXT2_NODUMP) ? UF_NODUMP : 0; |
113 ip->i_flag |= (ei->e2di_flags & EXT4_INDEX) ? IN_E4INDEX : 0; | 113 ip->i_flag |= (ei->e2di_flags & EXT3_INDEX) ? IN_E3INDEX : 0; |
114 ip->i_flag |= (ei->e2di_flags & EXT4_EXTENTS) ? IN_E4EXTENTS : 0; 115 ip->i_blocks = ei->e2di_nblock; 116 if (E2DI_HAS_HUGE_FILE(ip)) { 117 ip->i_blocks |= (uint64_t)ei->e2di_nblock_high << 32; 118 if (ei->e2di_flags & EXT4_HUGE_FILE) 119 ip->i_blocks = fsbtodb(ip->i_e2fs, ip->i_blocks); 120 } 121 ip->i_gen = ei->e2di_gen; --- 33 unchanged lines hidden (view full) --- 155 ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec); 156 ei->e2di_crtime = ip->i_birthtime; 157 ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec); 158 } 159 ei->e2di_flags = 0; 160 ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0; 161 ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0; 162 ei->e2di_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP: 0; | 114 ip->i_flag |= (ei->e2di_flags & EXT4_EXTENTS) ? IN_E4EXTENTS : 0; 115 ip->i_blocks = ei->e2di_nblock; 116 if (E2DI_HAS_HUGE_FILE(ip)) { 117 ip->i_blocks |= (uint64_t)ei->e2di_nblock_high << 32; 118 if (ei->e2di_flags & EXT4_HUGE_FILE) 119 ip->i_blocks = fsbtodb(ip->i_e2fs, ip->i_blocks); 120 } 121 ip->i_gen = ei->e2di_gen; --- 33 unchanged lines hidden (view full) --- 155 ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec); 156 ei->e2di_crtime = ip->i_birthtime; 157 ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec); 158 } 159 ei->e2di_flags = 0; 160 ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0; 161 ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0; 162 ei->e2di_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP: 0; |
163 ei->e2di_flags |= (ip->i_flag & IN_E4INDEX) ? EXT4_INDEX: 0; | 163 ei->e2di_flags |= (ip->i_flag & IN_E3INDEX) ? EXT3_INDEX: 0; |
164 ei->e2di_flags |= (ip->i_flag & IN_E4EXTENTS) ? EXT4_EXTENTS: 0; 165 ei->e2di_nblock = ip->i_blocks & 0xffffffff; 166 ei->e2di_nblock_high = ip->i_blocks >> 32 & 0xffff; 167 ei->e2di_gen = ip->i_gen; 168 ei->e2di_uid = ip->i_uid; 169 ei->e2di_gid = ip->i_gid; 170 /* XXX use memcpy */ 171 for(i = 0; i < NDADDR; i++) 172 ei->e2di_blocks[i] = ip->i_db[i]; 173 for(i = 0; i < NIADDR; i++) 174 ei->e2di_blocks[EXT2_NDIR_BLOCKS + i] = ip->i_ib[i]; 175} | 164 ei->e2di_flags |= (ip->i_flag & IN_E4EXTENTS) ? EXT4_EXTENTS: 0; 165 ei->e2di_nblock = ip->i_blocks & 0xffffffff; 166 ei->e2di_nblock_high = ip->i_blocks >> 32 & 0xffff; 167 ei->e2di_gen = ip->i_gen; 168 ei->e2di_uid = ip->i_uid; 169 ei->e2di_gid = ip->i_gid; 170 /* XXX use memcpy */ 171 for(i = 0; i < NDADDR; i++) 172 ei->e2di_blocks[i] = ip->i_db[i]; 173 for(i = 0; i < NIADDR; i++) 174 ei->e2di_blocks[EXT2_NDIR_BLOCKS + i] = ip->i_ib[i]; 175} |