X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Fcl_object.c;h=9b3e71b6907feca5d48488a09a16dcf60d8a685e;hb=94fe3dadb5774af0eb0fec6d21aa73a22ac4838c;hp=a63b0cfe6009d6ee531c812fb792486c8f4b9ad9;hpb=3742646beeb658f321745f5c275836879b9d077d;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/cl_object.c b/lustre/obdclass/cl_object.c index a63b0cf..9b3e71b 100644 --- a/lustre/obdclass/cl_object.c +++ b/lustre/obdclass/cl_object.c @@ -474,6 +474,22 @@ int cl_object_layout_get(const struct lu_env *env, struct cl_object *obj, } EXPORT_SYMBOL(cl_object_layout_get); +loff_t cl_object_maxbytes(struct cl_object *obj) +{ + struct lu_object_header *top = obj->co_lu.lo_header; + loff_t maxbytes = LLONG_MAX; + ENTRY; + + list_for_each_entry(obj, &top->loh_layers, co_lu.lo_linkage) { + if (obj->co_ops->coo_maxbytes != NULL) + maxbytes = min_t(loff_t, obj->co_ops->coo_maxbytes(obj), + maxbytes); + } + + RETURN(maxbytes); +} +EXPORT_SYMBOL(cl_object_maxbytes); + /** * Helper function removing all object locks, and marking object for * deletion. All object pages must have been deleted at this point.