X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdfilter%2Flproc_obdfilter.c;h=e39ae9b0fe241b1360139742a65e5c0cae00d7c2;hb=4aae7fae328fbb395601a8d323b831a3f12c7206;hp=e18d6e9bda98be8abdee7f64779d683ab5d9efbc;hpb=2b87d9a6d9eefab2209030b167df7998c3d4c1d0;p=fs%2Flustre-release.git diff --git a/lustre/obdfilter/lproc_obdfilter.c b/lustre/obdfilter/lproc_obdfilter.c index e18d6e9..e39ae9b 100644 --- a/lustre/obdfilter/lproc_obdfilter.c +++ b/lustre/obdfilter/lproc_obdfilter.c @@ -88,10 +88,10 @@ static int lprocfs_filter_rd_mntdev(char *page, char **start, off_t off, struct obd_device *obd = (struct obd_device *)data; LASSERT(obd != NULL); - LASSERT(obd->u.filter.fo_vfsmnt->mnt_devname); + LASSERT(obd->u.obt.obt_vfsmnt->mnt_devname); *eof = 1; return snprintf(page, count, "%s\n", - obd->u.filter.fo_vfsmnt->mnt_devname); + obd->u.obt.obt_vfsmnt->mnt_devname); } static int lprocfs_filter_rd_last_id(char *page, char **start, off_t off, @@ -101,7 +101,7 @@ static int lprocfs_filter_rd_last_id(char *page, char **start, off_t off, struct filter_obd *filter = &obd->u.filter; int retval = 0, rc, i; - if (obd == NULL) + if (obd == NULL || !obd->obd_set_up || obd->obd_stopping) return 0; rc = snprintf(page, count, LPU64"\n",filter_last_id(filter, 0)); if (rc < 0) @@ -110,7 +110,7 @@ static int lprocfs_filter_rd_last_id(char *page, char **start, off_t off, count -= rc; retval += rc; - for (i = FILTER_GROUP_MDS1_N_BASE; i < filter->fo_group_count; i++) { + for (i = FID_SEQ_OST_MDT1; i < filter->fo_group_count; i++) { rc = snprintf(page, count, LPU64"\n",filter_last_id(filter, i)); if (rc < 0) { retval = rc; @@ -183,7 +183,8 @@ int lprocfs_filter_rd_fmd_max_age(char *page, char **start, off_t off, struct obd_device *obd = data; int rc; - rc = snprintf(page, count, "%u\n", obd->u.filter.fo_fmd_max_age / HZ); + rc = snprintf(page, count, "%u\n", + obd->u.filter.fo_fmd_max_age / CFS_HZ); return rc; } @@ -201,7 +202,7 @@ int lprocfs_filter_wr_fmd_max_age(struct file *file, const char *buffer, if (val > 65536 || val < 1) return -EINVAL; - obd->u.filter.fo_fmd_max_age = val * HZ; + obd->u.filter.fo_fmd_max_age = val * CFS_HZ; return count; } @@ -299,9 +300,9 @@ static int lprocfs_filter_wr_cache(struct file *file, const char *buffer, if (rc) return rc; - spin_lock_bh(&obd->obd_processing_task_lock); + cfs_spin_lock_bh(&obd->obd_processing_task_lock); obd->u.filter.fo_read_cache = val; - spin_unlock_bh(&obd->obd_processing_task_lock); + cfs_spin_unlock_bh(&obd->obd_processing_task_lock); return count; } @@ -326,9 +327,9 @@ static int lprocfs_filter_wr_wcache(struct file *file, const char *buffer, if (rc) return rc; - spin_lock_bh(&obd->obd_processing_task_lock); + cfs_spin_lock_bh(&obd->obd_processing_task_lock); obd->u.filter.fo_writethrough_cache = val; - spin_unlock_bh(&obd->obd_processing_task_lock); + cfs_spin_unlock_bh(&obd->obd_processing_task_lock); return count; } @@ -359,9 +360,9 @@ int lprocfs_filter_wr_degraded(struct file *file, const char *buffer, if (rc) return rc; - spin_lock(&obd->obd_osfs_lock); + cfs_spin_lock(&obd->obd_osfs_lock); obd->u.filter.fo_raid_degraded = !!val; - spin_unlock(&obd->obd_osfs_lock); + cfs_spin_unlock(&obd->obd_osfs_lock); return count; } @@ -381,9 +382,11 @@ static struct lprocfs_vars lprocfs_filter_obd_vars[] = { { "tot_pending", lprocfs_filter_rd_tot_pending, 0, 0 }, { "tot_granted", lprocfs_filter_rd_tot_granted, 0, 0 }, { "hash_stats", lprocfs_obd_rd_hash, 0, 0 }, - { "recovery_status", lprocfs_obd_rd_recovery_status, 0, 0 }, - { "recovery_maxtime", lprocfs_obd_rd_recovery_maxtime, - lprocfs_obd_wr_recovery_maxtime, 0}, + { "recovery_status", lprocfs_obd_rd_recovery_status, 0, 0 }, + { "recovery_time_soft", lprocfs_obd_rd_recovery_time_soft, + lprocfs_obd_wr_recovery_time_soft, 0}, + { "recovery_time_hard", lprocfs_obd_rd_recovery_time_hard, + lprocfs_obd_wr_recovery_time_hard, 0}, { "evict_client", 0, lprocfs_wr_evict_client, 0, &lprocfs_evict_client_fops}, { "num_exports", lprocfs_rd_num_exports, 0, 0 }, @@ -508,7 +511,7 @@ static void brw_stats_show(struct seq_file *seq, struct brw_stats *brw_stats) struct timeval now; /* this sampling races with updates */ - do_gettimeofday(&now); + cfs_gettimeofday(&now); seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n", now.tv_sec, now.tv_usec); @@ -534,7 +537,7 @@ static void brw_stats_show(struct seq_file *seq, struct brw_stats *brw_stats) { char title[24]; - sprintf(title, "I/O time (1/%ds)", HZ); + sprintf(title, "I/O time (1/%ds)", CFS_HZ); display_brw_stats(seq, title, "ios", &brw_stats->hist[BRW_R_IO_TIME], &brw_stats->hist[BRW_W_IO_TIME], 1);