tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: A brelse() in FFS...



Le 13/02/2015 22:03, J. Hannken-Illjes a écrit :
> On 13 Feb 2015, at 19:18, Maxime Villard <max%M00nBSD.net@localhost> wrote:
> 
>> Hi,
>> this may be a stupid question; in ufs/ffs/ffs_vfsops.c, l.1153:
>>
>> 	if (fs->fs_sbsize < SBLOCKSIZE)
>> 		brelse(bp, BC_INVAL);
>> 	else
>> 		brelse(bp, 0);
>>
>> However 'fs->fs_sbsize' is *always* smaller than SBLOCKSIZE. So only
>> the first branch is reached.
> 
> It may be equal to SBLOCKSIZE. 

Ah yes you're right! I read too quickly and didn't notice the fs_sbsize=SBLOCKSIZE
case.

I knew that was going to be a stupid question. Anyway, sorry for the noise.

> The BC_INVAL is here to not keep
> the buffer in cache.  It may be read later with a size greater fs_sbsize
> and would break buffer cache invariance (blocks are always read with the
> same size).
> 
>> I don't understand what the BC_INVAL flag means, and its definition
>> in sys/buf.h is not very enlightening:
>>
>> 	#define	BC_INVAL	0x00002000	/* Does not contain valid info. */
>>
>> Which branch do I keep?
> 
> Both.
> 
> --
> J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig (Germany)
> 
> 



Home | Main Index | Thread Index | Old Index