Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Sep 1997 00:26:11 +0900
From:      KATO Takenori <kato@migmatite.eps.nagoya-u.ac.jp>
To:        bde@zeta.org.au
Cc:        current@FreeBSD.ORG
Subject:   Re: Daily SNAPshots at current.freebsd.org shut down for now.
Message-ID:  <199709251526.AAA07045@gneiss.eps.nagoya-u.ac.jp>
In-Reply-To: Your message of "Thu, 25 Sep 1997 23:11:44 %2B1000"
References:  <199709251311.XAA16478@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
> The mount option would automatically apply to the correct layer.

Ok, I will add preliminary path bellow.


> Perhaps the mount-option version should eliminate doclusterread and
> doclusterwrite (this requires a mount option for each) and move the
> tests into cluster_read() and cluster_write().

I think doclusterreadn and doclusterwrite is useful.  IMO, we should
not expect every user always mount with correct mount-option.  If
doclusterread and doclusterwrite can be controled with sysctl and root
disables them, non-root user cannot enable them.


---------- BEGIN ----------
*** sys/sys/mount.h.ORIG	Thu Sep 25 23:33:00 1997
--- sys/sys/mount.h	Fri Sep 26 00:00:35 1997
***************
*** 166,171 ****
--- 166,172 ----
  #define	MNT_UNION	0x00000020	/* union with underlying filesystem */
  #define	MNT_ASYNC	0x00000040	/* file system written asynchronously */
  #define	MNT_NOATIME	0x10000000	/* Disable update of file access times */
+ #define	MNT_NOCLUSTER	0x40000000	/* Disable cluster read and write */
  
  /*
   * exported mount flags.
*** sys/kern/vfs_syscalls.c.ORIG	Thu Sep 25 23:57:47 1997
--- sys/kern/vfs_syscalls.c	Fri Sep 26 00:01:49 1997
***************
*** 253,262 ****
  	else if (mp->mnt_flag & MNT_RDONLY)
  		mp->mnt_flag |= MNT_WANTRDWR;
  	mp->mnt_flag &=~ (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
! 	    MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOATIME);
  	mp->mnt_flag |= SCARG(uap, flags) & (MNT_NOSUID | MNT_NOEXEC |
  	    MNT_NODEV | MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_FORCE |
! 	    MNT_NOATIME);
  	/*
  	 * Mount the filesystem.
  	 */
--- 253,263 ----
  	else if (mp->mnt_flag & MNT_RDONLY)
  		mp->mnt_flag |= MNT_WANTRDWR;
  	mp->mnt_flag &=~ (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
! 	    MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOATIME |
! 		MNT_NOCLUSTER);
  	mp->mnt_flag |= SCARG(uap, flags) & (MNT_NOSUID | MNT_NOEXEC |
  	    MNT_NODEV | MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_FORCE |
! 	    MNT_NOATIME | MNT_NOCLUSTER);
  	/*
  	 * Mount the filesystem.
  	 */
*** sys/ufs/ufs/ufs_readwrite.c.ORIG	Fri Sep 26 00:18:23 1997
--- sys/ufs/ufs/ufs_readwrite.c	Fri Sep 26 00:22:16 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,130 ----
  #else
  		if (lblktosize(fs, nextlbn) >= ip->i_size)
  			error = bread(vp, lbn, size, NOCRED, &bp);
! 		else if (ffs_doclusterread &&
! 				 !(vp->v_mount->mnt_flag & MNT_NOCLUSTER))
  			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 {
--- 282,289 ----
  		if (ioflag & IO_SYNC) {
  			(void)bwrite(bp);
  		} else if (xfersize + blkoffset == fs->fs_bsize) {
! 			if (ffs_doclusterwrite &&
! 				!(vp->v_mount->mnt_flag & MNT_NOCLUSTER)) {
  				bp->b_flags |= B_CLUSTEROK;
  				cluster_write(bp, ip->i_size);
  			} else {
---------- 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?199709251526.AAA07045>