root/include/linux/locks.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. wait_on_buffer
  2. lock_buffer
  3. unlock_buffer
  4. wait_on_super
  5. lock_super
  6. unlock_super

   1 #ifndef _LINUX_LOCKS_H
   2 #define _LINUX_LOCKS_H
   3 
   4 /*
   5  * Buffer cache locking - note that interrupts may only unlock, not
   6  * lock buffers.
   7  */
   8 extern void __wait_on_buffer(struct buffer_head *);
   9 
  10 extern inline void wait_on_buffer(struct buffer_head * bh)
     /* [previous][next][first][last][top][bottom][index][help] */
  11 {
  12         if (bh->b_lock)
  13                 __wait_on_buffer(bh);
  14 }
  15 
  16 extern inline void lock_buffer(struct buffer_head * bh)
     /* [previous][next][first][last][top][bottom][index][help] */
  17 {
  18         if (bh->b_lock)
  19                 __wait_on_buffer(bh);
  20         bh->b_lock = 1;
  21 }
  22 
  23 extern inline void unlock_buffer(struct buffer_head * bh)
     /* [previous][next][first][last][top][bottom][index][help] */
  24 {
  25         bh->b_lock = 0;
  26         wake_up(&bh->b_wait);
  27 }
  28 
  29 /*
  30  * super-block locking. Again, interrupts may only unlock
  31  * a super-block (although even this isn't done right now.
  32  * nfs may need it).
  33  */
  34 extern void __wait_on_super(struct super_block *);
  35 
  36 extern inline void wait_on_super(struct super_block * sb)
     /* [previous][next][first][last][top][bottom][index][help] */
  37 {
  38         if (sb->s_lock)
  39                 __wait_on_super(sb);
  40 }
  41 
  42 extern inline void lock_super(struct super_block * sb)
     /* [previous][next][first][last][top][bottom][index][help] */
  43 {
  44         if (sb->s_lock)
  45                 __wait_on_super(sb);
  46         sb->s_lock = 1;
  47 }
  48 
  49 extern inline void unlock_super(struct super_block * sb)
     /* [previous][next][first][last][top][bottom][index][help] */
  50 {
  51         sb->s_lock = 0;
  52         wake_up(&sb->s_wait);
  53 }
  54 
  55 #endif /* _LINUX_LOCKS_H */
  56 

/* [previous][next][first][last][top][bottom][index][help] */