mtd/include/linux/mtd compatmac.h,1.73,1.74

Artem Bityuckiy dedekind at infradead.org
Tue Mar 29 11:41:38 EST 2005


Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv24234/include/linux/mtd

Modified Files:
	compatmac.h 
Log Message:
Define try_to_freeze() as it is done in 2.6.11


Index: compatmac.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/compatmac.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- compatmac.h	29 Mar 2005 15:26:17 -0000	1.73
+++ compatmac.h	29 Mar 2005 16:41:33 -0000	1.74
@@ -199,7 +199,16 @@
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
 #define CURRENT_TIME_SEC ((struct timespec) { xtime.tv_sec, 0 })
-#define try_to_freeze(x)	0
+#include <linux/sched.h>
+#include <linux/suspend.h>
+static inline int try_to_freeze(unsigned long refrigerator_flags)
+{
+	if (unlikely(current->flags & PF_FREEZE)) {
+	        refrigerator(refrigerator_flags);
+	        return 1;
+	} else
+	        return 0;
+}
 #endif
 
 #ifndef list_for_each_entry_safe





More information about the linux-mtd-cvs mailing list