diff options
author | Harshad Shirwadkar <harshadshirwadkar@gmail.com> | 2020-10-15 23:37:53 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2020-10-22 06:19:43 +0300 |
commit | f5b8b297b04208e101c1f92fe804cd4e66df30e8 (patch) | |
tree | e586ffb8bbb12e4ee2aa723413d1f59d956ad76e /Documentation/filesystems/journalling.rst | |
parent | e0770e91424f694b461141cbc99adf6b23006b60 (diff) | |
download | linux-f5b8b297b04208e101c1f92fe804cd4e66df30e8.tar.xz |
doc: update ext4 and journalling docs to include fast commit feature
This patch adds necessary documentation for fast commits.
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Link: https://lore.kernel.org/r/20201015203802.3597742-2-harshadshirwadkar@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'Documentation/filesystems/journalling.rst')
-rw-r--r-- | Documentation/filesystems/journalling.rst | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Documentation/filesystems/journalling.rst b/Documentation/filesystems/journalling.rst index 7e2be2faf653..5a5f70b4063e 100644 --- a/Documentation/filesystems/journalling.rst +++ b/Documentation/filesystems/journalling.rst @@ -132,6 +132,39 @@ The opportunities for abuse and DOS attacks with this should be obvious, if you allow unprivileged userspace to trigger codepaths containing these calls. +Fast commits +~~~~~~~~~~~~ + +JBD2 to also allows you to perform file-system specific delta commits known as +fast commits. In order to use fast commits, you first need to call +:c:func:`jbd2_fc_init` and tell how many blocks at the end of journal +area should be reserved for fast commits. Along with that, you will also need +to set following callbacks that perform correspodning work: + +`journal->j_fc_cleanup_cb`: Cleanup function called after every full commit and +fast commit. + +`journal->j_fc_replay_cb`: Replay function called for replay of fast commit +blocks. + +File system is free to perform fast commits as and when it wants as long as it +gets permission from JBD2 to do so by calling the function +:c:func:`jbd2_fc_begin_commit()`. Once a fast commit is done, the client +file system should tell JBD2 about it by calling +:c:func:`jbd2_fc_end_commit()`. If file system wants JBD2 to perform a full +commit immediately after stopping the fast commit it can do so by calling +:c:func:`jbd2_fc_end_commit_fallback()`. This is useful if fast commit operation +fails for some reason and the only way to guarantee consistency is for JBD2 to +perform the full traditional commit. + +JBD2 helper functions to manage fast commit buffers. File system can use +:c:func:`jbd2_fc_get_buf()` and :c:func:`jbd2_fc_wait_bufs()` to allocate +and wait on IO completion of fast commit buffers. + +Currently, only Ext4 implements fast commits. For details of its implementation +of fast commits, please refer to the top level comments in +fs/ext4/fast_commit.c. + Summary ~~~~~~~ |