FS-Cache: Bit waiting helpers
authorDavid Howells <dhowells@redhat.com>
Fri, 3 Apr 2009 15:42:38 +0000 (16:42 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 3 Apr 2009 15:42:38 +0000 (16:42 +0100)
Add helpers for use with wait_on_bit().

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
fs/fscache/internal.h
fs/fscache/main.c

index 4c6ba561e96690be30bd20892f916eedc581d3f7..16389942a54e640a96af09649ee0bfa6a5cea460 100644 (file)
@@ -82,6 +82,9 @@ extern unsigned fscache_defer_create;
 extern unsigned fscache_debug;
 extern struct kobject *fscache_root;
 
+extern int fscache_wait_bit(void *);
+extern int fscache_wait_bit_interruptible(void *);
+
 /*
  * fsc-proc.c
  */
index 48b79d2deac12c6fc38ba08ba5b2a78759d4520a..4de41b5974991f05b6a1fc4f07fe40ac746770d8 100644 (file)
@@ -102,3 +102,23 @@ static void __exit fscache_exit(void)
 }
 
 module_exit(fscache_exit);
+
+/*
+ * wait_on_bit() sleep function for uninterruptible waiting
+ */
+int fscache_wait_bit(void *flags)
+{
+       schedule();
+       return 0;
+}
+EXPORT_SYMBOL(fscache_wait_bit);
+
+/*
+ * wait_on_bit() sleep function for interruptible waiting
+ */
+int fscache_wait_bit_interruptible(void *flags)
+{
+       schedule();
+       return signal_pending(current);
+}
+EXPORT_SYMBOL(fscache_wait_bit_interruptible);