+ RETURN(0);
+}
+
+int ll_set_trunc_capa(struct ptlrpc_request *req, int offset, struct inode *inode)
+{
+ struct mds_body *body;
+ struct obd_capa *ocapa;
+ struct lustre_capa *capa;
+ struct ll_inode_info *lli = ll_i2info(inode);
+
+ body = lustre_msg_buf(req->rq_repmsg, offset, sizeof(*body));
+ if (!body)
+ return -ENOMEM;
+
+ if (!(body->valid & OBD_MD_CAPA))
+ return 0;
+
+ ENTRY;
+ capa = (struct lustre_capa *)lustre_swab_repbuf(req, offset + 1,
+ sizeof(*capa), lustre_swab_lustre_capa);
+ if (!capa)
+ RETURN(-ENOMEM);
+
+ ocapa = capa_renew(capa, CLIENT_CAPA);
+ if (!ocapa)
+ RETURN(-ENOMEM);
+
+ spin_lock(&lli->lli_lock);
+ /* in case it was linked to lli_capas already */
+ if (list_empty(&ocapa->c_lli_list))
+ list_add(&ocapa->c_lli_list, &lli->lli_capas);
+ spin_unlock(&lli->lli_lock);
+
+ RETURN(0);
+}
+
+struct obd_capa *ll_get_capa(struct inode *inode, uid_t uid, int op)
+{
+ struct ll_inode_info *lli = ll_i2info(inode);
+ struct obd_capa *ocapa, *tmp;
+ ENTRY;
+
+ list_for_each_entry_safe(ocapa, tmp, &lli->lli_capas, c_lli_list) {
+ if (ocapa->c_capa.lc_ruid != uid)
+ continue;
+ if (ocapa->c_capa.lc_op != op)
+ continue;
+
+ RETURN(ocapa);
+ }
+
+ RETURN(NULL);