302
303
#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why)
305
enum jbd_state_bits {
306
BH_JBD /* Has an attached ext3 journal_head */
308
BH_JWrite, /* Being written to log (@@@ DEBUGGING) */
309
BH_Freed, /* Has been freed (truncated) */
310
BH_Revoked, /* Has been revoked from the log */
311
BH_RevokeValid, /* Revoked flag is valid */
312
BH_JBDDirty, /* Is dirty but journaled */
313
BH_State, /* Pins most journal_head state */
314
BH_JournalHead, /* Pins bh->b_private and jh->b_bh */
315
BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */
316
BH_JBDPrivateStart, /* First bit available for private use by FS */
320
BUFFER_FNS(JWrite, jwrite)
321
BUFFER_FNS(JBDDirty, jbddirty)
322
TAS_BUFFER_FNS(JBDDirty, jbddirty)
323
BUFFER_FNS(Revoked, revoked)
324
TAS_BUFFER_FNS(Revoked, revoked)
325
BUFFER_FNS(RevokeValid, revokevalid)
326
TAS_BUFFER_FNS(RevokeValid, revokevalid)
327
BUFFER_FNS(Freed, freed)
329
static inline struct buffer_head *jh2bh(struct journal_head *jh)
334
static inline struct journal_head *bh2jh(struct buffer_head *bh)
336
return bh->b_private;
339
static inline void jbd_lock_bh_state(struct buffer_head *bh)
341
bit_spin_lock(BH_State, &bh->b_state);
344
static inline int jbd_trylock_bh_state(struct buffer_head *bh)
346
return bit_spin_trylock(BH_State, &bh->b_state);
349
static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
351
return bit_spin_is_locked(BH_State, &bh->b_state);
354
static inline void jbd_unlock_bh_state(struct buffer_head *bh)
356
bit_spin_unlock(BH_State, &bh->b_state);
359
static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
361
bit_spin_lock(BH_JournalHead, &bh->b_state);
364
static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
366
bit_spin_unlock(BH_JournalHead, &bh->b_state);
369
306
/* Flags in jbd_inode->i_flags */
370
307
#define __JI_COMMIT_RUNNING 0
371
308
/* Commit of the inode data in progress. We use this flag to protect us from
1108
1045
extern handle_t *jbd2_journal_start(journal_t *, int nblocks);
1109
extern handle_t *jbd2__journal_start(journal_t *, int nblocks, int gfp_mask);
1046
extern handle_t *jbd2__journal_start(journal_t *, int nblocks, gfp_t gfp_mask);
1110
1047
extern int jbd2_journal_restart(handle_t *, int nblocks);
1111
extern int jbd2__journal_restart(handle_t *, int nblocks, int gfp_mask);
1048
extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask);
1112
1049
extern int jbd2_journal_extend (handle_t *, int nblocks);
1113
1050
extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *);
1114
1051
extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *);
1329
1266
#define BUFFER_TRACE2(bh, bh2, info) do {} while (0)
1330
1267
#define JBUFFER_TRACE(jh, info) do {} while (0)
1333
* jbd2_dev_to_name is a utility function used by the jbd2 and ext4
1334
* tracing infrastructure to map a dev_t to a device name.
1336
extern const char *jbd2_dev_to_name(dev_t device);
1338
1269
#endif /* __KERNEL__ */
1340
1271
#endif /* _LINUX_JBD2_H */