|
@@ -1952,6 +1952,7 @@ cifs_writedata_release(struct kref *refcount)
|
|
|
if (wdata->cfile)
|
|
|
cifsFileInfo_put(wdata->cfile);
|
|
|
|
|
|
+ kvfree(wdata->pages);
|
|
|
kfree(wdata);
|
|
|
}
|
|
|
|
|
@@ -2074,13 +2075,23 @@ cifs_writev_complete(struct work_struct *work)
|
|
|
|
|
|
struct cifs_writedata *
|
|
|
cifs_writedata_alloc(unsigned int nr_pages, work_func_t complete)
|
|
|
+{
|
|
|
+ struct page **pages =
|
|
|
+ kzalloc(sizeof(struct page *) * nr_pages, GFP_NOFS);
|
|
|
+ if (pages)
|
|
|
+ return cifs_writedata_direct_alloc(pages, complete);
|
|
|
+
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+struct cifs_writedata *
|
|
|
+cifs_writedata_direct_alloc(struct page **pages, work_func_t complete)
|
|
|
{
|
|
|
struct cifs_writedata *wdata;
|
|
|
|
|
|
- /* writedata + number of page pointers */
|
|
|
- wdata = kzalloc(sizeof(*wdata) +
|
|
|
- sizeof(struct page *) * nr_pages, GFP_NOFS);
|
|
|
+ wdata = kzalloc(sizeof(*wdata), GFP_NOFS);
|
|
|
if (wdata != NULL) {
|
|
|
+ wdata->pages = pages;
|
|
|
kref_init(&wdata->refcount);
|
|
|
INIT_LIST_HEAD(&wdata->list);
|
|
|
init_completion(&wdata->done);
|