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
btrfs-progs: allow new inodes to inherit 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 <[email protected]>
0 commit comments