Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Sep 1997 12:15:33 +0900
From:      KATO Takenori <kato@migmatite.eps.nagoya-u.ac.jp>
To:        jkh@time.cdrom.com
Cc:        current@FreeBSD.org
Subject:   Re: Daily SNAPshots at current.freebsd.org shut down for now. 
Message-ID:  <199709250315.MAA05717@gneiss.eps.nagoya-u.ac.jp>
In-Reply-To: Your message of "Wed, 24 Sep 1997 10:32:57 -0700"
References:  <29170.875122377@time.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I Cc'ed to current.

> Can you give me a -current patch?  That's actually what matters

Here is a patch which I don't perform compile test (sorry).

---------- BEGIN ----------
*** sys/dev/vn/vn.c.ORIG	Thu Sep 25 09:10:44 1997
--- sys/dev/vn/vn.c	Thu Sep 25 09:31:01 1997
***************
*** 403,409 ****
  	struct nameidata nd;
  	int error;
  	u_long *f;
! 
  
  	IFOPT(vn,VN_FOLLOW)
  		printf("vnioctl(0x%lx, 0x%x, %p, 0x%x, %p): unit %d\n",
--- 403,409 ----
  	struct nameidata nd;
  	int error;
  	u_long *f;
! 	u_long vflag = 0;
  
  	IFOPT(vn,VN_FOLLOW)
  		printf("vnioctl(0x%lx, 0x%x, %p, 0x%x, %p): unit %d\n",
***************
*** 411,416 ****
--- 411,417 ----
  
  	switch (cmd) {
  	case VNIOCATTACH:
+ 	case VNIOCATTACHNCLUSTER:
  	case VNIOCDETACH:
  	case VNIOCGSET:
  	case VNIOCGCLEAR:
***************
*** 442,447 ****
--- 443,451 ----
  	f = (u_long*)data;
  	switch (cmd) {
  
+ 	case VNIOCATTACHNCLUSTER:
+ 		vflag = VNOCLUSTER;
+ 		/* FALLTHROUGH */
  	case VNIOCATTACH:
  		if (vn->sc_flags & VNF_INITED)
  			return(EBUSY);
***************
*** 463,468 ****
--- 467,473 ----
  		}
  		VOP_UNLOCK(nd.ni_vp, 0, p);
  		vn->sc_vp = nd.ni_vp;
+ 		vn->sc_vp->v_flag |= vflag;
  		vn->sc_size = btodb(vattr.va_size);	/* note truncation */
  		error = vnsetcred(vn, p->p_ucred);
  		if (error) {
*** sys/gnu/ext2fs/ext2_readwrite.c.ORIG	Thu Sep 25 09:25:09 1997
--- sys/gnu/ext2fs/ext2_readwrite.c	Thu Sep 25 09:34:25 1997
***************
*** 112,118 ****
  
  		if (lblktosize(fs, nextlbn) >= ip->i_size)
  			error = bread(vp, lbn, size, NOCRED, &bp);
! 		else if (ext2_doclusterread)
  			error = cluster_read(vp,
  			    ip->i_size, lbn, size, NOCRED,
  				uio->uio_resid, (ap->a_ioflag >> 16), &bp);
--- 112,118 ----
  
  		if (lblktosize(fs, nextlbn) >= ip->i_size)
  			error = bread(vp, lbn, size, NOCRED, &bp);
! 		else if (ext2_doclusterread && !(vp->v_flag & VNOCLUSTER))
  			error = cluster_read(vp,
  			    ip->i_size, lbn, size, NOCRED,
  				uio->uio_resid, (ap->a_ioflag >> 16), &bp);
***************
*** 277,283 ****
  		if (ioflag & IO_SYNC) {
  			(void)bwrite(bp);
  		} else if (xfersize + blkoffset == fs->s_frag_size) {
! 			if (ext2_doclusterwrite) {
  #if defined(__FreeBSD__)
  				bp->b_flags |= B_CLUSTEROK;
  #endif
--- 277,283 ----
  		if (ioflag & IO_SYNC) {
  			(void)bwrite(bp);
  		} else if (xfersize + blkoffset == fs->s_frag_size) {
! 			if (ext2_doclusterwrite && !(vp->v_flag & VNOCLUSTER)) {
  #if defined(__FreeBSD__)
  				bp->b_flags |= B_CLUSTEROK;
  #endif
*** sys/isofs/cd9660/cd9660_vnops.c.ORIG	Thu Sep 25 09:35:11 1997
--- sys/isofs/cd9660/cd9660_vnops.c	Thu Sep 25 09:36:30 1997
***************
*** 344,350 ****
  			n = diff;
  		size = blksize(imp, ip, lbn);
  		rablock = lbn + 1;
! 		if (cd9660_doclusterread) {
  			if (lblktosize(imp, rablock) <= ip->i_size)
  				error = cluster_read(vp, (off_t)ip->i_size,
  				         lbn, size, NOCRED, uio->uio_resid,
--- 344,350 ----
  			n = diff;
  		size = blksize(imp, ip, lbn);
  		rablock = lbn + 1;
! 		if (cd9660_doclusterread && !(vp->v_flag & VNOCLUSTER)) {
  			if (lblktosize(imp, rablock) <= ip->i_size)
  				error = cluster_read(vp, (off_t)ip->i_size,
  				         lbn, size, NOCRED, uio->uio_resid,
*** sys/sys/vnioctl.h.ORIG	Thu Sep 25 09:24:42 1997
--- sys/sys/vnioctl.h	Thu Sep 25 09:30:28 1997
***************
*** 66,71 ****
--- 66,73 ----
  #define VNIOCGCLEAR	_IOWR('F', 3, u_long )		/* reset --//-- */
  #define VNIOCUSET	_IOWR('F', 4, u_long )		/* set unit option */
  #define VNIOCUCLEAR	_IOWR('F', 5, u_long )		/* reset --//-- */
+ #define VNIOCATTACHNCLUSTER	_IOWR('F', 6, struct vn_ioctl)
+ 				/* attach file, disable cluster read/write */
  
  #define VN_LABELS	0x1	/* Use disk(/slice) labels */
  #define VN_FOLLOW	0x2	/* Debug flow in vn driver */
*** sys/sys/vnode.h.ORIG	Thu Sep 25 09:28:11 1997
--- sys/sys/vnode.h	Thu Sep 25 09:29:54 1997
***************
*** 127,148 ****
  /*
   * Vnode flags.
   */
! #define	VROOT		0x00001	/* root of its file system */
! #define	VTEXT		0x00002	/* vnode is a pure text prototype */
! #define	VSYSTEM		0x00004	/* vnode being used by kernel */
! #define	VISTTY		0x00008	/* vnode represents a tty */
! #define	VXLOCK		0x00100	/* vnode is locked to change underlying type */
! #define	VXWANT		0x00200	/* process is waiting for vnode */
! #define	VBWAIT		0x00400	/* waiting for output to complete */
! #define	VALIASED	0x00800	/* vnode has an alias */
! #define	VDIROP		0x01000	/* LFS: vnode is involved in a directory op */
! #define	VVMIO		0x02000	/* VMIO flag */
! #define	VNINACT		0x04000	/* LFS: skip ufs_inactive() in lfs_vunref */
! #define	VAGE		0x08000	/* Insert vnode at head of free list */
! #define	VOLOCK		0x10000	/* vnode is locked waiting for an object */
! #define	VOWANT		0x20000	/* a process is waiting for VOLOCK */
! #define	VDOOMED		0x40000	/* This vnode is being recycled */
! #define	VFREE		0x80000	/* This vnode is on the freelist */
  
  /*
   * Vnode attributes.  A field value of VNOVAL represents a field whose value
--- 127,149 ----
  /*
   * Vnode flags.
   */
! #define	VROOT		0x000001	/* root of its file system */
! #define	VTEXT		0x000002	/* vnode is a pure text prototype */
! #define	VSYSTEM		0x000004	/* vnode being used by kernel */
! #define	VISTTY		0x000008	/* vnode represents a tty */
! #define	VXLOCK		0x000100	/* vnode is locked to change underlying type */
! #define	VXWANT		0x000200	/* process is waiting for vnode */
! #define	VBWAIT		0x000400	/* waiting for output to complete */
! #define	VALIASED	0x000800	/* vnode has an alias */
! #define	VDIROP		0x001000	/* LFS: vnode is involved in a directory op */
! #define	VVMIO		0x002000	/* VMIO flag */
! #define	VNINACT		0x004000	/* LFS: skip ufs_inactive() in lfs_vunref */
! #define	VAGE		0x008000	/* Insert vnode at head of free list */
! #define	VOLOCK		0x010000	/* vnode is locked waiting for an object */
! #define	VOWANT		0x020000	/* a process is waiting for VOLOCK */
! #define	VDOOMED		0x040000	/* This vnode is being recycled */
! #define	VFREE		0x080000	/* This vnode is on the freelist */
! #define	VNOCLUSTER	0x100000	/* This vnode is on the freelist */
  
  /*
   * Vnode attributes.  A field value of VNOVAL represents a field whose value
*** sys/ufs/ufs/ufs_readwrite.c.ORIG	Thu Sep 25 09:24:52 1997
--- sys/ufs/ufs/ufs_readwrite.c	Thu Sep 25 09:33:06 1997
***************
*** 123,129 ****
  #else
  		if (lblktosize(fs, nextlbn) >= ip->i_size)
  			error = bread(vp, lbn, size, NOCRED, &bp);
! 		else if (ffs_doclusterread)
  			error = cluster_read(vp, ip->i_size, lbn,
  				size, NOCRED, uio->uio_resid, seqcount, &bp);
  		else if (lbn - 1 == vp->v_lastr) {
--- 123,129 ----
  #else
  		if (lblktosize(fs, nextlbn) >= ip->i_size)
  			error = bread(vp, lbn, size, NOCRED, &bp);
! 		else if (ffs_doclusterread && !(vp->v_flag & VNOCLUSTER))
  			error = cluster_read(vp, ip->i_size, lbn,
  				size, NOCRED, uio->uio_resid, seqcount, &bp);
  		else if (lbn - 1 == vp->v_lastr) {
***************
*** 281,287 ****
  		if (ioflag & IO_SYNC) {
  			(void)bwrite(bp);
  		} else if (xfersize + blkoffset == fs->fs_bsize) {
! 			if (ffs_doclusterwrite) {
  				bp->b_flags |= B_CLUSTEROK;
  				cluster_write(bp, ip->i_size);
  			} else {
--- 281,287 ----
  		if (ioflag & IO_SYNC) {
  			(void)bwrite(bp);
  		} else if (xfersize + blkoffset == fs->fs_bsize) {
! 			if (ffs_doclusterwrite && !(vp->v_flag & VNOCLUSTER)) {
  				bp->b_flags |= B_CLUSTEROK;
  				cluster_write(bp, ip->i_size);
  			} else {
*** usr.sbin/vnconfig/vnconfig.8.orig	Thu Sep 25 09:40:55 1997
--- usr.sbin/vnconfig/vnconfig.8	Thu Sep 25 09:41:50 1997
***************
*** 81,86 ****
--- 81,88 ----
  .Fl c .
  .It Fl d
  Disables (if possible) the specified feature.
+ .It Fl n
+ Disables cluster read and write.
  .It Fl u
  Disables and ``unconfigures'' the device.
  .It Fl v
*** usr.sbin/vnconfig/vnconfig.c.orig	Thu Sep 25 09:40:55 1997
--- usr.sbin/vnconfig/vnconfig.c	Thu Sep 25 09:41:50 1997
***************
*** 69,74 ****
--- 69,75 ----
  #define VN_IGNORE	0x80
  #define VN_SET		0x100
  #define VN_RESET	0x200
+ #define	VN_NOCLUSTER	0x400
  
  int nvndisks;
  
***************
*** 159,164 ****
--- 160,170 ----
  			verbose++;
  			break;
  
+ 		/* disable cluster read / write */
+ 		case 'n':
+ 			flags |= VN_NOCLUSTER;
+ 			break;
+ 
  		default:
  			fprintf(stderr, "invalid option '%c'\n", optopt);
  			usage();
***************
*** 260,272 ****
  	 * Configure the device
  	 */
  	if (flags & VN_CONFIG) {
! 		rv = ioctl(fileno(f), VNIOCATTACH, &vnio);
! 		if (rv) {
! 			perror("VNIOCATTACH");
! 			flags &= ~VN_ENABLE;
! 		} else if (verbose)
! 			printf("%s: %d bytes on %s\n",
! 			       dev, vnio.vn_size, file);
  	}
  	/*
  	 * Set an option
--- 266,288 ----
  	 * Configure the device
  	 */
  	if (flags & VN_CONFIG) {
! 		if (flags & VN_NOCLUSTER) {
! 			rv = ioctl(fileno(f), VNIOCATTACHNCLUSTER, &vnio);
! 			if (rv) {
! 				perror("VNIOCATTACHNCLUSTER");
! 				flags &= ~VN_ENABLE;
! 			} else if (verbose)
! 				printf("%s: %d bytes on %s\n",
! 					   dev, vnio.vn_size, file);
! 		} else {
! 			rv = ioctl(fileno(f), VNIOCATTACH, &vnio);
! 			if (rv) {
! 				perror("VNIOCATTACH");
! 				flags &= ~VN_ENABLE;
! 			} else if (verbose)
! 				printf("%s: %d bytes on %s\n",
! 					   dev, vnio.vn_size, file);
! 		}
  	}
  	/*
  	 * Set an option
---------- END ----------


----
KATO Takenori <kato@ganko.eps.nagoya-u.ac.jp>
Dept. Earth Planet. Sci., Nagoya Univ.,  Nagoya, 464-01, Japan
PGP public key: finger kato@eclogite.eps.nagoya-u.ac.jp
------------------- Powered by FreeBSD(98) -------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709250315.MAA05717>