X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosc%2Fosc_request.c;h=b0ff64081f4c5400b6dde6ac609a53ae1f71369a;hb=3cce65712d94cffe8f1626545845b95b88aef672;hp=a44e8b71980203d9b3e9b622689985ab99630437;hpb=6d21fbbf018b697c9a42977508fac57d9e476877;p=fs%2Flustre-release.git diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index a44e8b7..b0ff640 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -902,12 +902,13 @@ static void osc_grant_work_handler(struct work_struct *data) if (client_gtd.gtd_stopped == 1) return; - if (next_shrink > ktime_get_seconds()) - schedule_delayed_work(&work, msecs_to_jiffies( - (next_shrink - ktime_get_seconds()) * - MSEC_PER_SEC)); - else + if (next_shrink > ktime_get_seconds()) { + time64_t delay = next_shrink - ktime_get_seconds(); + + schedule_delayed_work(&work, cfs_time_seconds(delay)); + } else { schedule_work(&work.work); + } } void osc_schedule_grant_work(void) @@ -1068,8 +1069,11 @@ static int check_write_rcs(struct ptlrpc_request *req, /* return error if any niobuf was in error */ for (i = 0; i < niocount; i++) { - if ((int)remote_rcs[i] < 0) - return(remote_rcs[i]); + if ((int)remote_rcs[i] < 0) { + CDEBUG(D_INFO, "rc[%d]: %d req %p\n", + i, remote_rcs[i], req); + return remote_rcs[i]; + } if (remote_rcs[i] != 0) { CDEBUG(D_INFO, "rc[%d] invalid (%d) req %p\n", @@ -1624,7 +1628,7 @@ static void dump_all_bulk_pages(struct obdo *oa, __u32 page_count, kunmap(pga[i]->pg); } - rc = ll_vfs_fsync_range(filp, 0, LLONG_MAX, 1); + rc = vfs_fsync_range(filp, 0, LLONG_MAX, 1); if (rc) CERROR("%s: sync returns %d\n", dbgcksum_file_name, rc); filp_close(filp, NULL); @@ -2730,6 +2734,22 @@ static int osc_statfs_async(struct obd_export *exp, int rc; ENTRY; + if (obd->obd_osfs_age >= max_age) { + CDEBUG(D_SUPER, + "%s: use %p cache blocks %llu/%llu objects %llu/%llu\n", + obd->obd_name, &obd->obd_osfs, + obd->obd_osfs.os_bavail, obd->obd_osfs.os_blocks, + obd->obd_osfs.os_ffree, obd->obd_osfs.os_files); + spin_lock(&obd->obd_osfs_lock); + memcpy(oinfo->oi_osfs, &obd->obd_osfs, sizeof(*oinfo->oi_osfs)); + spin_unlock(&obd->obd_osfs_lock); + oinfo->oi_flags |= OBD_STATFS_FROM_CACHE; + if (oinfo->oi_cb_up) + oinfo->oi_cb_up(oinfo, 0); + + RETURN(0); + } + /* We could possibly pass max_age in the request (as an absolute * timestamp or a "seconds.usec ago") so the target can avoid doing * extra calls into the filesystem if that isn't necessary (e.g. @@ -3376,8 +3396,6 @@ static int osc_cache_shrink(SHRINKER_ARGS(sc, nr_to_scan, gfp_mask)) static int __init osc_init(void) { - bool enable_proc = true; - struct obd_type *type; unsigned int reqpool_size; unsigned int reqsize; int rc; @@ -3394,11 +3412,7 @@ static int __init osc_init(void) if (rc) RETURN(rc); - type = class_search_type(LUSTRE_OSP_NAME); - if (type != NULL && type->typ_procsym != NULL) - enable_proc = false; - - rc = class_register_type(&osc_obd_ops, NULL, enable_proc, NULL, + rc = class_register_type(&osc_obd_ops, NULL, true, NULL, LUSTRE_OSC_NAME, &osc_device_type); if (rc) GOTO(out_kmem, rc);