lkml.org 
[lkml]   [2009]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 16/43] FS-Cache: Bit waiting helpers [ver #46]
Date
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>
---

fs/fscache/internal.h | 3 +++
fs/fscache/main.c | 20 ++++++++++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)


diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h
index 4c6ba56..1638994 100644
--- a/fs/fscache/internal.h
+++ b/fs/fscache/internal.h
@@ -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
*/
diff --git a/fs/fscache/main.c b/fs/fscache/main.c
index 48b79d2..4de41b5 100644
--- a/fs/fscache/main.c
+++ b/fs/fscache/main.c
@@ -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);


\
 
 \ /
  Last update: 2009-04-02 01:17    [W:0.248 / U:5.388 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site