X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Flov%2Flov_object.c;h=21c24c224d4ea99bb13c6ed4c29fb41dbbe18785;hp=c852ab5c1152232d83d5b5dc42c02fb3d3cf72c2;hb=94fe3dadb5774af0eb0fec6d21aa73a22ac4838c;hpb=3742646beeb658f321745f5c275836879b9d077d diff --git a/lustre/lov/lov_object.c b/lustre/lov/lov_object.c index c852ab5..21c24c2 100644 --- a/lustre/lov/lov_object.c +++ b/lustre/lov/lov_object.c @@ -1599,6 +1599,22 @@ static int lov_object_layout_get(const struct lu_env *env, RETURN(rc < 0 ? rc : 0); } +static loff_t lov_object_maxbytes(struct cl_object *obj) +{ + struct lov_object *lov = cl2lov(obj); + struct lov_stripe_md *lsm = lov_lsm_addref(lov); + loff_t maxbytes; + + if (lsm == NULL) + return LLONG_MAX; + + maxbytes = lsm->lsm_maxbytes; + + lov_lsm_put(lsm); + + return maxbytes; +} + static int lov_object_find_cbdata(const struct lu_env *env, struct cl_object *obj, ldlm_iterator_t iter, void *data) @@ -1621,6 +1637,7 @@ static const struct cl_object_operations lov_ops = { .coo_conf_set = lov_conf_set, .coo_getstripe = lov_object_getstripe, .coo_layout_get = lov_object_layout_get, + .coo_maxbytes = lov_object_maxbytes, .coo_find_cbdata = lov_object_find_cbdata, .coo_fiemap = lov_object_fiemap, .coo_data_version = lov_object_data_version,