From owner-freebsd-arch Mon Jan 21 4:28:28 2002 Delivered-To: freebsd-arch@freebsd.org Received: from camelot.spsl.nsc.ru (camelot.spsl.nsc.ru [194.226.174.80]) by hub.freebsd.org (Postfix) with ESMTP id 7E46537B404 for ; Mon, 21 Jan 2002 04:28:21 -0800 (PST) Received: (from root@localhost) by camelot.spsl.nsc.ru (8.11.6/8.11.6) id g0LCP2j04315 for arch@freebsd.org.AVP; Mon, 21 Jan 2002 18:25:02 +0600 (NOVT) (envelope-from fjoe@iclub.nsu.ru) Received: from iclub.nsu.ru (root@iclub.nsu.ru [193.124.222.66]) by camelot.spsl.nsc.ru (8.11.6/8.11.6) with ESMTP id g0LCP0q04304; Mon, 21 Jan 2002 18:25:01 +0600 (NOVT) (envelope-from fjoe@iclub.nsu.ru) Received: (from fjoe@localhost) by iclub.nsu.ru (8.11.6/8.11.6) id g0LCOpK91803; Mon, 21 Jan 2002 18:24:51 +0600 (NS) (envelope-from fjoe) Date: Mon, 21 Jan 2002 18:24:50 +0600 From: Max Khon To: Bruce Evans Cc: Cy Schubert - ITSD Open Systems Group , Poul-Henning Kamp , arch@freebsd.org Subject: Re: request for review Message-ID: <20020121182450.A91754@iclub.nsu.ru> References: <20020116000607.B10938@iclub.nsu.ru> <20020116155828.T487-100000@gamplex.bde.org> <20020121001749.A80939@iclub.nsu.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020121001749.A80939@iclub.nsu.ru>; from fjoe@iclub.nsu.ru on Mon, Jan 21, 2002 at 12:17:49AM +0600 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG hi, there! On Mon, Jan 21, 2002 at 12:17:49AM +0600, Max Khon wrote: > ok, what do you think about this patch? > > Index: vfs_vnops.c > =================================================================== > RCS file: /home/ncvs/src/sys/kern/vfs_vnops.c,v > retrieving revision 1.126 > diff -u -p -r1.126 vfs_vnops.c > --- vfs_vnops.c 13 Jan 2002 11:58:03 -0000 1.126 > +++ vfs_vnops.c 20 Jan 2002 17:45:38 -0000 > @@ -571,17 +571,17 @@ vn_stat(vp, sb, td) > * Default to zero to catch bogus uses of this field. > */ > > - if (vap->va_type == VREG) { > - sb->st_blksize = vap->va_blocksize; > - } else if (vn_isdisk(vp, NULL)) { > + if (vn_isdisk(vp, NULL)) { > sb->st_blksize = vp->v_rdev->si_bsize_best; > if (sb->st_blksize < vp->v_rdev->si_bsize_phys) > sb->st_blksize = vp->v_rdev->si_bsize_phys; > if (sb->st_blksize < BLKDEV_IOSIZE) > sb->st_blksize = BLKDEV_IOSIZE; > - } else { > - sb->st_blksize = 0; > - } > + } else > + sb->st_blksize = vap->va_blocksize; > + > + if (sb->st_blksize == 0) > + sb->st_blksize = PAGE_SIZE; > > sb->st_flags = vap->va_flags; > if (suser_xxx(td->td_proc->p_ucred, 0, 0)) btw NetBSD/OpenBSD have the following code in ufs_getattr(): /* this doesn't belong here */ if (vp->v_type == VBLK) vap->va_blocksize = BLKDEV_IOSIZE; else if (vp->v_type == VCHR) vap->va_blocksize = MAXBSIZE; else vap->va_blocksize = vp->v_mount->mnt_stat.f_iosize; /fjoe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message