When we're creating a file as a child of an existing directory, use
xfs_get_initial_prid to have the child inherit the project id of the
directory if the directory has PROJINHERIT set, just like the kernel
does. This fixes mkfs project id propagation with -d projinherit=X when
protofiles are in use.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
.pip = dp,
.uid = make_kuid(cr->cr_uid),
.gid = make_kgid(cr->cr_gid),
+ .prid = dp ? libxfs_get_initial_prid(dp) : 0,
.nlink = nlink,
.rdev = rdev,
.mode = mode,
#define xfs_free_perag libxfs_free_perag
#define xfs_fs_geometry libxfs_fs_geometry
#define xfs_get_projid libxfs_get_projid
+#define xfs_get_initial_prid libxfs_get_initial_prid
#define xfs_highbit32 libxfs_highbit32
#define xfs_highbit64 libxfs_highbit64
#define xfs_ialloc_calc_rootino libxfs_ialloc_calc_rootino