Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127890
b: refs/heads/master
c: f409d6c
h: refs/heads/master
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Jan 2, 2009
1 parent b2556c8 commit 2a29261
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3d59115ba2b2550d70eafd929f1fa607fe588dc
refs/heads/master: f409d6cc688d4e87b0ebf577b6554695e1931705
21 changes: 6 additions & 15 deletions trunk/drivers/scsi/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ static struct scsi_tape **scsi_tapes = NULL;

static int modes_defined;

static struct st_buffer *new_tape_buffer(int, int, int);
static int enlarge_buffer(struct st_buffer *, int, int);
static void clear_buffer(struct st_buffer *);
static void normalize_buffer(struct st_buffer *);
Expand Down Expand Up @@ -3741,30 +3740,22 @@ static long st_compat_ioctl(struct file *file, unsigned int cmd, unsigned long a

/* Try to allocate a new tape buffer. Calling function must not hold
dev_arr_lock. */
static struct st_buffer *
new_tape_buffer(int from_initialization, int need_dma, int max_sg)
static struct st_buffer *new_tape_buffer(int need_dma, int max_sg)
{
int got = 0;
gfp_t priority;
struct st_buffer *tb;

if (from_initialization)
priority = GFP_ATOMIC;
else
priority = GFP_KERNEL;

tb = kzalloc(sizeof(struct st_buffer), priority);
tb = kzalloc(sizeof(struct st_buffer), GFP_ATOMIC);
if (!tb) {
printk(KERN_NOTICE "st: Can't allocate new tape buffer.\n");
return NULL;
}
tb->frp_segs = tb->orig_frp_segs = 0;
tb->use_sg = max_sg;

tb->dma = need_dma;
tb->buffer_size = got;
tb->buffer_size = 0;

tb->reserved_pages = kzalloc(max_sg * sizeof(struct page *), priority);
tb->reserved_pages = kzalloc(max_sg * sizeof(struct page *),
GFP_ATOMIC);
if (!tb->reserved_pages) {
kfree(tb);
return NULL;
Expand Down Expand Up @@ -4059,7 +4050,7 @@ static int st_probe(struct device *dev)
SDp->request_queue->max_phys_segments);
if (st_max_sg_segs < i)
i = st_max_sg_segs;
buffer = new_tape_buffer(1, (SDp->host)->unchecked_isa_dma, i);
buffer = new_tape_buffer((SDp->host)->unchecked_isa_dma, i);
if (buffer == NULL) {
printk(KERN_ERR
"st: Can't allocate new tape buffer. Device not attached.\n");
Expand Down

0 comments on commit 2a29261

Please sign in to comment.