Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 326297
b: refs/heads/master
c: f4e49cd
h: refs/heads/master
i:
  326295: b30937b
v: v3
  • Loading branch information
Jeff Layton authored and Steve French committed Sep 25, 2012
1 parent a125c84 commit befb4f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 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: 67c1f5295150eb86d065d57b4515a472ecbf008f
refs/heads/master: f4e49cd2dce2ccac6feae64fbb4e90f7d8baf370
2 changes: 1 addition & 1 deletion trunk/fs/cifs/cifsglob.h
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ struct cifs_readdata {
int (*marshal_iov) (struct cifs_readdata *rdata,
unsigned int remaining);
unsigned int nr_iov;
struct kvec iov[1];
struct kvec *iov;
};

struct cifs_writedata;
Expand Down
15 changes: 12 additions & 3 deletions trunk/fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2410,19 +2410,27 @@ ssize_t cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov,
}

static struct cifs_readdata *
cifs_readdata_alloc(unsigned int nr_vecs, work_func_t complete)
cifs_readdata_alloc(unsigned int nr_pages, work_func_t complete)
{
struct cifs_readdata *rdata;
struct kvec *iov;

rdata = kzalloc(sizeof(*rdata) +
sizeof(struct kvec) * nr_vecs, GFP_KERNEL);
iov = kzalloc(sizeof(*iov) * (nr_pages + 1), GFP_KERNEL);
if (!iov)
return (struct cifs_readdata *)iov;

rdata = kzalloc(sizeof(*rdata), GFP_KERNEL);
if (rdata != NULL) {
kref_init(&rdata->refcount);
INIT_LIST_HEAD(&rdata->list);
init_completion(&rdata->done);
INIT_WORK(&rdata->work, complete);
INIT_LIST_HEAD(&rdata->pages);
rdata->iov = iov;
} else {
kfree(iov);
}

return rdata;
}

Expand All @@ -2435,6 +2443,7 @@ cifs_readdata_release(struct kref *refcount)
if (rdata->cfile)
cifsFileInfo_put(rdata->cfile);

kfree(rdata->iov);
kfree(rdata);
}

Expand Down

0 comments on commit befb4f1

Please sign in to comment.