]> Pileus Git - ~andy/linux/blobdiff - fs/ocfs2/dlmglue.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[~andy/linux] / fs / ocfs2 / dlmglue.c
index d1bd305ef0d7a735f4971a8b36727085bc102f1c..4e97dcceaf8f5354fab2b4e78563f56b5853bf35 100644 (file)
@@ -600,15 +600,13 @@ static inline int ocfs2_highest_compat_lock_level(int level)
 static void lockres_set_flags(struct ocfs2_lock_res *lockres,
                              unsigned long newflags)
 {
-       struct list_head *pos, *tmp;
-       struct ocfs2_mask_waiter *mw;
+       struct ocfs2_mask_waiter *mw, *tmp;
 
        assert_spin_locked(&lockres->l_lock);
 
        lockres->l_flags = newflags;
 
-       list_for_each_safe(pos, tmp, &lockres->l_mask_waiters) {
-               mw = list_entry(pos, struct ocfs2_mask_waiter, mw_item);
+       list_for_each_entry_safe(mw, tmp, &lockres->l_mask_waiters, mw_item) {
                if ((lockres->l_flags & mw->mw_mask) != mw->mw_goal)
                        continue;
 
@@ -672,7 +670,7 @@ static inline void ocfs2_generic_handle_attach_action(struct ocfs2_lock_res *loc
 {
        mlog_entry_void();
 
-       BUG_ON((!lockres->l_flags & OCFS2_LOCK_BUSY));
+       BUG_ON((!(lockres->l_flags & OCFS2_LOCK_BUSY)));
        BUG_ON(lockres->l_flags & OCFS2_LOCK_ATTACHED);
 
        if (lockres->l_requested > LKM_NLMODE &&
@@ -982,18 +980,6 @@ again:
                goto unlock;
        }
 
-       if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) {
-               /* lock has not been created yet. */
-               spin_unlock_irqrestore(&lockres->l_lock, flags);
-
-               ret = ocfs2_lock_create(osb, lockres, LKM_NLMODE, 0);
-               if (ret < 0) {
-                       mlog_errno(ret);
-                       goto out;
-               }
-               goto again;
-       }
-
        if (lockres->l_flags & OCFS2_LOCK_BLOCKED &&
            !ocfs2_may_continue_on_blocked_lock(lockres, level)) {
                /* is the lock is currently blocked on behalf of
@@ -1008,7 +994,14 @@ again:
                        mlog(ML_ERROR, "lockres %s has action %u pending\n",
                             lockres->l_name, lockres->l_action);
 
-               lockres->l_action = OCFS2_AST_CONVERT;
+               if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) {
+                       lockres->l_action = OCFS2_AST_ATTACH;
+                       lkm_flags &= ~LKM_CONVERT;
+               } else {
+                       lockres->l_action = OCFS2_AST_CONVERT;
+                       lkm_flags |= LKM_CONVERT;
+               }
+
                lockres->l_requested = level;
                lockres_or_flags(lockres, OCFS2_LOCK_BUSY);
                spin_unlock_irqrestore(&lockres->l_lock, flags);
@@ -1023,7 +1016,7 @@ again:
                status = dlmlock(osb->dlm,
                                 level,
                                 &lockres->l_lksb,
-                                lkm_flags|LKM_CONVERT,
+                                lkm_flags,
                                 lockres->l_name,
                                 OCFS2_LOCK_ID_MAX_LEN - 1,
                                 ocfs2_locking_ast,
@@ -1484,6 +1477,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode)
        lvb->lvb_imtime_packed =
                cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime));
        lvb->lvb_iattr    = cpu_to_be32(oi->ip_attr);
+       lvb->lvb_idynfeatures = cpu_to_be16(oi->ip_dyn_features);
        lvb->lvb_igeneration = cpu_to_be32(inode->i_generation);
 
 out:
@@ -1517,6 +1511,7 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode)
        i_size_write(inode, be64_to_cpu(lvb->lvb_isize));
 
        oi->ip_attr = be32_to_cpu(lvb->lvb_iattr);
+       oi->ip_dyn_features = be16_to_cpu(lvb->lvb_idynfeatures);
        ocfs2_set_inode_flags(inode);
 
        /* fast-symlinks are a special case */