err = ceph_fill_inode(in, req->r_locked_page, &rinfo->targeti,
NULL, session,
(!test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags) &&
+ !test_bit(CEPH_MDS_R_DELEG_INO, &req->r_req_flags) &&
rinfo->head->result == 0) ? req->r_fmode : -1,
&req->r_caps_reservation);
if (err < 0) {
rhead->flags = cpu_to_le32(flags);
rhead->num_fwd = req->r_num_fwd;
rhead->num_retry = req->r_attempts - 1;
- rhead->ino = 0;
+ if (test_bit(CEPH_MDS_R_DELEG_INO, &req->r_req_flags))
+ rhead->ino = cpu_to_le64(req->r_deleg_ino);
+ else
+ rhead->ino = 0;
dout(" r_parent = %p\n", req->r_parent);
return 0;
goto out_session;
}
+ if (test_bit(CEPH_MDS_R_DELEG_INO, &req->r_req_flags) &&
+ !req->r_deleg_ino) {
+ req->r_deleg_ino = get_delegated_ino(req->r_session);
+
+ if (!req->r_deleg_ino) {
+ /*
+ * If we can't get a deleg ino, exit with -ECHILD,
+ * so the caller can reissue a sync request
+ */
+ err = -ECHILD;
+ goto out_session;
+ }
+ }
+
/* send request */
req->r_resend_mds = -1; /* forget any previous mds hint */
#define CEPH_MDS_R_GOT_RESULT (5) /* got a result */
#define CEPH_MDS_R_DID_PREPOPULATE (6) /* prepopulated readdir */
#define CEPH_MDS_R_PARENT_LOCKED (7) /* is r_parent->i_rwsem wlocked? */
+#define CEPH_MDS_R_DELEG_INO (8) /* attempt to get r_deleg_ino */
unsigned long r_req_flags;
struct mutex r_fill_mutex;
int r_num_fwd; /* number of forward attempts */
int r_resend_mds; /* mds to resend to next, if any*/
u32 r_sent_on_mseq; /* cap mseq request was sent at*/
+ unsigned long r_deleg_ino;
struct list_head r_wait;
struct completion r_completion;