This source file includes following definitions.
- wait_on_buffer
 
- lock_buffer
 
- wait_on_super
 
- lock_super
 
- unlock_super
 
   1 #ifndef _LINUX_LOCKS_H
   2 #define _LINUX_LOCKS_H
   3 
   4 #ifndef _LINUX_MM_H
   5 #include <linux/mm.h>
   6 #endif
   7 #ifndef _LINUX_PAGEMAP_H
   8 #include <linux/pagemap.h>
   9 #endif
  10 
  11 
  12 
  13 
  14 
  15 extern struct buffer_head *reuse_list;
  16 
  17 
  18 
  19 
  20 
  21 extern void __wait_on_buffer(struct buffer_head *);
  22 
  23 extern inline void wait_on_buffer(struct buffer_head * bh)
     
  24 {
  25         if (test_bit(BH_Lock, &bh->b_state))
  26                 __wait_on_buffer(bh);
  27 }
  28 
  29 extern inline void lock_buffer(struct buffer_head * bh)
     
  30 {
  31         if (set_bit(BH_Lock, &bh->b_state))
  32                 __wait_on_buffer(bh);
  33 }
  34 
  35 void unlock_buffer(struct buffer_head *);
  36 
  37 
  38 
  39 
  40 
  41 
  42 
  43 extern void __wait_on_super(struct super_block *);
  44 
  45 extern inline void wait_on_super(struct super_block * sb)
     
  46 {
  47         if (sb->s_lock)
  48                 __wait_on_super(sb);
  49 }
  50 
  51 extern inline void lock_super(struct super_block * sb)
     
  52 {
  53         if (sb->s_lock)
  54                 __wait_on_super(sb);
  55         sb->s_lock = 1;
  56 }
  57 
  58 extern inline void unlock_super(struct super_block * sb)
     
  59 {
  60         sb->s_lock = 0;
  61         wake_up(&sb->s_wait);
  62 }
  63 
  64 #endif 
  65