patch-2.0.32 linux/drivers/scsi/sr.c

Next file: linux/drivers/scsi/st.c
Previous file: linux/drivers/scsi/fdomain.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.31/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
@@ -601,6 +601,8 @@
     if (filp->f_mode & 2)  
 	return -EROFS;
 
+    if(sr_template.usage_count) (*sr_template.usage_count)++;
+
     sr_ioctl(inode,filp,CDROMCLOSETRAY,0);
     check_disk_change(inode->i_rdev);
     
@@ -608,7 +610,6 @@
 	sr_ioctl(inode, NULL, SCSI_IOCTL_DOORLOCK, 0);
     if (scsi_CDs[MINOR(inode->i_rdev)].device->host->hostt->usage_count)
 	(*scsi_CDs[MINOR(inode->i_rdev)].device->host->hostt->usage_count)++;
-    if(sr_template.usage_count) (*sr_template.usage_count)++;
     
     sr_photocd(inode);
     

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov