Subject: Re: How to capture all file system writes
To: None <tech-kern@netbsd.org>
From: Stephan Uphoff <ups@stups.com>
List: tech-kern
Date: 10/22/2003 10:57:23
Hi,

This should work.

	Stephan

PS: Just for the record (feel free to ignore) as I don't think my 
    opinion is widely shared:
    I don't like fs specific stuff in the block layer and would rather see 
    a pseudo disk device for block interception being pushed on top of the 
    disk device.
    


Juergen Hannken-Illjes wrote:

> And what about 'sys/miscfs/specfs/spec_vnops.c::spec_strategy(void *v)'?
> 
>  int
>  spec_strategy(v)
>  	void *v;
>  {
>  	struct vop_strategy_args /* {
>  		struct buf *a_bp;
>  	} */ *ap = v;
>  	struct buf *bp;
>  	const struct bdevsw *bdev;
>  
>  	bp = ap->a_bp;
>  	if (!(bp->b_flags & B_READ) &&
>  	    (LIST_FIRST(&bp->b_dep)) != NULL && bioops.io_start)
>  		(*bioops.io_start)(bp);
>  	bdev = bdevsw_lookup(bp->b_dev);
> -	if (bdev != NULL)
> +	if (bdev != NULL) {
> +#if NFSSNAP > 0
> +		if (FSSNAP_ACTIVE(bp)) {
> +			fssnap_lookup(bp);
> +		}
> +#endif
>  		(*bdev->d_strategy)(bp);
> +	}
>  	return (0);
>  }
> 
> -- 
> Juergen Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)
>