Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7cd8a722745a01bcfac4d4a52d53391d177da20
Commit:     e7cd8a722745a01bcfac4d4a52d53391d177da20
Parent:     f4a3a7d60c9c9a961e4c970f6eb41dd1c9d3ec21
Author:     Rafael J. Wysocki <[EMAIL PROTECTED]>
AuthorDate: Thu Jul 19 01:47:34 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Jul 19 10:04:42 2007 -0700

    Freezer: return int from freeze_processes
    
    Make try_to_freeze_tasks() and freeze_processes() return -EBUSY on failure
    instead of the number of unfrozen tasks (none of the callers actually uses
    this number).
    
    Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Acked-by: Pavel Machek <[EMAIL PROTECTED]>
    Cc: Gautham R Shenoy <[EMAIL PROTECTED]>
    Cc: Oleg Nesterov <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/power/process.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/kernel/power/process.c b/kernel/power/process.c
index 9b5301c..00cdbe5 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -105,7 +105,7 @@ static void cancel_freezing(struct task_struct *p)
        }
 }
 
-static unsigned int try_to_freeze_tasks(int freeze_user_space)
+static int try_to_freeze_tasks(int freeze_user_space)
 {
        struct task_struct *g, *p;
        unsigned long end_time;
@@ -176,28 +176,25 @@ static unsigned int try_to_freeze_tasks(int 
freeze_user_space)
                read_unlock(&tasklist_lock);
        }
 
-       return todo;
+       return todo ? -EBUSY : 0;
 }
 
 /**
  *     freeze_processes - tell processes to enter the refrigerator
- *
- *     Returns 0 on success, or the number of processes that didn't freeze,
- *     although they were told to.
  */
 int freeze_processes(void)
 {
-       unsigned int nr_unfrozen;
+       int error;
 
        printk("Stopping tasks ... ");
-       nr_unfrozen = try_to_freeze_tasks(FREEZER_USER_SPACE);
-       if (nr_unfrozen)
-               return nr_unfrozen;
+       error = try_to_freeze_tasks(FREEZER_USER_SPACE);
+       if (error)
+               return error;
 
        sys_sync();
-       nr_unfrozen = try_to_freeze_tasks(FREEZER_KERNEL_THREADS);
-       if (nr_unfrozen)
-               return nr_unfrozen;
+       error = try_to_freeze_tasks(FREEZER_KERNEL_THREADS);
+       if (error)
+               return error;
 
        printk("done.\n");
        BUG_ON(in_atomic());
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to