diff options
author | Amir Goldstein <amir73il@gmail.com> | 2011-03-20 21:13:43 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-03-20 21:13:43 -0400 |
commit | 93737456d68ddcb86232f669b83da673dd12e351 (patch) | |
tree | 564feaa33d36c5e06ad200c5225382ff0afd5249 /include/linux/jbd2.h | |
parent | c2cc7028e41c76e44b6e247c4b495c7523b23c87 (diff) |
jbd2: add COW fields to struct jbd2_journal_handle
Add fields needed for the copy-on-write ext4 development work.
The h_cowing flag is used by ext4 snapshots code to mark the task in
COWING state.
The h_XXX_credits fields are used to track buffer credits usage
(accounted by COW and non-COW operations).
The h_cow_XXX fields are used as per task debugging counters.
Merging this commit into mainline will allow users to test ext4
snapshots as a standalone module, without the need to patch and
install a development kernel.
Signed-off-by: Amir Goldstein <amir73il@users.sf.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'include/linux/jbd2.h')
-rw-r--r-- | include/linux/jbd2.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 27e79c27ba08..a32dcaec04e1 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -432,13 +432,35 @@ struct jbd2_journal_handle | |||
432 | int h_err; | 432 | int h_err; |
433 | 433 | ||
434 | /* Flags [no locking] */ | 434 | /* Flags [no locking] */ |
435 | unsigned int h_sync: 1; /* sync-on-close */ | 435 | unsigned int h_sync:1; /* sync-on-close */ |
436 | unsigned int h_jdata: 1; /* force data journaling */ | 436 | unsigned int h_jdata:1; /* force data journaling */ |
437 | unsigned int h_aborted: 1; /* fatal error on handle */ | 437 | unsigned int h_aborted:1; /* fatal error on handle */ |
438 | unsigned int h_cowing:1; /* COWing block to snapshot */ | ||
439 | |||
440 | /* Number of buffers requested by user: | ||
441 | * (before adding the COW credits factor) */ | ||
442 | unsigned int h_base_credits:14; | ||
443 | |||
444 | /* Number of buffers the user is allowed to dirty: | ||
445 | * (counts only buffers dirtied when !h_cowing) */ | ||
446 | unsigned int h_user_credits:14; | ||
447 | |||
438 | 448 | ||
439 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 449 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
440 | struct lockdep_map h_lockdep_map; | 450 | struct lockdep_map h_lockdep_map; |
441 | #endif | 451 | #endif |
452 | |||
453 | #ifdef CONFIG_JBD2_DEBUG | ||
454 | /* COW debugging counters: */ | ||
455 | unsigned int h_cow_moved; /* blocks moved to snapshot */ | ||
456 | unsigned int h_cow_copied; /* blocks copied to snapshot */ | ||
457 | unsigned int h_cow_ok_jh; /* blocks already COWed during current | ||
458 | transaction */ | ||
459 | unsigned int h_cow_ok_bitmap; /* blocks not set in COW bitmap */ | ||
460 | unsigned int h_cow_ok_mapped;/* blocks already mapped in snapshot */ | ||
461 | unsigned int h_cow_bitmaps; /* COW bitmaps created */ | ||
462 | unsigned int h_cow_excluded; /* blocks set in exclude bitmap */ | ||
463 | #endif | ||
442 | }; | 464 | }; |
443 | 465 | ||
444 | 466 | ||