aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Engel <joern@logfs.org>2012-04-12 17:33:39 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-05-17 05:08:53 -0400
commitebaf466be5afa6c6dca29005374de4534e0e6b33 (patch)
treeb6c91cb41f840c3775d17ea49e603275e40fc0f9
parent3f0c6aba0b65a68013c1e0db1b015f02e6ec24be (diff)
[SCSI] sg: remove closed flag
After sg_release() has been called, noone should be able to actually use that filedescriptor anymore. So if closed ever made a difference in the past five years or so, it would have meant a bug. Remove it. Signed-off-by: Joern Engel <joern@logfs.org> Acked-by: Douglas Gilbert <dgilbert@interlog.com> [jejb: fix up checkpatch warnings] Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/sg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 1a0be4f1d1fa..511e3ca1afd6 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -157,7 +157,6 @@ typedef struct sg_fd { /* holds the state of a file descriptor */
157 Sg_request req_arr[SG_MAX_QUEUE]; /* used as singly-linked list */ 157 Sg_request req_arr[SG_MAX_QUEUE]; /* used as singly-linked list */
158 char low_dma; /* as in parent but possibly overridden to 1 */ 158 char low_dma; /* as in parent but possibly overridden to 1 */
159 char force_packid; /* 1 -> pack_id input to read(), 0 -> ignored */ 159 char force_packid; /* 1 -> pack_id input to read(), 0 -> ignored */
160 volatile char closed; /* 1 -> fd closed but request(s) outstanding */
161 char cmd_q; /* 1 -> allow command queuing, 0 -> don't */ 160 char cmd_q; /* 1 -> allow command queuing, 0 -> don't */
162 char next_cmd_len; /* 0 -> automatic (def), >0 -> use on next write() */ 161 char next_cmd_len; /* 0 -> automatic (def), >0 -> use on next write() */
163 char keep_orphan; /* 0 -> drop orphan (def), 1 -> keep for read() */ 162 char keep_orphan; /* 0 -> drop orphan (def), 1 -> keep for read() */
@@ -329,8 +328,6 @@ sg_release(struct inode *inode, struct file *filp)
329 return -ENXIO; 328 return -ENXIO;
330 SCSI_LOG_TIMEOUT(3, printk("sg_release: %s\n", sdp->disk->disk_name)); 329 SCSI_LOG_TIMEOUT(3, printk("sg_release: %s\n", sdp->disk->disk_name));
331 330
332 sfp->closed = 1;
333
334 sdp->exclude = 0; 331 sdp->exclude = 0;
335 wake_up_interruptible(&sdp->o_excl_wait); 332 wake_up_interruptible(&sdp->o_excl_wait);
336 333
@@ -1118,8 +1115,11 @@ sg_poll(struct file *filp, poll_table * wait)
1118 int count = 0; 1115 int count = 0;
1119 unsigned long iflags; 1116 unsigned long iflags;
1120 1117
1121 if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)) 1118 sfp = filp->private_data;
1122 || sfp->closed) 1119 if (!sfp)
1120 return POLLERR;
1121 sdp = sfp->parentdp;
1122 if (!sdp)
1123 return POLLERR; 1123 return POLLERR;
1124 poll_wait(filp, &sfp->read_wait, wait); 1124 poll_wait(filp, &sfp->read_wait, wait);
1125 read_lock_irqsave(&sfp->rq_list_lock, iflags); 1125 read_lock_irqsave(&sfp->rq_list_lock, iflags);
@@ -2515,9 +2515,9 @@ static void sg_proc_debug_helper(struct seq_file *s, Sg_device * sdp)
2515 fp->reserve.bufflen, 2515 fp->reserve.bufflen,
2516 (int) fp->reserve.k_use_sg, 2516 (int) fp->reserve.k_use_sg,
2517 (int) fp->low_dma); 2517 (int) fp->low_dma);
2518 seq_printf(s, " cmd_q=%d f_packid=%d k_orphan=%d closed=%d\n", 2518 seq_printf(s, " cmd_q=%d f_packid=%d k_orphan=%d closed=0\n",
2519 (int) fp->cmd_q, (int) fp->force_packid, 2519 (int) fp->cmd_q, (int) fp->force_packid,
2520 (int) fp->keep_orphan, (int) fp->closed); 2520 (int) fp->keep_orphan);
2521 for (m = 0, srp = fp->headrp; 2521 for (m = 0, srp = fp->headrp;
2522 srp != NULL; 2522 srp != NULL;
2523 ++m, srp = srp->nextrp) { 2523 ++m, srp = srp->nextrp) {