diff options
Diffstat (limited to 'include/linux/buffer_head.h')
| -rw-r--r-- | include/linux/buffer_head.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 50cfe8ceb478..eadaab44015f 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
| @@ -115,7 +115,6 @@ BUFFER_FNS(Uptodate, uptodate) | |||
| 115 | BUFFER_FNS(Dirty, dirty) | 115 | BUFFER_FNS(Dirty, dirty) |
| 116 | TAS_BUFFER_FNS(Dirty, dirty) | 116 | TAS_BUFFER_FNS(Dirty, dirty) |
| 117 | BUFFER_FNS(Lock, locked) | 117 | BUFFER_FNS(Lock, locked) |
| 118 | TAS_BUFFER_FNS(Lock, locked) | ||
| 119 | BUFFER_FNS(Req, req) | 118 | BUFFER_FNS(Req, req) |
| 120 | TAS_BUFFER_FNS(Req, req) | 119 | TAS_BUFFER_FNS(Req, req) |
| 121 | BUFFER_FNS(Mapped, mapped) | 120 | BUFFER_FNS(Mapped, mapped) |
| @@ -321,10 +320,15 @@ static inline void wait_on_buffer(struct buffer_head *bh) | |||
| 321 | __wait_on_buffer(bh); | 320 | __wait_on_buffer(bh); |
| 322 | } | 321 | } |
| 323 | 322 | ||
| 323 | static inline int trylock_buffer(struct buffer_head *bh) | ||
| 324 | { | ||
| 325 | return likely(!test_and_set_bit(BH_Lock, &bh->b_state)); | ||
| 326 | } | ||
| 327 | |||
| 324 | static inline void lock_buffer(struct buffer_head *bh) | 328 | static inline void lock_buffer(struct buffer_head *bh) |
| 325 | { | 329 | { |
| 326 | might_sleep(); | 330 | might_sleep(); |
| 327 | if (test_set_buffer_locked(bh)) | 331 | if (!trylock_buffer(bh)) |
| 328 | __lock_buffer(bh); | 332 | __lock_buffer(bh); |
| 329 | } | 333 | } |
| 330 | 334 | ||
