Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jan 2002 18:24:50 +0600
From:      Max Khon <fjoe@iclub.nsu.ru>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Cy Schubert - ITSD Open Systems Group <Cy.Schubert@uumail.gov.bc.ca>, Poul-Henning Kamp <phk@critter.freebsd.dk>, arch@freebsd.org
Subject:   Re: request for review
Message-ID:  <20020121182450.A91754@iclub.nsu.ru>
In-Reply-To: <20020121001749.A80939@iclub.nsu.ru>; from fjoe@iclub.nsu.ru on Mon, Jan 21, 2002 at 12:17:49AM %2B0600
References:  <20020116000607.B10938@iclub.nsu.ru> <20020116155828.T487-100000@gamplex.bde.org> <20020121001749.A80939@iclub.nsu.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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