diff options
author | Martin Pelikan <pelikan@cvs.openbsd.org> | 2014-07-10 09:24:19 +0000 |
---|---|---|
committer | Martin Pelikan <pelikan@cvs.openbsd.org> | 2014-07-10 09:24:19 +0000 |
commit | 1850b9dc35349bc6e6fe327936774b7dfe1391ae (patch) | |
tree | a39bcc7802962e22b19fc20b0b729f8fa08e0077 /sys | |
parent | c62293857105c9a9a4cbe05013c338556d65fe49 (diff) |
prepare for upcoming ext4 read support
Parts of the on-disk inode changed their meaning in order to support bigger
sizes. More flags & prettification. No functional change.
ok guenther
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs.h | 17 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_dinode.h | 19 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_lookup.c | 8 | ||||
-rw-r--r-- | sys/ufs/ufs/inode.h | 6 |
4 files changed, 34 insertions, 16 deletions
diff --git a/sys/ufs/ext2fs/ext2fs.h b/sys/ufs/ext2fs/ext2fs.h index 523a15be69f..4340f1c3ae9 100644 --- a/sys/ufs/ext2fs/ext2fs.h +++ b/sys/ufs/ext2fs/ext2fs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs.h,v 1.16 2014/05/27 14:31:24 krw Exp $ */ +/* $OpenBSD: ext2fs.h,v 1.17 2014/07/10 09:24:18 pelikan Exp $ */ /* $NetBSD: ext2fs.h,v 1.10 2000/01/28 16:00:23 bouyer Exp $ */ /* @@ -172,22 +172,31 @@ struct m_ext2fs { #define EXT2F_COMPAT_PREALLOC 0x0001 #define EXT2F_COMPAT_HASJOURNAL 0x0004 #define EXT2F_COMPAT_RESIZE 0x0010 +#define EXT2F_COMPAT_DIRHASHINDEX 0x0020 #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 #define EXT2F_ROCOMPAT_LARGEFILE 0x0002 #define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 +#define EXT2F_ROCOMPAT_HUGE_FILE 0x0008 #define EXT2F_INCOMPAT_COMP 0x0001 #define EXT2F_INCOMPAT_FTYPE 0x0002 #define EXT2F_INCOMPAT_RECOVER 0x0004 #define EXT2F_INCOMPAT_JOURNAL_DEV 0x0008 +#define EXT2F_INCOMPAT_META_BG 0x0010 +#define EXT2F_INCOMPAT_EXTENTS 0x0040 +#define EXT2F_INCOMPAT_FLEX_BG 0x0200 /* features supported in this implementation */ #define EXT2F_COMPAT_SUPP 0x0000 -#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER \ - | EXT2F_ROCOMPAT_LARGEFILE) -#define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE +#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ + EXT2F_ROCOMPAT_LARGEFILE) +#define EXT2F_INCOMPAT_SUPP (EXT2F_INCOMPAT_FTYPE) +#define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ + EXT2F_INCOMPAT_FLEX_BG | \ + EXT2F_INCOMPAT_META_BG | \ + EXT2F_INCOMPAT_RECOVER) /* * Definitions of behavior on errors diff --git a/sys/ufs/ext2fs/ext2fs_dinode.h b/sys/ufs/ext2fs/ext2fs_dinode.h index e39dfccdde8..7abe1214cf2 100644 --- a/sys/ufs/ext2fs/ext2fs_dinode.h +++ b/sys/ufs/ext2fs/ext2fs_dinode.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_dinode.h,v 1.13 2013/05/30 19:19:09 guenther Exp $ */ +/* $OpenBSD: ext2fs_dinode.h,v 1.14 2014/07/10 09:24:18 pelikan Exp $ */ /* $NetBSD: ext2fs_dinode.h,v 1.6 2000/01/26 16:21:33 bouyer Exp $ */ /* @@ -81,10 +81,9 @@ struct ext2fs_dinode { 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) */ - u_int32_t e2di_faddr; /* 112: fragment address */ - u_int8_t e2di_nfrag; /* 116: fragment number */ - u_int8_t e2di_fsize; /* 117: fragment size */ - u_int16_t e2di_linux_reserved2; /* 118 */ + u_int32_t e2di_faddr; /* 112: fragment address (obsolete) */ + u_int16_t e2di_nblock_hi; /* 116: Blocks count bits 47:32 */ + u_int16_t e2di_facl_hi; /* 118: file ACL bits 47:32 */ u_int16_t e2di_uid_high; /* 120: 16 highest bits of uid */ u_int16_t e2di_gid_high; /* 122: 16 highest bits of gid */ u_int32_t e2di_linux_reserved3; /* 124 */ @@ -115,9 +114,17 @@ struct ext2fs_dinode { #define EXT2_UNRM 0x00000002 /* Undelete */ #define EXT2_COMPR 0x00000004 /* Compress file */ #define EXT2_SYNC 0x00000008 /* Synchronous updates */ -#define EXT2_IMMUTABLE 0x00000010 /* Immutable file */ +#define EXT2_IMMUTABLE 0x00000010 /* Immutable file */ #define EXT2_APPEND 0x00000020 /* writes to file may only append */ #define EXT2_NODUMP 0x00000040 /* do not dump file */ +#define EXT2_NOATIME 0x00000080 /* do not update access time */ +#define EXT4_INDEX 0x00001000 /* hash-indexed directory */ +#define EXT4_JOURNAL_DATA 0x00004000 /* file data should be journaled */ +#define EXT4_DIRSYNC 0x00010000 /* all dirent updates done synchronously */ +#define EXT4_TOPDIR 0x00020000 /* top of directory hierarchies */ +#define EXT4_HUGE_FILE 0x00040000 /* nblocks unit is fsb, not db */ +#define EXT4_EXTENTS 0x00080000 /* inode uses extents */ +#define EXT4_EOFBLOCKS 0x00400000 /* blocks allocated beyond EOF */ /* Size of on-disk inode. */ #define EXT2_REV0_DINODE_SIZE sizeof(struct ext2fs_dinode) diff --git a/sys/ufs/ext2fs/ext2fs_lookup.c b/sys/ufs/ext2fs/ext2fs_lookup.c index a1be38f5b7c..7e22b94a21d 100644 --- a/sys/ufs/ext2fs/ext2fs_lookup.c +++ b/sys/ufs/ext2fs/ext2fs_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_lookup.c,v 1.31 2014/05/27 14:31:24 krw Exp $ */ +/* $OpenBSD: ext2fs_lookup.c,v 1.32 2014/07/10 09:24:18 pelikan Exp $ */ /* $NetBSD: ext2fs_lookup.c,v 1.16 2000/08/03 20:29:26 thorpej Exp $ */ /* @@ -164,8 +164,8 @@ ext2fs_readdir(void *v) error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred); if (error == 0) { readcnt = e2fs_count - auio.uio_resid; - for (dp = (struct ext2fs_direct *)dirbuf; - (char *)dp < (char *)dirbuf + readcnt; ) { + dp = (struct ext2fs_direct *) dirbuf; + while ((char *) dp < (char *) dirbuf + readcnt) { e2d_reclen = fs2h16(dp->e2d_reclen); if (e2d_reclen == 0) { error = EIO; @@ -263,6 +263,7 @@ ext2fs_lookup(void *v) dp = VTOI(vdp); lockparent = flags & LOCKPARENT; wantparent = flags & (LOCKPARENT|WANTPARENT); + /* * Check accessiblity of directory. */ @@ -334,6 +335,7 @@ searchloop: if ((dp->i_offset & bmask) == 0) { if (bp != NULL) brelse(bp); + error = ext2fs_bufatoff(dp, (off_t)dp->i_offset, NULL, &bp); if (error != 0) diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index d7989992237..f714560721a 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -1,4 +1,4 @@ -/* $OpenBSD: inode.h,v 1.45 2014/05/07 02:57:41 guenther Exp $ */ +/* $OpenBSD: inode.h,v 1.46 2014/07/10 09:24:18 pelikan Exp $ */ /* $NetBSD: inode.h,v 1.8 1995/06/15 23:22:50 cgd Exp $ */ /* @@ -235,8 +235,8 @@ struct inode_vtbl { #define i_e2fs_facl i_e2din->e2di_facl #define i_e2fs_dacl i_e2din->e2di_dacl #define i_e2fs_faddr i_e2din->e2di_faddr -#define i_e2fs_nfrag i_e2din->e2di_nfrag -#define i_e2fs_fsize i_e2din->e2di_fsize +#define i_e2fs_nblock_hi i_e2din->e2di_nblock_hi +#define i_e2fs_faddr_hi i_e2din->e2di_faddr_hi #define i_e2fs_uid_low i_e2din->e2di_uid_low #define i_e2fs_gid_low i_e2din->e2di_gid_low #define i_e2fs_uid_high i_e2din->e2di_uid_high |