diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2010-05-16 19:40:56 -0300 |
---|---|---|
committer | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2010-05-16 19:40:56 -0300 |
commit | b65b34895437915f411882dd40d704eb0863ffb0 (patch) | |
tree | 3e9302ab09c9a9068fd8fd80708ef3a35b55e665 /drivers/scsi/sg.c | |
parent | 88cc83772a3c7756b9f2b4ba835545ad90a08409 (diff) | |
parent | b57f95a38233a2e73b679bea4a5453a1cc2a1cc9 (diff) | |
download | lwn-b65b34895437915f411882dd40d704eb0863ffb0.tar.gz lwn-b65b34895437915f411882dd40d704eb0863ffb0.zip |
Merge mainline (v2.6.34-rc7)
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 040f751809ea..dee1c96288d4 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -38,6 +38,7 @@ static int sg_version_num = 30534; /* 2 digits for each component */ #include <linux/errno.h> #include <linux/mtio.h> #include <linux/ioctl.h> +#include <linux/slab.h> #include <linux/fcntl.h> #include <linux/init.h> #include <linux/poll.h> @@ -287,8 +288,7 @@ sg_open(struct inode *inode, struct file *filp) if (list_empty(&sdp->sfds)) { /* no existing opens on this device */ sdp->sgdebug = 0; q = sdp->device->request_queue; - sdp->sg_tablesize = min(queue_max_hw_segments(q), - queue_max_phys_segments(q)); + sdp->sg_tablesize = queue_max_segments(q); } if ((sfp = sg_add_sfp(sdp, dev))) filp->private_data = sfp; @@ -1376,8 +1376,7 @@ static Sg_device *sg_alloc(struct gendisk *disk, struct scsi_device *scsidp) sdp->device = scsidp; INIT_LIST_HEAD(&sdp->sfds); init_waitqueue_head(&sdp->o_excl_wait); - sdp->sg_tablesize = min(queue_max_hw_segments(q), - queue_max_phys_segments(q)); + sdp->sg_tablesize = queue_max_segments(q); sdp->index = k; kref_init(&sdp->d_ref); |