Commit b3d59115 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley

[SCSI] st: remove struct scatterlist

This removes the usage of struct scatterlist completely.
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: default avatarKai Makisara <Kai.Makisara@kolumbus.fi>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 08c95832
...@@ -3744,7 +3744,7 @@ static long st_compat_ioctl(struct file *file, unsigned int cmd, unsigned long a ...@@ -3744,7 +3744,7 @@ static long st_compat_ioctl(struct file *file, unsigned int cmd, unsigned long a
static struct st_buffer * static struct st_buffer *
new_tape_buffer(int from_initialization, int need_dma, int max_sg) new_tape_buffer(int from_initialization, int need_dma, int max_sg)
{ {
int i, got = 0; int got = 0;
gfp_t priority; gfp_t priority;
struct st_buffer *tb; struct st_buffer *tb;
...@@ -3753,10 +3753,7 @@ static struct st_buffer * ...@@ -3753,10 +3753,7 @@ static struct st_buffer *
else else
priority = GFP_KERNEL; priority = GFP_KERNEL;
i = sizeof(struct st_buffer) + tb = kzalloc(sizeof(struct st_buffer), priority);
(max_sg - 1) * sizeof(struct scatterlist);
tb = kzalloc(i, priority);
if (!tb) { if (!tb) {
printk(KERN_NOTICE "st: Can't allocate new tape buffer.\n"); printk(KERN_NOTICE "st: Can't allocate new tape buffer.\n");
return NULL; return NULL;
...@@ -3766,7 +3763,6 @@ static struct st_buffer * ...@@ -3766,7 +3763,6 @@ static struct st_buffer *
tb->dma = need_dma; tb->dma = need_dma;
tb->buffer_size = got; tb->buffer_size = got;
sg_init_table(tb->sg, max_sg);
tb->reserved_pages = kzalloc(max_sg * sizeof(struct page *), priority); tb->reserved_pages = kzalloc(max_sg * sizeof(struct page *), priority);
if (!tb->reserved_pages) { if (!tb->reserved_pages) {
......
...@@ -54,7 +54,6 @@ struct st_buffer { ...@@ -54,7 +54,6 @@ struct st_buffer {
unsigned short orig_frp_segs; /* number of segments allocated at first try */ unsigned short orig_frp_segs; /* number of segments allocated at first try */
unsigned short frp_segs; /* number of buffer segments */ unsigned short frp_segs; /* number of buffer segments */
unsigned int frp_sg_current; /* driver buffer length currently in s/g list */ unsigned int frp_sg_current; /* driver buffer length currently in s/g list */
struct scatterlist sg[1]; /* MUST BE last item */
}; };
/* The tape mode definition */ /* The tape mode definition */
......
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