This patch removes the annoying and confusing `wait' argument from
many places. The only change in behaviour is that we now yield once
when unblocking other BSD-style flocks instead of once for each lock.
This should not affect any userspace programs.
diff -urNX dontdiff linux-2.5.15/fs/locks.c linux-2.5.15-flock/fs/locks.c
--- linux-2.5.15/fs/locks.c Thu May 9 16:23:59 2002
+++ linux-2.5.15-flock/fs/locks.c Sun May 12 09:21:40 2002
@@ -436,24 +436,15 @@
* If told to wait then schedule the processes until the block list
* is empty, otherwise empty the block list ourselves.
*/
-static void locks_wake_up_blocks(struct file_lock *blocker, unsigned int wait)
+static void locks_wake_up_blocks(struct file_lock *blocker)
{
while (!list_empty(&blocker->fl_block)) {
struct file_lock *waiter = list_entry(blocker->fl_block.next, struct file_lock, fl_block);
-
- if (wait) {
- locks_notify_blocked(waiter);
- /* Let the blocked process remove waiter from the
- * block list when it gets scheduled.
- */
- yield();
- } else {
- /* Remove waiter from the block list, because by the
- * time it wakes up blocker won't exist any more.
- */
- locks_delete_block(waiter);
- locks_notify_blocked(waiter);
- }
+ /* Remove waiter from the block list, because by the
+ * time it wakes up blocker won't exist any more.
+ */
+ locks_delete_block(waiter);
+ locks_notify_blocked(waiter);
}
}
@@ -490,7 +481,7 @@
* notify the FS that the lock has been cleared and
* finally free the lock.
*/
-static inline void _delete_lock(struct file_lock *fl, unsigned int wait)
+static inline void _delete_lock(struct file_lock *fl)
{
fasync_helper(0, fl->fl_file, 0, &fl->fl_fasync);
if (fl->fl_fasync != NULL){
@@ -501,19 +492,19 @@
if (fl->fl_remove)
fl->fl_remove(fl);