if (cmd == OBD_BRW_WRITE) {
struct lu_nodemap *nodemap;
- __u32 mapped_uid, mapped_gid;
+ __u32 mapped_uid, mapped_gid, mapped_projid;
nodemap = nodemap_get_from_exp(exp);
if (IS_ERR(nodemap))
mapped_gid = nodemap_map_id(nodemap, NODEMAP_GID,
NODEMAP_FS_TO_CLIENT,
oa->o_gid);
+ mapped_projid = nodemap_map_id(nodemap, NODEMAP_PROJID,
+ NODEMAP_FS_TO_CLIENT,
+ oa->o_projid);
if (!IS_ERR_OR_NULL(nodemap)) {
/* do not bypass quota enforcement if squashed uid */
if (unlikely(mapped_uid == nodemap->nm_squash_uid)) {
*/
oa->o_uid = mapped_uid;
oa->o_gid = mapped_gid;
+ oa->o_projid = mapped_projid;
} else if (cmd == OBD_BRW_READ) {
/* If oa != NULL then mdt_preprw_read updated the inode
* atime and we should update the lvb so that other glimpses
lock_res(res);
res_lvb = res->lr_lvb_data;
- if (lvb)
- *lvb = *res_lvb;
-
- if (mb) {
- mb->mbo_dom_size = res_lvb->lvb_size;
- mb->mbo_dom_blocks = res_lvb->lvb_blocks;
- mb->mbo_mtime = res_lvb->lvb_mtime;
- mb->mbo_ctime = res_lvb->lvb_ctime;
- mb->mbo_atime = res_lvb->lvb_atime;
- mb->mbo_valid |= OBD_MD_FLATIME | OBD_MD_FLCTIME |
- OBD_MD_FLMTIME | OBD_MD_DOM_SIZE;
+ if (res_lvb) {
+ if (lvb)
+ *lvb = *res_lvb;
+
+ if (mb) {
+ mb->mbo_dom_size = res_lvb->lvb_size;
+ mb->mbo_dom_blocks = res_lvb->lvb_blocks;
+ mb->mbo_mtime = res_lvb->lvb_mtime;
+ mb->mbo_ctime = res_lvb->lvb_ctime;
+ mb->mbo_atime = res_lvb->lvb_atime;
+ mb->mbo_valid |= OBD_MD_FLATIME | OBD_MD_FLCTIME |
+ OBD_MD_FLMTIME | OBD_MD_DOM_SIZE;
+ }
+ CDEBUG(D_DLMTRACE, "size %llu\n", res_lvb->lvb_size);
}
- CDEBUG(D_DLMTRACE, "size %llu\n", res_lvb->lvb_size);
unlock_res(res);
}