diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1996-11-01 08:32:00 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1996-11-01 08:32:00 +0000 |
commit | 0131aa37d796caa1baac655e2518aed44c2d236d (patch) | |
tree | 131419754d3b6a877fa3d194a358c615b9018ca6 | |
parent | bae6cdbc9ca74db68daa1cf4f75c92c89e78920f (diff) |
Pull in changes from Manuel Bouyer
-rw-r--r-- | sys/gnu/ext2fs/ext2_inode_cnv.c | 4 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_lookup.c | 5 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_vfsops.c | 7 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_vnops.c | 24 |
4 files changed, 18 insertions, 22 deletions
diff --git a/sys/gnu/ext2fs/ext2_inode_cnv.c b/sys/gnu/ext2fs/ext2_inode_cnv.c index 24a8269c4d9..b85c3b41b7e 100644 --- a/sys/gnu/ext2fs/ext2_inode_cnv.c +++ b/sys/gnu/ext2fs/ext2_inode_cnv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_inode_cnv.c,v 1.1 1996/06/24 03:34:56 downsj Exp $ */ +/* $OpenBSD: ext2_inode_cnv.c,v 1.2 1996/11/01 08:31:57 downsj Exp $ */ /* * Copyright (c) 1995 The University of Utah and @@ -64,7 +64,7 @@ ext2_print_dinode( di ) printf( /* "Inode: %5d" */ " Type: %10s Mode: 0x%o Flags: 0x%x Version: %d\n", "n/a", di->di_mode, di->di_flags, di->di_gen); - printf( "User: %5d Group: %5d Size: %d\n", + printf( "User: %5d Group: %5d Size: %qu\n", di->di_uid, di->di_gid, di->di_size); printf( "Links: %3d Blockcount: %d\n", di->di_nlink, di->di_blocks); diff --git a/sys/gnu/ext2fs/ext2_lookup.c b/sys/gnu/ext2fs/ext2_lookup.c index 1594adc0600..0925ae47f06 100644 --- a/sys/gnu/ext2fs/ext2_lookup.c +++ b/sys/gnu/ext2fs/ext2_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_lookup.c,v 1.3 1996/10/18 15:23:38 mickey Exp $ */ +/* $OpenBSD: ext2_lookup.c,v 1.4 1996/11/01 08:31:57 downsj Exp $ */ /* * modified for Lites 1.1 @@ -106,6 +106,9 @@ ext2_dirconv2ffs( e2dir, ffsdir) de.d_reclen += 4; de.d_type = DT_UNKNOWN; /* don't know more here */ + if (de.d_name == NULL) panic("ext2: de.d_name\n"); + if (e2dir->name == NULL) panic("ext2: e2dir->name\n"); + if (e2dir->name_len > 500) panic("ext2: e2dir->name_len\n"); strncpy(de.d_name, e2dir->name, e2dir->name_len); de.d_name[de.d_namlen] = '\0'; /* Godmar thinks: since e2dir->rec_len can be big and means diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index 956a834ba90..fadcf8f9965 100644 --- a/sys/gnu/ext2fs/ext2_vfsops.c +++ b/sys/gnu/ext2fs/ext2_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_vfsops.c,v 1.12 1996/10/18 15:23:39 mickey Exp $ */ +/* $OpenBSD: ext2_vfsops.c,v 1.13 1996/11/01 08:31:58 downsj Exp $ */ /* * modified for EXT2FS support in Lites 1.1 @@ -917,11 +917,12 @@ ext2_vget(mp, ino, vpp) struct buf *bp; struct vnode *vp; dev_t dev; - int error; + int i, error; int used_blocks; ump = VFSTOUFS(mp); dev = ump->um_dev; + if ((*vpp = ufs_ihashget(dev, ino)) != NULL) return (0); @@ -984,8 +985,6 @@ ext2_vget(mp, ino, vpp) although for regular files and directories only */ if(S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode)) { - int i; - used_blocks = (ip->i_size+fs->s_blocksize-1) / fs->s_blocksize; for(i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) ip->i_db[i] = 0; diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c index ba3a2375481..ab270362c03 100644 --- a/sys/gnu/ext2fs/ext2_vnops.c +++ b/sys/gnu/ext2fs/ext2_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_vnops.c,v 1.5 1996/10/18 16:02:09 mickey Exp $ */ +/* $OpenBSD: ext2_vnops.c,v 1.6 1996/11/01 08:31:59 downsj Exp $ */ /* * modified for EXT2FS support in Lites 1.1 @@ -81,8 +81,7 @@ int ext2_write __P((void *)); /* Global vfs data structures for ext2fs. */ int (**ext2_vnodeop_p) __P((void *)); -#ifdef notdef -static struct vnodeopv_entry_desc ext2_vnodeop_entries[] = { +struct vnodeopv_entry_desc ext2_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, ext2_lookup }, /* lookup */ { &vop_create_desc, ufs_create }, /* create */ @@ -127,13 +126,11 @@ static struct vnodeopv_entry_desc ext2_vnodeop_entries[] = { { &vop_bwrite_desc, vn_bwrite }, /* bwrite */ { (struct vnodeop_desc*)NULL, (int(*) __P((void*)))NULL } }; -static struct vnodeopv_desc ext2fs_vnodeop_opv_desc = +struct vnodeopv_desc ext2fs_vnodeop_opv_desc = { &ext2_vnodeop_p, ext2_vnodeop_entries }; -#endif int (**ext2_specop_p) __P((void *)); -#ifdef notdef -static struct vnodeopv_entry_desc ext2_specop_entries[] = { +struct vnodeopv_entry_desc ext2_specop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, spec_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create */ @@ -178,14 +175,12 @@ static struct vnodeopv_entry_desc ext2_specop_entries[] = { { &vop_bwrite_desc, vn_bwrite }, /* bwrite */ { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; -static struct vnodeopv_desc ext2fs_specop_opv_desc = +struct vnodeopv_desc ext2fs_specop_opv_desc = { &ext2_specop_p, ext2_specop_entries }; -#endif #ifdef FIFO int (**ext2_fifoop_p) __P((void *)); -#ifdef notdef -static struct vnodeopv_entry_desc ext2_fifoop_entries[] = { +struct vnodeopv_entry_desc ext2_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, fifo_lookup }, /* lookup */ { &vop_create_desc, fifo_create }, /* create */ @@ -230,10 +225,9 @@ static struct vnodeopv_entry_desc ext2_fifoop_entries[] = { { &vop_bwrite_desc, vn_bwrite }, /* bwrite */ { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; -static struct vnodeopv_desc ext2fs_fifoop_opv_desc = +struct vnodeopv_desc ext2fs_fifoop_opv_desc = { &ext2_fifoop_p, ext2_fifoop_entries }; #endif /* FIFO */ -#endif #ifdef DEBUG #ifndef FFS @@ -251,8 +245,8 @@ extern int doclusterwrite; #endif #else /* XXX for ufs_readwrite */ -#define doclusterread 1 -#define doclusterwrite 1 +#define doclusterread 0 +#define doclusterwrite 0 #endif #define EXT2_READWRITE |