|
@@ -232,6 +232,30 @@ bad:
|
|
|
return -EIO;
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * parse create results
|
|
|
+ */
|
|
|
+static int parse_reply_info_create(void **p, void *end,
|
|
|
+ struct ceph_mds_reply_info_parsed *info,
|
|
|
+ int features)
|
|
|
+{
|
|
|
+ if (features & CEPH_FEATURE_REPLY_CREATE_INODE) {
|
|
|
+ if (*p == end) {
|
|
|
+ info->has_create_ino = false;
|
|
|
+ } else {
|
|
|
+ info->has_create_ino = true;
|
|
|
+ info->ino = ceph_decode_64(p);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (unlikely(*p != end))
|
|
|
+ goto bad;
|
|
|
+ return 0;
|
|
|
+
|
|
|
+bad:
|
|
|
+ return -EIO;
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* parse extra results
|
|
|
*/
|
|
@@ -241,8 +265,12 @@ static int parse_reply_info_extra(void **p, void *end,
|
|
|
{
|
|
|
if (info->head->op == CEPH_MDS_OP_GETFILELOCK)
|
|
|
return parse_reply_info_filelock(p, end, info, features);
|
|
|
- else
|
|
|
+ else if (info->head->op == CEPH_MDS_OP_READDIR)
|
|
|
return parse_reply_info_dir(p, end, info, features);
|
|
|
+ else if (info->head->op == CEPH_MDS_OP_CREATE)
|
|
|
+ return parse_reply_info_create(p, end, info, features);
|
|
|
+ else
|
|
|
+ return -EIO;
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -2170,7 +2198,8 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
|
|
|
mutex_lock(&req->r_fill_mutex);
|
|
|
err = ceph_fill_trace(mdsc->fsc->sb, req, req->r_session);
|
|
|
if (err == 0) {
|
|
|
- if (result == 0 && req->r_op != CEPH_MDS_OP_GETFILELOCK &&
|
|
|
+ if (result == 0 && (req->r_op == CEPH_MDS_OP_READDIR ||
|
|
|
+ req->r_op == CEPH_MDS_OP_LSSNAP) &&
|
|
|
rinfo->dir_nr)
|
|
|
ceph_readdir_prepopulate(req, req->r_session);
|
|
|
ceph_unreserve_caps(mdsc, &req->r_caps_reservation);
|