projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] USB usblp: rate-limit printer status error messages
[powerpc.git]
/
drivers
/
scsi
/
sg.c
diff --git
a/drivers/scsi/sg.c
b/drivers/scsi/sg.c
index
51292f2
..
b1b69d7
100644
(file)
--- a/
drivers/scsi/sg.c
+++ b/
drivers/scsi/sg.c
@@
-61,7
+61,7
@@
static int sg_version_num = 30533; /* 2 digits for each component */
#ifdef CONFIG_SCSI_PROC_FS
#include <linux/proc_fs.h>
#ifdef CONFIG_SCSI_PROC_FS
#include <linux/proc_fs.h>
-static char *sg_version_date = "20050
328
";
+static char *sg_version_date = "20050
901
";
static int sg_proc_init(void);
static void sg_proc_cleanup(void);
static int sg_proc_init(void);
static void sg_proc_cleanup(void);
@@
-1027,8
+1027,7
@@
sg_ioctl(struct inode *inode, struct file *filp,
if (sdp->detached)
return -ENODEV;
if (filp->f_flags & O_NONBLOCK) {
if (sdp->detached)
return -ENODEV;
if (filp->f_flags & O_NONBLOCK) {
- if (test_bit(SHOST_RECOVERY,
- &sdp->device->host->shost_state))
+ if (sdp->device->host->shost_state == SHOST_RECOVERY)
return -EBUSY;
} else if (!scsi_block_when_processing_errors(sdp->device))
return -EBUSY;
return -EBUSY;
} else if (!scsi_block_when_processing_errors(sdp->device))
return -EBUSY;
@@
-1795,12
+1794,12
@@
st_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages,
unsigned long uaddr, size_t count, int rw,
unsigned long max_pfn)
{
unsigned long uaddr, size_t count, int rw,
unsigned long max_pfn)
{
+ unsigned long end = (uaddr + count + PAGE_SIZE - 1) >> PAGE_SHIFT;
+ unsigned long start = uaddr >> PAGE_SHIFT;
+ const int nr_pages = end - start;
int res, i, j;
int res, i, j;
- unsigned int nr_pages;
struct page **pages;
struct page **pages;
- nr_pages = ((uaddr & ~PAGE_MASK) + count + ~PAGE_MASK) >> PAGE_SHIFT;
-
/* User attempted Overflow! */
if ((uaddr + count) < uaddr)
return -EINVAL;
/* User attempted Overflow! */
if ((uaddr + count) < uaddr)
return -EINVAL;
@@
-2971,23
+2970,22
@@
static void * dev_seq_start(struct seq_file *s, loff_t *pos)
{
struct sg_proc_deviter * it = kmalloc(sizeof(*it), GFP_KERNEL);
{
struct sg_proc_deviter * it = kmalloc(sizeof(*it), GFP_KERNEL);
+ s->private = it;
if (! it)
return NULL;
if (! it)
return NULL;
+
if (NULL == sg_dev_arr)
if (NULL == sg_dev_arr)
-
goto err1
;
+
return NULL
;
it->index = *pos;
it->max = sg_last_dev();
if (it->index >= it->max)
it->index = *pos;
it->max = sg_last_dev();
if (it->index >= it->max)
-
goto err1
;
+
return NULL
;
return it;
return it;
-err1:
- kfree(it);
- return NULL;
}
static void * dev_seq_next(struct seq_file *s, void *v, loff_t *pos)
{
}
static void * dev_seq_next(struct seq_file *s, void *v, loff_t *pos)
{
- struct sg_proc_deviter * it =
(struct sg_proc_deviter *) v
;
+ struct sg_proc_deviter * it =
s->private
;
*pos = ++it->index;
return (it->index < it->max) ? it : NULL;
*pos = ++it->index;
return (it->index < it->max) ? it : NULL;
@@
-2995,7
+2993,7
@@
static void * dev_seq_next(struct seq_file *s, void *v, loff_t *pos)
static void dev_seq_stop(struct seq_file *s, void *v)
{
static void dev_seq_stop(struct seq_file *s, void *v)
{
- kfree
(v
);
+ kfree
(s->private
);
}
static int sg_proc_open_dev(struct inode *inode, struct file *file)
}
static int sg_proc_open_dev(struct inode *inode, struct file *file)