Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
941ba12
Documentation
LICENSES
arch
block
certs
crypto
drivers
fs
9p
adfs
affs
afs
autofs
befs
bfs
btrfs
cachefiles
ceph
cifs
coda
configfs
cramfs
crypto
debugfs
devpts
dlm
ecryptfs
efivarfs
efs
erofs
exfat
exportfs
ext2
ext4
Kconfig
Makefile
acl.c
acl.h
balloc.c
bitmap.c
block_validity.c
dir.c
ext4.h
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h
extents.c
extents_status.c
extents_status.h
fast_commit.c
fast_commit.h
file.c
fsmap.c
fsmap.h
fsync.c
hash.c
ialloc.c
indirect.c
inline.c
inode-test.c
inode.c
ioctl.c
mballoc.c
mballoc.h
migrate.c
mmp.c
move_extent.c
namei.c
page-io.c
readpage.c
resize.c
super.c
symlink.c
sysfs.c
truncate.h
verity.c
xattr.c
xattr.h
xattr_hurd.c
xattr_security.c
xattr_trusted.c
xattr_user.c
f2fs
fat
freevxfs
fscache
fuse
gfs2
hfs
hfsplus
hostfs
hpfs
hugetlbfs
iomap
isofs
jbd2
jffs2
jfs
kernfs
lockd
minix
nfs
nfs_common
nfsd
nilfs2
nls
notify
ntfs
ocfs2
omfs
openpromfs
orangefs
overlayfs
proc
pstore
qnx4
qnx6
quota
ramfs
reiserfs
romfs
squashfs
sysfs
sysv
tracefs
ubifs
udf
ufs
unicode
vboxsf
verity
xfs
zonefs
Kconfig
Kconfig.binfmt
Makefile
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
block_dev.c
buffer.c
char_dev.c
compat_binfmt_elf.c
coredump.c
d_path.c
dax.c
dcache.c
dcookies.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
fhandle.c
file.c
file_table.c
filesystems.c
fs-writeback.c
fs_context.c
fs_parser.c
fs_pin.c
fs_struct.c
fs_types.c
fsopen.c
init.c
inode.c
internal.h
io-wq.c
io-wq.h
io_uring.c
ioctl.c
kernel_read_file.c
libfs.c
locks.c
mbcache.c
mount.h
mpage.c
namei.c
namespace.c
no-block.c
nsfs.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c
readdir.c
remap_range.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c
sync.c
timerfd.c
userfaultfd.c
utimes.c
xattr.c
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
fs
/
ext4
/
fast_commit.h
Blame
Blame
Latest commit
History
History
201 lines (176 loc) · 4.62 KB
Breadcrumbs
linux
/
fs
/
ext4
/
fast_commit.h
Top
File metadata and controls
Code
Blame
201 lines (176 loc) · 4.62 KB
Raw
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __FAST_COMMIT_H__ #define __FAST_COMMIT_H__ /* * Note this file is present in e2fsprogs/lib/ext2fs/fast_commit.h and * linux/fs/ext4/fast_commit.h. These file should always be byte identical. */ /* Fast commit tags */ #define EXT4_FC_TAG_ADD_RANGE 0x0001 #define EXT4_FC_TAG_DEL_RANGE 0x0002 #define EXT4_FC_TAG_CREAT 0x0003 #define EXT4_FC_TAG_LINK 0x0004 #define EXT4_FC_TAG_UNLINK 0x0005 #define EXT4_FC_TAG_INODE 0x0006 #define EXT4_FC_TAG_PAD 0x0007 #define EXT4_FC_TAG_TAIL 0x0008 #define EXT4_FC_TAG_HEAD 0x0009 #define EXT4_FC_SUPPORTED_FEATURES 0x0 /* On disk fast commit tlv value structures */ /* Fast commit on disk tag length structure */ struct ext4_fc_tl { __le16 fc_tag; __le16 fc_len; }; /* Value structure for tag EXT4_FC_TAG_HEAD. */ struct ext4_fc_head { __le32 fc_features; __le32 fc_tid; }; /* Value structure for EXT4_FC_TAG_ADD_RANGE. */ struct ext4_fc_add_range { __le32 fc_ino; __u8 fc_ex[12]; }; /* Value structure for tag EXT4_FC_TAG_DEL_RANGE. */ struct ext4_fc_del_range { __le32 fc_ino; __le32 fc_lblk; __le32 fc_len; }; /* * This is the value structure for tags EXT4_FC_TAG_CREAT, EXT4_FC_TAG_LINK * and EXT4_FC_TAG_UNLINK. */ struct ext4_fc_dentry_info { __le32 fc_parent_ino; __le32 fc_ino; __u8 fc_dname[0]; }; /* Value structure for EXT4_FC_TAG_INODE and EXT4_FC_TAG_INODE_PARTIAL. */ struct ext4_fc_inode { __le32 fc_ino; __u8 fc_raw_inode[0]; }; /* Value structure for tag EXT4_FC_TAG_TAIL. */ struct ext4_fc_tail { __le32 fc_tid; __le32 fc_crc; }; /* * Fast commit reason codes */ enum { /* * Commit status codes: */ EXT4_FC_REASON_OK = 0, EXT4_FC_REASON_INELIGIBLE, EXT4_FC_REASON_ALREADY_COMMITTED, EXT4_FC_REASON_FC_START_FAILED, EXT4_FC_REASON_FC_FAILED, /* * Fast commit ineligiblity reasons: */ EXT4_FC_REASON_XATTR = 0, EXT4_FC_REASON_CROSS_RENAME, EXT4_FC_REASON_JOURNAL_FLAG_CHANGE, EXT4_FC_REASON_NOMEM, EXT4_FC_REASON_SWAP_BOOT, EXT4_FC_REASON_RESIZE, EXT4_FC_REASON_RENAME_DIR, EXT4_FC_REASON_FALLOC_RANGE, EXT4_FC_REASON_INODE_JOURNAL_DATA, EXT4_FC_COMMIT_FAILED, EXT4_FC_REASON_MAX }; #ifdef __KERNEL__ /* * In memory list of dentry updates that are performed on the file * system used by fast commit code. */ struct ext4_fc_dentry_update { int fcd_op; /* Type of update create / unlink / link */ int fcd_parent; /* Parent inode number */ int fcd_ino; /* Inode number */ struct qstr fcd_name; /* Dirent name */ unsigned char fcd_iname[DNAME_INLINE_LEN]; /* Dirent name string */ struct list_head fcd_list; }; struct ext4_fc_stats { unsigned int fc_ineligible_reason_count[EXT4_FC_REASON_MAX]; unsigned long fc_num_commits; unsigned long fc_ineligible_commits; unsigned long fc_numblks; }; #define EXT4_FC_REPLAY_REALLOC_INCREMENT 4 /* * Physical block regions added to different inodes due to fast commit * recovery. These are set during the SCAN phase. During the replay phase, * our allocator excludes these from its allocation. This ensures that * we don't accidentally allocating a block that is going to be used by * another inode. */ struct ext4_fc_alloc_region { ext4_lblk_t lblk; ext4_fsblk_t pblk; int ino, len; }; /* * Fast commit replay state. */ struct ext4_fc_replay_state { int fc_replay_num_tags; int fc_replay_expected_off; int fc_current_pass; int fc_cur_tag; int fc_crc; struct ext4_fc_alloc_region *fc_regions; int fc_regions_size, fc_regions_used, fc_regions_valid; int *fc_modified_inodes; int fc_modified_inodes_used, fc_modified_inodes_size; }; #define region_last(__region) (((__region)->lblk) + ((__region)->len) - 1) #endif #define fc_for_each_tl(__start, __end, __tl) \ for (tl = (struct ext4_fc_tl *)(__start); \ (__u8 *)tl < (__u8 *)(__end); \ tl = (struct ext4_fc_tl *)((__u8 *)tl + \ sizeof(struct ext4_fc_tl) + \ + le16_to_cpu(tl->fc_len))) static inline const char *tag2str(__u16 tag) { switch (tag) { case EXT4_FC_TAG_LINK: return "ADD_ENTRY"; case EXT4_FC_TAG_UNLINK: return "DEL_ENTRY"; case EXT4_FC_TAG_ADD_RANGE: return "ADD_RANGE"; case EXT4_FC_TAG_CREAT: return "CREAT_DENTRY"; case EXT4_FC_TAG_DEL_RANGE: return "DEL_RANGE"; case EXT4_FC_TAG_INODE: return "INODE"; case EXT4_FC_TAG_PAD: return "PAD"; case EXT4_FC_TAG_TAIL: return "TAIL"; case EXT4_FC_TAG_HEAD: return "HEAD"; default: return "ERROR"; } } /* Get length of a particular tlv */ static inline int ext4_fc_tag_len(struct ext4_fc_tl *tl) { return le16_to_cpu(tl->fc_len); } /* Get a pointer to "value" of a tlv */ static inline __u8 *ext4_fc_tag_val(struct ext4_fc_tl *tl) { return (__u8 *)tl + sizeof(*tl); } #endif /* __FAST_COMMIT_H__ */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
You can’t perform that action at this time.