X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flod%2Flod_qos.c;h=33f8d0fec03b53745c9a3fdf6fd45aa441799952;hb=c236efcd5ed186c5813cc6b11d0b1b12d8ec0734;hp=065ade07f697281079b4097a742fe8d5e7fd679c;hpb=979203503af2f77d51bcf27375a1a09f5f28a4a3;p=fs%2Flustre-release.git diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index 065ade0..33f8d0f 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -6,13 +6,13 @@ * 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. - + * * 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 COPYING file that accompanied this code. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -23,7 +23,7 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved * Use is subject to license terms. * - * Copyright (c) 2012, 2013, Intel Corporation. + * Copyright (c) 2012, 2014, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -50,13 +50,8 @@ #define D_QOS D_OTHER -#if 0 -#define QOS_DEBUG(fmt, ...) CDEBUG(D_OTHER, fmt, ## __VA_ARGS__) -#define QOS_CONSOLE(fmt, ...) LCONSOLE(D_OTHER, fmt, ## __VA_ARGS__) -#else -#define QOS_DEBUG(fmt, ...) -#define QOS_CONSOLE(fmt, ...) -#endif +#define QOS_DEBUG(fmt, ...) CDEBUG(D_QOS, fmt, ## __VA_ARGS__) +#define QOS_CONSOLE(fmt, ...) LCONSOLE(D_QOS, fmt, ## __VA_ARGS__) #define TGT_BAVAIL(i) (OST_TGT(lod,i)->ltd_statfs.os_bavail * \ OST_TGT(lod,i)->ltd_statfs.os_bsize) @@ -195,6 +190,7 @@ static int lod_statfs_and_check(const struct lu_env *env, struct lod_device *d, { struct lod_tgt_desc *ost; int rc; + ENTRY; LASSERT(d); ost = OST_TGT(d,index); @@ -258,7 +254,7 @@ static void lod_qos_statfs_update(const struct lu_env *env, struct obd_device *obd = lod2obd(lod); struct ost_pool *osts = &(lod->lod_pool_info); unsigned int i; - int idx, rc = 0; + int idx; __u64 max_age, avail; ENTRY; @@ -270,15 +266,14 @@ static void lod_qos_statfs_update(const struct lu_env *env, down_write(&lod->lod_qos.lq_rw_sem); if (cfs_time_beforeq_64(max_age, obd->obd_osfs_age)) - GOTO(out, rc = 0); + goto out; for (i = 0; i < osts->op_count; i++) { idx = osts->op_array[i]; avail = OST_TGT(lod,idx)->ltd_statfs.os_bavail; - rc = lod_statfs_and_check(env, lod, idx, - &OST_TGT(lod,idx)->ltd_statfs); - if (rc) - break; + if (lod_statfs_and_check(env, lod, idx, + &OST_TGT(lod, idx)->ltd_statfs)) + continue; if (OST_TGT(lod,idx)->ltd_statfs.os_bavail != avail) /* recalculate weigths */ lod->lod_qos.lq_dirty = 1;