* 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/
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;
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. */