Whamcloud - gitweb
In ldlm_resource_add_lock(), call to ldlm_resource_dump()
[fs/lustre-release.git] / lustre / mdd / mdd_object.c
index 758a1fc..a177f05 100644 (file)
@@ -600,7 +600,8 @@ static int mdd_fix_attr(const struct lu_env *env, struct mdd_object *obj,
 
         if (la->la_valid == LA_ATIME) {
                 /* This is atime only set for read atime update on close. */
-                if (la->la_atime <= tmp_la->la_atime + 0/*XXX:mds_atime_diff*/)
+                if (la->la_atime <= tmp_la->la_atime +
+                                    mdd_obj2mdd_dev(obj)->mdd_atime_diff)
                         la->la_valid &= ~LA_ATIME;
                 RETURN(0);
         }
@@ -901,7 +902,7 @@ static int mdd_xattr_set(const struct lu_env *env, struct md_object *obj,
         rc = mdd_xattr_set_txn(env, md2mdd_obj(obj), buf, name,
                                fl, handle);
         if (rc == 0) {
-                la_copy->la_ctime = CURRENT_SECONDS;
+                la_copy->la_ctime = cfs_time_current_sec();
                 la_copy->la_valid = LA_CTIME;
                 rc = mdd_attr_set_internal_locked(env, mdd_obj, la_copy,
                                                   handle, 0);
@@ -935,7 +936,7 @@ int mdd_xattr_del(const struct lu_env *env, struct md_object *obj,
                            mdd_object_capa(env, mdd_obj));
         mdd_write_unlock(env, mdd_obj);
         if (rc == 0) {
-                la_copy->la_ctime = CURRENT_SECONDS;
+                la_copy->la_ctime = cfs_time_current_sec();
                 la_copy->la_valid = LA_CTIME;
                 rc = mdd_attr_set_internal_locked(env, mdd_obj, la_copy,
                                                   handle, 0);
@@ -1314,7 +1315,7 @@ static int mdd_readpage_sanity_check(const struct lu_env *env,
 
 static int mdd_dir_page_build(const struct lu_env *env, int first,
                               void *area, int nob, struct dt_it_ops *iops,
-                              struct dt_it *it, __u32 *start, __u32 *end,
+                              struct dt_it *it, __u64 *start, __u64 *end,
                               struct lu_dirent **last)
 {
         struct lu_fid          *fid  = &mdd_env_info(env)->mti_fid2;
@@ -1337,7 +1338,7 @@ static int mdd_dir_page_build(const struct lu_env *env, int first,
                 char  *name;
                 int    len;
                 int    recsize;
-                __u32  hash;
+                __u64  hash;
 
                 name = (char *)iops->key(env, it);
                 len  = iops->key_size(env, it);
@@ -1347,11 +1348,11 @@ static int mdd_dir_page_build(const struct lu_env *env, int first,
                 if (result != 0)
                         break;
 
-                recsize = (sizeof(*ent) + len + 3) & ~3;
+                recsize = (sizeof(*ent) + len + 7) & ~7;
                 hash = iops->store(env, it);
                 *end = hash;
 
-                CDEBUG(D_INFO, "%p %p %d "DFID": %#8.8x (%d) \"%*.*s\"\n",
+                CDEBUG(D_INFO, "%p %p %d "DFID": "LPU64" (%d) \"%*.*s\"\n",
                        name, ent, nob, PFID(fid), hash, len, len, len, name);
 
                 if (nob >= recsize) {
@@ -1393,8 +1394,8 @@ static int __mdd_readpage(const struct lu_env *env, struct mdd_object *obj,
         int i;
         int rc;
         int nob;
-        __u32 hash_start;
-        __u32 hash_end;
+        __u64 hash_start;
+        __u64 hash_end;
 
         LASSERT(rdpg->rp_pages != NULL);
         LASSERT(next->do_index_ops != NULL);
@@ -1407,8 +1408,8 @@ static int __mdd_readpage(const struct lu_env *env, struct mdd_object *obj,
          */
         iops = &next->do_index_ops->dio_it;
         it = iops->init(env, next, 0, mdd_object_capa(env, obj));
-        if (it == NULL)
-                return -ENOMEM;
+        if (IS_ERR(it))
+                return PTR_ERR(it);
 
         rc = iops->load(env, it, rdpg->rp_hash);
 
@@ -1439,12 +1440,12 @@ static int __mdd_readpage(const struct lu_env *env, struct mdd_object *obj,
              i++, nob -= CFS_PAGE_SIZE) {
                 LASSERT(i < rdpg->rp_npages);
                 pg = rdpg->rp_pages[i];
-                rc = mdd_dir_page_build(env, !i, kmap(pg),
+                rc = mdd_dir_page_build(env, !i, cfs_kmap(pg),
                                         min_t(int, nob, CFS_PAGE_SIZE), iops,
                                         it, &hash_start, &hash_end, &last);
                 if (rc != 0 || i == rdpg->rp_npages - 1)
                         last->lde_reclen = 0;
-                kunmap(pg);
+                cfs_kunmap(pg);
         }
         if (rc > 0) {
                 /*
@@ -1456,7 +1457,7 @@ static int __mdd_readpage(const struct lu_env *env, struct mdd_object *obj,
         if (rc == 0) {
                 struct lu_dirpage *dp;
 
-                dp = kmap(rdpg->rp_pages[0]);
+                dp = cfs_kmap(rdpg->rp_pages[0]);
                 dp->ldp_hash_start = rdpg->rp_hash;
                 dp->ldp_hash_end   = hash_end;
                 if (i == 0)
@@ -1464,8 +1465,8 @@ static int __mdd_readpage(const struct lu_env *env, struct mdd_object *obj,
                          * No pages were processed, mark this.
                          */
                         dp->ldp_flags |= LDF_EMPTY;
-                dp->ldp_flags = cpu_to_le16(dp->ldp_flags);
-                kunmap(rdpg->rp_pages[0]);
+                dp->ldp_flags = cpu_to_le32(dp->ldp_flags);
+                cfs_kunmap(rdpg->rp_pages[0]);
         }
         iops->put(env, it);
         iops->fini(env, it);
@@ -1503,13 +1504,13 @@ static int mdd_readpage(const struct lu_env *env, struct md_object *obj,
                 LASSERT(rdpg->rp_pages != NULL);
 
                 pg = rdpg->rp_pages[0];
-                dp = (struct lu_dirpage*)kmap(pg);
+                dp = (struct lu_dirpage*)cfs_kmap(pg);
                 memset(dp, 0 , sizeof(struct lu_dirpage));
                 dp->ldp_hash_start = rdpg->rp_hash;
                 dp->ldp_hash_end   = DIR_END_OFF;
                 dp->ldp_flags |= LDF_EMPTY;
-                dp->ldp_flags = cpu_to_le16(dp->ldp_flags);
-                kunmap(pg);
+                dp->ldp_flags = cpu_to_le32(dp->ldp_flags);
+                cfs_kunmap(pg);
                 GOTO(out_unlock, rc = 0);
         }