"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "fs/ocfs2/dlm/dlmunlock.c" between
linux-4.4.195.tar.xz and linux-4.4.196.tar.xz

About: The full source of the Linux kernel 4.4.x (longterm stable)

dlmunlock.c  (linux-4.4.195.tar.xz):dlmunlock.c  (linux-4.4.196.tar.xz)
skipping to change at line 104 skipping to change at line 104
static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm, static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
struct dlm_lock_resource *res, struct dlm_lock_resource *res,
struct dlm_lock *lock, struct dlm_lock *lock,
struct dlm_lockstatus *lksb, struct dlm_lockstatus *lksb,
int flags, int *call_ast, int flags, int *call_ast,
int master_node) int master_node)
{ {
enum dlm_status status; enum dlm_status status;
int actions = 0; int actions = 0;
int in_use; int in_use;
u8 owner; u8 owner;
int recovery_wait = 0;
mlog(0, "master_node = %d, valblk = %d\n", master_node, mlog(0, "master_node = %d, valblk = %d\n", master_node,
flags & LKM_VALBLK); flags & LKM_VALBLK);
if (master_node) if (master_node)
BUG_ON(res->owner != dlm->node_num); BUG_ON(res->owner != dlm->node_num);
else else
BUG_ON(res->owner == dlm->node_num); BUG_ON(res->owner == dlm->node_num);
spin_lock(&dlm->ast_lock); spin_lock(&dlm->ast_lock);
skipping to change at line 207 skipping to change at line 208
dlm->name, res->lockname.len, dlm->name, res->lockname.len,
res->lockname.name, res->lockname.name,
status==DLM_RECOVERING?"recovering": status==DLM_RECOVERING?"recovering":
(status==DLM_MIGRATING?"migrating": (status==DLM_MIGRATING?"migrating":
(status == DLM_FORWARD ? "forward" : (status == DLM_FORWARD ? "forward" :
"nolockmanager"))); "nolockmanager")));
actions = 0; actions = 0;
} }
if (flags & LKM_CANCEL) if (flags & LKM_CANCEL)
lock->cancel_pending = 0; lock->cancel_pending = 0;
else else {
lock->unlock_pending = 0; if (!lock->unlock_pending)
recovery_wait = 1;
else
lock->unlock_pending = 0;
}
} }
/* get an extra ref on lock. if we are just switching /* get an extra ref on lock. if we are just switching
* lists here, we dont want the lock to go away. */ * lists here, we dont want the lock to go away. */
dlm_lock_get(lock); dlm_lock_get(lock);
if (actions & DLM_UNLOCK_REMOVE_LOCK) { if (actions & DLM_UNLOCK_REMOVE_LOCK) {
list_del_init(&lock->list); list_del_init(&lock->list);
dlm_lock_put(lock); dlm_lock_put(lock);
} }
skipping to change at line 243 skipping to change at line 247
leave: leave:
res->state &= ~DLM_LOCK_RES_IN_PROGRESS; res->state &= ~DLM_LOCK_RES_IN_PROGRESS;
if (!dlm_lock_on_list(&res->converting, lock)) if (!dlm_lock_on_list(&res->converting, lock))
BUG_ON(lock->ml.convert_type != LKM_IVMODE); BUG_ON(lock->ml.convert_type != LKM_IVMODE);
else else
BUG_ON(lock->ml.convert_type == LKM_IVMODE); BUG_ON(lock->ml.convert_type == LKM_IVMODE);
spin_unlock(&lock->spinlock); spin_unlock(&lock->spinlock);
spin_unlock(&res->spinlock); spin_unlock(&res->spinlock);
wake_up(&res->wq); wake_up(&res->wq);
if (recovery_wait) {
spin_lock(&res->spinlock);
/* Unlock request will directly succeed after owner dies,
* and the lock is already removed from grant list. We have to
* wait for RECOVERING done or we miss the chance to purge it
* since the removement is much faster than RECOVERING proc.
*/
__dlm_wait_on_lockres_flags(res, DLM_LOCK_RES_RECOVERING);
spin_unlock(&res->spinlock);
}
/* let the caller's final dlm_lock_put handle the actual kfree */ /* let the caller's final dlm_lock_put handle the actual kfree */
if (actions & DLM_UNLOCK_FREE_LOCK) { if (actions & DLM_UNLOCK_FREE_LOCK) {
/* this should always be coupled with list removal */ /* this should always be coupled with list removal */
BUG_ON(!(actions & DLM_UNLOCK_REMOVE_LOCK)); BUG_ON(!(actions & DLM_UNLOCK_REMOVE_LOCK));
mlog(0, "lock %u:%llu should be gone now! refs=%d\n", mlog(0, "lock %u:%llu should be gone now! refs=%d\n",
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)), dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)), dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
atomic_read(&lock->lock_refs.refcount)-1); atomic_read(&lock->lock_refs.refcount)-1);
dlm_lock_put(lock); dlm_lock_put(lock);
} }
 End of changes. 3 change blocks. 
4 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)