取自 Linux 2.6 kernel source drivers/scsi/sd.c, 作者說明了抽換片檢查與讀寫速度上的取捨,
注意最後一句....
/*
* This routine checks whether a removable media has been changed,
* and invalidates all buffer-cache-entries in that case. This
* is a relatively slow routine, so we have to try to minimize using
* it. Thus it is called only upon a 'mount' or 'open'. This
* is the best way of combining speed and utility, I think.
* People changing diskettes in the middle of an operation deserve
* to lose :-)
*/
int check_disk_change(struct block_device *bdev)
訂閱:
張貼留言 (Atom)
2 則留言:
well.. it's like I thought!
張貼留言