Wikipedia Affiliate Button

4/28/2008

the comments of check_disk_change() in Linux kernel source.

取自 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)


2 則留言:

匿名 提到...
網誌管理員已經移除這則留言。
匿名 提到...

well.. it's like I thought!