Whamcloud - gitweb
LU-10948 llite: Introduce inode open heat counter
[fs/lustre-release.git] / lustre / llite / namei.c
index b743aa8..9d7eab3 100644 (file)
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #include <linux/fs.h>
@@ -212,6 +211,8 @@ static int ll_dom_lock_cancel(struct inode *inode, struct ldlm_lock *lock)
        if (IS_ERR(env))
                RETURN(PTR_ERR(env));
 
+       OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_REPLAY_PAUSE, cfs_fail_val);
+
        /* reach MDC layer to flush data under  the DoM ldlm lock */
        rc = cl_object_flush(env, lli->lli_clob, lock);
        if (rc == -ENODATA) {
@@ -316,7 +317,7 @@ static void ll_lock_cancel_bits(struct ldlm_lock *lock, __u64 to_cancel)
        lli = ll_i2info(inode);
 
        if (bits & MDS_INODELOCK_UPDATE)
-               ll_file_set_flag(lli, LLIF_UPDATE_ATIME);
+               set_bit(LLIF_UPDATE_ATIME, &lli->lli_flags);
 
        if ((bits & MDS_INODELOCK_UPDATE) && S_ISDIR(inode->i_mode)) {
                CDEBUG(D_INODE, "invalidating inode "DFID" lli = %p, "
@@ -1157,6 +1158,13 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry,
 
        OBD_FAIL_TIMEOUT(OBD_FAIL_LLITE_CREATE_FILE_PAUSE2, cfs_fail_val);
 
+       /* We can only arrive at this path when we have no inode, so
+        * we only need to request open lock if it was requested
+        * for every open
+        */
+       if (ll_i2sbi(dir)->ll_oc_thrsh_count == 1)
+               it->it_flags |= MDS_OPEN_LOCK;
+
        /* Dentry added to dcache tree in ll_lookup_it */
        de = ll_lookup_it(dir, dentry, it, &secctx, &secctxlen, &pca, encrypt,
                          &encctx, &encctxlen);
@@ -1459,6 +1467,10 @@ again:
                        md.default_lmv->lsm_md_master_mdt_index =
                                lum->lum_stripe_offset;
                        md.default_lmv->lsm_md_hash_type = lum->lum_hash_type;
+                       md.default_lmv->lsm_md_max_inherit =
+                               lum->lum_max_inherit;
+                       md.default_lmv->lsm_md_max_inherit_rr =
+                               lum->lum_max_inherit_rr;
 
                        err = ll_update_inode(dir, &md);
                        md_free_lustre_md(sbi->ll_md_exp, &md);