ipc/sem.c: move wake_up_process out of the spinlock section
ipc/sem.c: move wake_up_process out of the spinlock section

The wake-up part of semtimedop() consists out of two steps:

- the right tasks must be identified.
- they must be woken up.

Right now, both steps run while the array spinlock is held.  This patch
reorders the code and moves the actual wake_up_process() behind the point
where the spinlock is dropped.

The code also moves setting sem->sem_otime to one place: It does not make
sense to set the last modify time multiple times.

[5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org: repair kerneldoc]
[5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org: fix uninitialised retval]
Signed-off-by: Manfred Spraul <e4eddfaff1fc5d7affa656f47ee4d83207ccac30@colorfullife.com>
Cc: Chris Mason <a169954b4cb1a46cee25f659d3bddfebe02b5fba@oracle.com>
Cc: Zach Brown <bdd5f2a410e3c75a25da3e38f76d719a18e93cd3@oracle.com>
Cc: Jens Axboe <165ab144a3ccfd9429d5c6466b275f24fafdb114@oracle.com>
Cc: Nick Piggin <24829078df5003d9dd1dd871ca2aeb0b1cf95ef4@suse.de>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs