jbd2, ext4, ocfs2: introduce/use journal callbacks j_submit|finish_inode_data_buffers()
Introduce journal callbacks to allow different behaviors for an inode in journal_submit|finish_inode_data_buffers(). The existing users of the current behavior (ext4, ocfs2) are adapted to use the previously exported functions that implement the current behavior. Users are callers of jbd2_journal_inode_ranged_write|wait(), which adds the inode to the transaction's inode list with the JI_WRITE|WAIT_DATA flags. Only ext4 and ocfs2 in-tree. Both CONFIG_EXT4_FS and CONFIG_OCSFS2_FS select CONFIG_JBD2, which builds fs/jbd2/commit.c and journal.c that define and export the functions, so we can call directly in ext4/ocfs2. Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com> Suggested-by: Jan Kara <jack@suse.cz> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Link: https://lore.kernel.org/r/20201006004841.600488-3-mfo@canonical.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
aa3c0c61f6
commit
342af94ec6
4 changed files with 50 additions and 13 deletions
|
|
@ -629,7 +629,9 @@ struct transaction_s
|
|||
struct journal_head *t_shadow_list;
|
||||
|
||||
/*
|
||||
* List of inodes whose data we've modified in data=ordered mode.
|
||||
* List of inodes associated with the transaction; e.g., ext4 uses
|
||||
* this to track inodes in data=ordered and data=journal mode that
|
||||
* need special handling on transaction commit; also used by ocfs2.
|
||||
* [j_list_lock]
|
||||
*/
|
||||
struct list_head t_inode_list;
|
||||
|
|
@ -1111,6 +1113,27 @@ struct journal_s
|
|||
void (*j_commit_callback)(journal_t *,
|
||||
transaction_t *);
|
||||
|
||||
/**
|
||||
* @j_submit_inode_data_buffers:
|
||||
*
|
||||
* This function is called for all inodes associated with the
|
||||
* committing transaction marked with JI_WRITE_DATA flag
|
||||
* before we start to write out the transaction to the journal.
|
||||
*/
|
||||
int (*j_submit_inode_data_buffers)
|
||||
(struct jbd2_inode *);
|
||||
|
||||
/**
|
||||
* @j_finish_inode_data_buffers:
|
||||
*
|
||||
* This function is called for all inodes associated with the
|
||||
* committing transaction marked with JI_WAIT_DATA flag
|
||||
* after we have written the transaction to the journal
|
||||
* but before we write out the commit block.
|
||||
*/
|
||||
int (*j_finish_inode_data_buffers)
|
||||
(struct jbd2_inode *);
|
||||
|
||||
/*
|
||||
* Journal statistics
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue