Whamcloud - gitweb
LU-4423 mem: remove GFP_IOFS
[fs/lustre-release.git] / lustre / mgs / mgs_nids.c
index b376807..4420b64 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2015, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -43,6 +43,7 @@
 #define DEBUG_SUBSYSTEM S_MGS
 #define D_MGS D_CONFIG
 
+#include <linux/kthread.h>
 #include <linux/pagemap.h>
 
 #include <obd.h>
@@ -145,7 +146,7 @@ static int mgs_nidtbl_read(struct obd_export *exp, struct mgs_nidtbl *tbl,
 
                        if (units_in_page == 0) {
                                /* allocate a new page */
-                               pages[index] = alloc_page(GFP_IOFS);
+                               pages[index] = alloc_page(GFP_KERNEL);
                                if (pages[index] == NULL) {
                                        rc = -ENOMEM;
                                        break;
@@ -657,18 +658,22 @@ int mgs_get_ir_logs(struct ptlrpc_request *req)
        page_count = (bytes + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
        LASSERT(page_count <= nrpages);
        desc = ptlrpc_prep_bulk_exp(req, page_count, 1,
-                                   BULK_PUT_SOURCE, MGS_BULK_PORTAL);
+                                   PTLRPC_BULK_PUT_SOURCE |
+                                       PTLRPC_BULK_BUF_KIOV,
+                                   MGS_BULK_PORTAL,
+                                   &ptlrpc_bulk_kiov_pin_ops);
        if (desc == NULL)
                GOTO(out, rc = -ENOMEM);
 
        for (i = 0; i < page_count && bytes > 0; i++) {
-               ptlrpc_prep_bulk_page_pin(desc, pages[i], 0,
-                                         min_t(int, bytes, PAGE_CACHE_SIZE));
+               desc->bd_frag_ops->add_kiov_frag(desc, pages[i], 0,
+                                                min_t(int, bytes,
+                                                     PAGE_CACHE_SIZE));
                bytes -= PAGE_CACHE_SIZE;
         }
 
         rc = target_bulk_io(req->rq_export, desc, &lwi);
-       ptlrpc_free_bulk_pin(desc);
+       ptlrpc_free_bulk(desc);
 
 out:
        for (i = 0; i < nrpages; i++) {