Commit f6d999f9 authored by James Bottomley's avatar James Bottomley

[SCSI] sd moved synchronisation from release to detach

parent be48b57a
......@@ -580,13 +580,6 @@ static int sd_release(struct inode *inode, struct file *filp)
if (sd_template.module)
__MOD_DEC_USE_COUNT(sd_template.module);
/* check that we actually have a write back cache to synchronize */
if(sdkp->WCE) {
printk(KERN_NOTICE "Synchronizing SCSI cache: ");
sd_synchronize_cache(dsk_nr, 1);
printk("\n");
}
return 0;
}
......@@ -1477,9 +1470,6 @@ static void sd_detach(Scsi_Device * sdp)
for (dsk_nr = 0; dsk_nr < sd_template.dev_max; dsk_nr++) {
sdkp = sd_dsk_arr[dsk_nr];
if (sdkp->device == sdp) {
sdkp->device = NULL;
sdkp->capacity = 0;
/* sdkp->detaching = 1; */
break;
}
}
......@@ -1487,6 +1477,16 @@ static void sd_detach(Scsi_Device * sdp)
if (dsk_nr >= sd_template.dev_max)
return;
/* check that we actually have a write back cache to synchronize */
if(sdkp->WCE) {
printk(KERN_NOTICE "Synchronizing SCSI cache: ");
sd_synchronize_cache(dsk_nr, 1);
printk("\n");
}
sdkp->device = NULL;
sdkp->capacity = 0;
/* sdkp->detaching = 1; */
if (sdkp->has_been_registered) {
sdkp->has_been_registered = 0;
dev = MKDEV_SD(dsk_nr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment