X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdfilter%2Ffilter_lvb.c;h=f3df18a9e64895b39a93706bd9fc8ee809ca8349;hb=90dfed8469d46f4b79ebdff8121eb109b5db6746;hp=387fc9752c80c62bdb5a3652a87dc45c7c61ea1e;hpb=06bf3d4a5ebd0fd855aff76feb73b4bb7592cfa2;p=fs%2Flustre-release.git diff --git a/lustre/obdfilter/filter_lvb.c b/lustre/obdfilter/filter_lvb.c index 387fc97..f3df18a 100644 --- a/lustre/obdfilter/filter_lvb.c +++ b/lustre/obdfilter/filter_lvb.c @@ -1,30 +1,43 @@ /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: * - * linux/fs/obdfilter/filter_log.c + * GPL HEADER START * - * Copyright (c) 2001-2003 Cluster File Systems, Inc. - * Author: Peter Braam - * Author: Andreas Dilger - * Author: Phil Schwan + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * This file is part of the Lustre file system, http://www.lustre.org - * Lustre is a trademark of Cluster File Systems, Inc. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. * - * You may have signed or agreed to another license before downloading - * this software. If so, you are bound by the terms and conditions - * of that agreement, and the following does not apply to you. See the - * LICENSE file included with this distribution for more information. + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). * - * If you did not agree to a different license, then this copy of Lustre - * is open source software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf * - * In either case, Lustre is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * license text for more details. + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + * GPL HEADER END + */ +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Use is subject to license terms. + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Sun Microsystems, Inc. + * + * lustre/obdfilter/filter_lvb.c + * + * Author: Peter Braam + * Author: Andreas Dilger + * Author: Phil Schwan */ #define DEBUG_SUBSYSTEM S_FILTER @@ -66,6 +79,10 @@ static int filter_lvbo_init(struct ldlm_resource *res) obd = res->lr_namespace->ns_lvbp; LASSERT(obd != NULL); + CDEBUG(D_INODE, "%s: filter_lvbo_init(o_gr="LPU64", o_id=" + LPU64")\n", obd->obd_name, res->lr_name.name[1], + res->lr_name.name[0]); + dentry = filter_fid2dentry(obd, NULL, res->lr_name.name[1], res->lr_name.name[0]); if (IS_ERR(dentry)) { @@ -103,8 +120,8 @@ out_dentry: * * If 'increase_only' is true, don't allow values to move backwards. */ -static int filter_lvbo_update(struct ldlm_resource *res, struct lustre_msg *m, - int buf_idx, int increase_only) +static int filter_lvbo_update(struct ldlm_resource *res, + struct ptlrpc_request *r, int increase_only) { int rc = 0; struct ost_lvb *lvb; @@ -114,7 +131,7 @@ static int filter_lvbo_update(struct ldlm_resource *res, struct lustre_msg *m, LASSERT(res); - down(&res->lr_lvb_sem); + cfs_down(&res->lr_lvb_sem); lvb = res->lr_lvb_data; if (lvb == NULL) { CERROR("No lvb when running lvbo_update!\n"); @@ -122,11 +139,12 @@ static int filter_lvbo_update(struct ldlm_resource *res, struct lustre_msg *m, } /* Update the LVB from the network message */ - if (m != NULL) { + if (r != NULL) { struct ost_lvb *new; - new = lustre_swab_buf(m, buf_idx, sizeof(*new), - lustre_swab_ost_lvb); + /* XXX update always from reply buffer */ + new = req_capsule_server_get(&r->rq_pill, &RMF_DLM_LVB); + if (new == NULL) { CERROR("lustre_swab_buf failed\n"); goto disk_update; @@ -206,7 +224,7 @@ out_dentry: f_dput(dentry); out: - up(&res->lr_lvb_sem); + cfs_up(&res->lr_lvb_sem); return rc; }