static struct st_buffer *
new_tape_buffer(int from_initialization, int need_dma, int max_sg)
{
- int i, got = 0;
+ int got = 0;
gfp_t priority;
struct st_buffer *tb;
else
priority = GFP_KERNEL;
- i = sizeof(struct st_buffer) +
- (max_sg - 1) * sizeof(struct scatterlist);
-
- tb = kzalloc(i, priority);
+ tb = kzalloc(sizeof(struct st_buffer), priority);
if (!tb) {
printk(KERN_NOTICE "st: Can't allocate new tape buffer.\n");
return NULL;
tb->dma = need_dma;
tb->buffer_size = got;
- sg_init_table(tb->sg, max_sg);
tb->reserved_pages = kzalloc(max_sg * sizeof(struct page *), priority);
if (!tb->reserved_pages) {
unsigned short orig_frp_segs; /* number of segments allocated at first try */
unsigned short frp_segs; /* number of buffer segments */
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 */