Whamcloud - gitweb
LU-1431 ptlrpc: Support for over 1MB bulk I/O RPC
[fs/lustre-release.git] / lustre / mgs / mgs_nids.c
index 55a6dc9..781250f 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, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -669,18 +669,18 @@ int mgs_get_ir_logs(struct ptlrpc_request *req)
         unit_size = min_t(int, 1 << body->mcb_bits, CFS_PAGE_SIZE);
        bytes = mgs_nidtbl_read(req->rq_export, &fsdb->fsdb_nidtbl, res,
                                pages, nrpages, bufsize / unit_size, unit_size);
-        if (bytes < 0)
-                GOTO(out, rc = bytes);
-
-        /* start bulk transfer */
-        page_count = (bytes + CFS_PAGE_SIZE - 1) >> CFS_PAGE_SHIFT;
-        LASSERT(page_count <= nrpages);
-        desc = ptlrpc_prep_bulk_exp(req, page_count,
-                                    BULK_PUT_SOURCE, MGS_BULK_PORTAL);
-        if (desc == NULL)
-                GOTO(out, rc = -ENOMEM);
-
-        for (i = 0; i < page_count && bytes > 0; i++) {
+       if (bytes < 0)
+               GOTO(out, rc = bytes);
+
+       /* start bulk transfer */
+       page_count = (bytes + CFS_PAGE_SIZE - 1) >> CFS_PAGE_SHIFT;
+       LASSERT(page_count <= nrpages);
+       desc = ptlrpc_prep_bulk_exp(req, page_count, 1,
+                                   BULK_PUT_SOURCE, MGS_BULK_PORTAL);
+       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, CFS_PAGE_SIZE));
                 bytes -= CFS_PAGE_SIZE;
@@ -877,14 +877,14 @@ int mgs_fsc_attach(const struct lu_env *env, struct obd_export *exp,
         if (new_fsc == NULL)
                 RETURN(-ENOMEM);
 
-        CFS_INIT_LIST_HEAD(&new_fsc->mfc_export_list);
-        CFS_INIT_LIST_HEAD(&new_fsc->mfc_fsdb_list);
-        new_fsc->mfc_fsdb       = fsdb;
-        new_fsc->mfc_export     = class_export_get(exp);
-        new_fsc->mfc_ir_capable =
-                        !!(exp->exp_connect_flags & OBD_CONNECT_IMP_RECOV);
+       CFS_INIT_LIST_HEAD(&new_fsc->mfc_export_list);
+       CFS_INIT_LIST_HEAD(&new_fsc->mfc_fsdb_list);
+       new_fsc->mfc_fsdb       = fsdb;
+       new_fsc->mfc_export     = class_export_get(exp);
+       new_fsc->mfc_ir_capable = !!(exp_connect_flags(exp) &
+                                    OBD_CONNECT_IMP_RECOV);
 
-        rc = -EEXIST;
+       rc = -EEXIST;
        mutex_lock(&fsdb->fsdb_mutex);
 
        /* tend to find it in export list because this list is shorter. */