-/**
- * Pack SOM attributes into the reply.
- * Call under a DLM UPDATE lock.
- */
-static void mdt_pack_size2body(struct mdt_thread_info *info,
- struct mdt_object *mo)
-{
- struct mdt_body *b;
- struct md_attr *ma = &info->mti_attr;
-
- LASSERT(ma->ma_attr.la_valid & LA_MODE);
- b = req_capsule_server_get(info->mti_pill, &RMF_MDT_BODY);
-
- /* Check if Size-on-MDS is supported, if this is a regular file,
- * if SOM is enabled on the object and if SOM cache exists and valid.
- * Otherwise do not pack Size-on-MDS attributes to the reply. */
- if (!(mdt_conn_flags(info) & OBD_CONNECT_SOM) ||
- !S_ISREG(ma->ma_attr.la_mode) ||
- !mdt_object_is_som_enabled(mo) ||
- !(ma->ma_valid & MA_SOM))
- return;
-
- b->mbo_valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS;
- b->mbo_size = ma->ma_som->msd_size;
- b->mbo_blocks = ma->ma_som->msd_blocks;
-}
-