Commit 8d30e00
btrfs-progs: allow new inodes to inherit some flags from their parents
Inside btrfs-progs (mostly 'mkfs/rootdir.c') new inodes are created in a
different way than the kernel:
- A new orphan inode item is created
Without knowing the parent inode, thus it will always have the default
flags (0).
- Link the new inode to a parent
Meanwhile inside the kernel, we know exactly the parent inode at new
inode creation time, and can inherit the inode flags
(NODATACOW/NODATASUM/COMPRESS/etc).
Address the missing ability by:
- Inherit the parent inode flags when linking an orphan inode
The function btrfs_add_link() is called when linking an inode.
It can be called to creating the initial link if it's a new and orphan
inode. It can also be called to creating extra hard links.
If the inode is already orphan, we know it's newly created and should
inherit the inode flag from the parent.
With this new ability, it will be much easier to implement new per-inode
flags (like NODATACOW/NODATASUM) and get them properly passed down.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent 9f2121d commit 8d30e00
File tree
1 file changed
+64
-0
lines changed1 file changed
+64
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 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 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
161 | 214 | | |
162 | 215 | | |
163 | 216 | | |
| |||
220 | 273 | | |
221 | 274 | | |
222 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
223 | 287 | | |
224 | 288 | | |
225 | 289 | | |
| |||
0 commit comments