+void mds_getattr_pack(struct ptlrpc_request *req, int offset,
+ struct inode *inode,
+ const char *name, int namelen)
+{
+ struct mds_body *b;
+ b = lustre_msg_buf(req->rq_reqmsg, offset);
+
+ b->fsuid = HTON__u32(current->fsuid);
+ b->fsgid = HTON__u32(current->fsgid);
+ b->capability = HTON__u32(current->cap_effective);
+
+ ll_inode2fid(&b->fid1, inode);
+ if (name) {
+ char *tmp;
+ tmp = lustre_msg_buf(req->rq_reqmsg, offset + 1);
+ LOGL0(name, namelen, tmp);
+ }
+}
+
+void mds_readdir_pack(struct ptlrpc_request *req, __u64 offset,
+ obd_id ino, int type)
+{
+ struct mds_body *b;
+
+ b = lustre_msg_buf(req->rq_reqmsg, 0);
+ b->fsuid = HTON__u32(current->fsuid);
+ b->fsgid = HTON__u32(current->fsgid);
+ b->capability = HTON__u32(current->cap_effective);
+ b->fid1.id = HTON__u64(ino);
+ b->fid1.f_type = HTON__u32(type);
+ b->size = HTON__u64(offset);
+}
+
+
+void mds_pack_req_body(struct ptlrpc_request *req)
+{
+ struct mds_body *b = lustre_msg_buf(req->rq_reqmsg, 0);
+ mds_pack_body(b);
+}
+
+void mds_pack_rep_body(struct ptlrpc_request *req)
+{
+ struct mds_body *b = lustre_msg_buf(req->rq_repmsg, 0);
+ mds_pack_body(b);
+}
+
+