Skip to content

Commit

Permalink
FS-Cache: Bit waiting helpers
Browse files Browse the repository at this point in the history
Add helpers for use with wait_on_bit().

Signed-off-by: David Howells <[email protected]>
Acked-by: Steve Dickson <[email protected]>
Acked-by: Trond Myklebust <[email protected]>
Acked-by: Al Viro <[email protected]>
Tested-by: Daire Byrne <[email protected]>
  • Loading branch information
dhowells committed Apr 3, 2009
1 parent 726dd7f commit 2868cbe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/fscache/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
20 changes: 20 additions & 0 deletions fs/fscache/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 2868cbe

Please sign in to comment.