aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-04-03 11:42:38 -0400
committerDavid Howells <dhowells@redhat.com>2009-04-03 11:42:38 -0400
commit2868cbea72dc89ae0eb17693596b1dedaafff1c5 (patch)
tree277e2cbdafabe6ca74458445838a07b571a94996 /fs/fscache
parent726dd7ff10c217dd74329c94643dc8ebea27334b (diff)
FS-Cache: Bit waiting helpers
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>
Diffstat (limited to 'fs/fscache')
-rw-r--r--fs/fscache/internal.h3
-rw-r--r--fs/fscache/main.c20
2 files changed, 23 insertions, 0 deletions
diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h
index 4c6ba561e966..16389942a54e 100644
--- a/fs/fscache/internal.h
+++ b/fs/fscache/internal.h
@@ -82,6 +82,9 @@ extern unsigned fscache_defer_create;
82extern unsigned fscache_debug; 82extern unsigned fscache_debug;
83extern struct kobject *fscache_root; 83extern struct kobject *fscache_root;
84 84
85extern int fscache_wait_bit(void *);
86extern int fscache_wait_bit_interruptible(void *);
87
85/* 88/*
86 * fsc-proc.c 89 * fsc-proc.c
87 */ 90 */
diff --git a/fs/fscache/main.c b/fs/fscache/main.c
index 48b79d2deac1..4de41b597499 100644
--- a/fs/fscache/main.c
+++ b/fs/fscache/main.c
@@ -102,3 +102,23 @@ static void __exit fscache_exit(void)
102} 102}
103 103
104module_exit(fscache_exit); 104module_exit(fscache_exit);
105
106/*
107 * wait_on_bit() sleep function for uninterruptible waiting
108 */
109int fscache_wait_bit(void *flags)
110{
111 schedule();
112 return 0;
113}
114EXPORT_SYMBOL(fscache_wait_bit);
115
116/*
117 * wait_on_bit() sleep function for interruptible waiting
118 */
119int fscache_wait_bit_interruptible(void *flags)
120{
121 schedule();
122 return signal_pending(current);
123}
124EXPORT_SYMBOL(fscache_wait_bit_interruptible);