@@ -115,16 +115,20 @@ static inline bool lmv_dir_bad_hash(const struct lmv_stripe_md *lsm)
static inline void lsm_md_dump(int mask, const struct lmv_stripe_md *lsm)
{
+ bool valid_hash = lmv_dir_bad_hash(lsm);
int i;
/* If lsm_md_magic == LMV_MAGIC_FOREIGN pool_name may not be a null
* terminated string so only print LOV_MAXPOOLNAME bytes.
*/
CDEBUG(mask,
- "magic %#x stripe count %d master mdt %d hash type %#x max inherit %hhu version %d migrate offset %d migrate hash %#x pool %.*s\n",
+ "magic %#x stripe count %d master mdt %d hash type %s:%#x max inherit %hhu version %d migrate offset %d migrate hash %#x pool %.*s\n",
lsm->lsm_md_magic, lsm->lsm_md_stripe_count,
- lsm->lsm_md_master_mdt_index, lsm->lsm_md_hash_type,
- lsm->lsm_md_max_inherit, lsm->lsm_md_layout_version,
+ lsm->lsm_md_master_mdt_index,
+ valid_hash ? "invalid hash" :
+ mdt_hash_name[lsm->lsm_md_hash_type & (LMV_HASH_TYPE_MAX - 1)],
+ lsm->lsm_md_hash_type, lsm->lsm_md_max_inherit,
+ lsm->lsm_md_layout_version,
lsm->lsm_md_migrate_offset, lsm->lsm_md_migrate_hash,
LOV_MAXPOOLNAME, lsm->lsm_md_pool_name);
@@ -404,10 +408,13 @@ static inline bool lmv_user_magic_supported(u32 lum_magic)
#define LMV_DEBUG(mask, lmv, msg) \
CDEBUG(mask, \
- "%s LMV: magic=%#x count=%u index=%u hash=%#x version=%u migrate offset=%u migrate hash=%u.\n",\
+ "%s LMV: magic=%#x count=%u index=%u hash=%s:%#x version=%u migrate offset=%u migrate hash=%s:%u.\n",\
msg, (lmv)->lmv_magic, (lmv)->lmv_stripe_count, \
- (lmv)->lmv_master_mdt_index, (lmv)->lmv_hash_type, \
- (lmv)->lmv_layout_version, (lmv)->lmv_migrate_offset, \
+ (lmv)->lmv_master_mdt_index, \
+ mdt_hash_name[(lmv)->lmv_hash_type & (LMV_HASH_TYPE_MAX - 1)],\
+ (lmv)->lmv_hash_type, (lmv)->lmv_layout_version, \
+ (lmv)->lmv_migrate_offset, \
+ mdt_hash_name[(lmv)->lmv_migrate_hash & (LMV_HASH_TYPE_MAX - 1)],\
(lmv)->lmv_migrate_hash)
/* master LMV is sane */
@@ -2772,7 +2772,7 @@ void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req)
op_data->op_fid1 = body->mbo_fid1;
op_data->op_open_handle = body->mbo_open_handle;
- op_data->op_mod_time = get_seconds();
+ op_data->op_mod_time = ktime_get_real_seconds();
md_close(exp, op_data, NULL, &close_req);
ptlrpc_req_finished(close_req);
ll_finish_md_op_data(op_data);
@@ -694,11 +694,14 @@ enum lmv_hash_type {
LMV_HASH_TYPE_MAX,
};
-#define LMV_HASH_TYPE_DEFAULT LMV_HASH_TYPE_FNV_1A_64
+static __attribute__((unused)) const char *mdt_hash_name[] = {
+ "none",
+ "all_char",
+ "fnv_1a_64",
+ "crush",
+};
-#define LMV_HASH_NAME_ALL_CHARS "all_char"
-#define LMV_HASH_NAME_FNV_1A_64 "fnv_1a_64"
-#define LMV_HASH_NAME_CRUSH "crush"
+#define LMV_HASH_TYPE_DEFAULT LMV_HASH_TYPE_FNV_1A_64
/* Right now only the lower part(0-16bits) of lmv_hash_type is being used,
* and the higher part will be the flag to indicate the status of object,