- CDEBUG(D_INODE, "READPAGE at "LPX64" from "DFID"\n", offset, PFID(&rid));
-
- /*
- * This case handle directory lookup in clustered metadata case (i.e.
- * split directory is located on multiple md servers.)
- * each server keeps directory entries for certain range of hashes.
- * E.g. we have N server and suppose hash range is 0 to MAX_HASH.
- * first server will keep records with hashes [ 0 ... MAX_HASH / N - 1],
- * second one with hashes [MAX_HASH / N ... 2 * MAX_HASH / N] and
- * so on....
- * readdir can simply start reading entries from 0 - N server in
- * order but that will not scale well as all client will request dir in
- * to server in same order.
- * Following algorithm does optimization:
- * Instead of doing readdir in 1, 2, ...., N order, client with a
- * rank R does readdir in R, R + 1, ..., N, 1, ... R - 1 order.
- * (every client has rank R)
- * But ll_readdir() expect offset range [0 to MAX_HASH/N) but
- * since client ask dir from MDS{R} client has pages with offsets
- * [R*MAX_HASH/N ... (R + 1)*MAX_HASH/N] there for we do hash_adj
- * on hash values that we get.
- */
- obj = lmv_object_find_lock(obd, &rid);
- if (obj) {
- nr = obj->lo_objcount;
- LASSERT(nr > 0);
- seg_size = MAX_HASH_SIZE;
- do_div(seg_size, nr);
- los = obj->lo_stripes;
- tgt = lmv_get_target(lmv, los[0].ls_mds);
- rank = lmv_node_rank(tgt->ltd_exp, &rid) % nr;
- tgt_tmp = offset;
- do_div(tgt_tmp, seg_size);
- tgt0_idx = do_div(tgt_tmp, nr);
- tgt_idx = (tgt0_idx + rank) % nr;
-
- if (tgt_idx < tgt0_idx)
- /*
- * Wrap around.
- *
- * Last segment has unusual length due to division
- * rounding.
- */
- hash_adj = MAX_HASH_SIZE - seg_size * nr;
- else
- hash_adj = 0;
-
- hash_adj += rank * seg_size;
-
- CDEBUG(D_INODE, "Readpage hash adjustment: %x "LPX64" "
- LPX64"/%x -> "LPX64"/%x\n", rank, hash_adj,
- offset, tgt0_idx, offset + hash_adj, tgt_idx);
-
- offset = (offset + hash_adj) & MAX_HASH_SIZE;
- rid = obj->lo_stripes[tgt_idx].ls_fid;
- tgt = lmv_get_target(lmv, los[tgt_idx].ls_mds);
-
- CDEBUG(D_INODE, "Forward to "DFID" with offset %lu i %d\n",
- PFID(&rid), (unsigned long)offset, tgt_idx);
- } else
- tgt = lmv_find_target(lmv, &rid);
-
- if (IS_ERR(tgt))
- GOTO(cleanup, rc = PTR_ERR(tgt));
+ CDEBUG(D_INODE, "READPAGE at "LPX64" from "DFID"\n",
+ offset, PFID(&op_data->op_fid1));
+
+ /*
+ * This case handle directory lookup in clustered metadata case (i.e.
+ * split directory is located on multiple md servers.)
+ * each server keeps directory entries for certain range of hashes.
+ * E.g. we have N server and suppose hash range is 0 to MAX_HASH.
+ * first server will keep records with hashes [ 0 ... MAX_HASH /N - 1],
+ * second one with hashes [MAX_HASH / N ... 2 * MAX_HASH / N] and
+ * so on....
+ * readdir can simply start reading entries from 0 - N server in
+ * order but that will not scale well as all client will request dir in
+ * to server in same order.
+ * Following algorithm does optimization:
+ * Instead of doing readdir in 1, 2, ...., N order, client with a
+ * rank R does readdir in R, R + 1, ..., N, 1, ... R - 1 order.
+ * (every client has rank R)
+ * But ll_readdir() expect offset range [0 to MAX_HASH/N) but
+ * since client ask dir from MDS{R} client has pages with offsets
+ * [R*MAX_HASH/N ... (R + 1)*MAX_HASH/N] there for we do hash_adj
+ * on hash values that we get.
+ if (0) {
+ LASSERT(nr > 0);
+ seg_size = MAX_HASH_SIZE;
+ do_div(seg_size, nr);
+ los = obj->lo_stripes;
+ tgt = lmv_get_target(lmv, los[0].ls_mds);
+ rank = lmv_node_rank(tgt->ltd_exp, fid) % nr;
+ tgt_tmp = offset;
+ do_div(tgt_tmp, seg_size);
+ tgt0_idx = do_div(tgt_tmp, nr);
+ tgt_idx = (tgt0_idx + rank) % nr;
+
+ if (tgt_idx < tgt0_idx)
+ * Wrap around.
+ *
+ * Last segment has unusual length due to division
+ * rounding.
+ hash_adj = MAX_HASH_SIZE - seg_size * nr;
+ else
+ hash_adj = 0;
+
+ hash_adj += rank * seg_size;
+
+ CDEBUG(D_INODE, "Readpage hash adjustment: %x "LPX64" "
+ LPX64"/%x -> "LPX64"/%x\n", rank, hash_adj,
+ offset, tgt0_idx, offset + hash_adj, tgt_idx);
+
+ offset = (offset + hash_adj) & MAX_HASH_SIZE;
+ rid = lsm->mea_oinfo[tgt_idx].lmo_fid;
+ tgt = lmv_get_target(lmv, lsm->mea_oinfo[tgt_idx].lmo_mds);
+
+ CDEBUG(D_INODE, "Forward to "DFID" with offset %lu i %d\n",
+ PFID(&rid), (unsigned long)offset, tgt_idx);
+ }
+ */
+ tgt = lmv_find_target(lmv, &op_data->op_fid1);
+ if (IS_ERR(tgt))
+ RETURN(PTR_ERR(tgt));