X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdc%2Fmdc_request.c;h=a0e392aecfc809b9fa4c033adf01e721c89191e5;hp=1f2c6ebefd16022a916d1095add6601b1eeabf65;hb=e2af7fb3c91dfb13d34d8e1b2f2df8c09621f768;hpb=9f55850b884cac1c7bbde6d3b02764b712a2921f diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 1f2c6eb..a0e392a 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,18 +26,14 @@ /* * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. - */ -/* - * Copyright (c) 2011 Whamcloud, Inc. + * + * Copyright (c) 2011, 2012, Whamcloud, Inc. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. */ -#ifndef EXPORT_SYMTAB -# define EXPORT_SYMTAB -#endif #define DEBUG_SUBSYSTEM S_MDC #ifdef __KERNEL__ @@ -1019,9 +1013,8 @@ out: EXPORT_SYMBOL(mdc_sendpage); #endif -int mdc_readpage(struct obd_export *exp, const struct lu_fid *fid, - struct obd_capa *oc, __u64 offset, struct page **pages, - unsigned npages, struct ptlrpc_request **request) +int mdc_readpage(struct obd_export *exp, struct md_op_data *op_data, + struct page **pages, struct ptlrpc_request **request) { struct ptlrpc_request *req; struct ptlrpc_bulk_desc *desc; @@ -1040,7 +1033,7 @@ restart_bulk: if (req == NULL) RETURN(-ENOMEM); - mdc_set_capa_size(req, &RMF_CAPA1, oc); + mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1); rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_READPAGE); if (rc) { @@ -1051,7 +1044,7 @@ restart_bulk: req->rq_request_portal = MDS_READPAGE_PORTAL; ptlrpc_at_set_req_timeout(req); - desc = ptlrpc_prep_bulk_imp(req, npages, BULK_PUT_SINK, + desc = ptlrpc_prep_bulk_imp(req, op_data->op_npages, BULK_PUT_SINK, MDS_BULK_PORTAL); if (desc == NULL) { ptlrpc_request_free(req); @@ -1059,10 +1052,12 @@ restart_bulk: } /* NB req now owns desc and will free it when it gets freed */ - for (i = 0; i < npages; i++) + for (i = 0; i < op_data->op_npages; i++) ptlrpc_prep_bulk_page(desc, pages[i], 0, CFS_PAGE_SIZE); - mdc_readdir_pack(req, offset, CFS_PAGE_SIZE * npages, fid, oc); + mdc_readdir_pack(req, op_data->op_offset, + CFS_PAGE_SIZE * op_data->op_npages, + &op_data->op_fid1, op_data->op_capa1); ptlrpc_request_set_replen(req); rc = ptlrpc_queue_wait(req); @@ -1092,7 +1087,7 @@ restart_bulk: if (req->rq_bulk->bd_nob_transferred & ~LU_PAGE_MASK) { CERROR("Unexpected # bytes transferred: %d (%ld expected)\n", req->rq_bulk->bd_nob_transferred, - CFS_PAGE_SIZE * npages); + CFS_PAGE_SIZE * op_data->op_npages); ptlrpc_req_finished(req); RETURN(-EPROTO); } @@ -1101,9 +1096,11 @@ restart_bulk: RETURN(0); } -static int mdc_statfs(struct obd_device *obd, struct obd_statfs *osfs, +static int mdc_statfs(const struct lu_env *env, + struct obd_export *exp, struct obd_statfs *osfs, __u64 max_age, __u32 flags) { + struct obd_device *obd = class_exp2obd(exp); struct ptlrpc_request *req; struct obd_statfs *msfs; struct obd_import *imp = NULL; @@ -1183,7 +1180,7 @@ static int mdc_ioc_fid2path(struct obd_export *exp, struct getinfo_fid2path *gf) /* Val is struct getinfo_fid2path result plus path */ vallen = sizeof(*gf) + gf->gf_pathlen; - rc = obd_get_info(exp, keylen, key, &vallen, gf, NULL); + rc = obd_get_info(NULL, exp, keylen, key, &vallen, gf, NULL); if (rc) GOTO(out, rc); @@ -1468,7 +1465,7 @@ static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len, struct ioc_changelog *icc = karg; struct changelog_setinfo cs = {.cs_recno = icc->icc_recno, .cs_id = icc->icc_id}; - rc = obd_set_info_async(exp, strlen(KEY_CHANGELOG_CLEAR), + rc = obd_set_info_async(NULL, exp, strlen(KEY_CHANGELOG_CLEAR), KEY_CHANGELOG_CLEAR, sizeof(cs), &cs, NULL); GOTO(out, rc); @@ -1525,7 +1522,7 @@ static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len, (int) sizeof(struct obd_uuid)))) GOTO(out, rc = -EFAULT); - rc = mdc_statfs(obd, &stat_buf, + rc = mdc_statfs(NULL, obd->obd_self_export, &stat_buf, cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), 0); if (rc != 0) @@ -1721,7 +1718,8 @@ static int mdc_hsm_copytool_send(int len, void *val) RETURN(rc); } -int mdc_set_info_async(struct obd_export *exp, +int mdc_set_info_async(const struct lu_env *env, + struct obd_export *exp, obd_count keylen, void *key, obd_count vallen, void *val, struct ptlrpc_request_set *set) @@ -1778,8 +1776,9 @@ int mdc_set_info_async(struct obd_export *exp, RETURN(rc); } -int mdc_get_info(struct obd_export *exp, __u32 keylen, void *key, - __u32 *vallen, void *val, struct lov_stripe_md *lsm) +int mdc_get_info(const struct lu_env *env, struct obd_export *exp, + __u32 keylen, void *key, __u32 *vallen, void *val, + struct lov_stripe_md *lsm) { int rc = -EINVAL;