ialloc.c (21cb47be6fb9ece7e6ee63f6780986faa384a77c) ialloc.c (14f3db5542e62bcf6fe088a09760ac52d55306c5)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/ext4/ialloc.c
4 *
5 * Copyright (C) 1992, 1993, 1994, 1995
6 * Remy Card (card@masi.ibp.fr)
7 * Laboratoire MASI - Institut Blaise Pascal
8 * Universite Pierre et Marie Curie (Paris VI)

--- 905 unchanged lines hidden (view full) ---

914 * a directory, then a forward search is made for a block group with both
915 * free space and a low directory-to-inode ratio; if that fails, then of
916 * the groups with above-average free space, that group with the fewest
917 * directories already is chosen.
918 *
919 * For other inodes, search forward from the parent directory's block
920 * group to find a free inode.
921 */
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/ext4/ialloc.c
4 *
5 * Copyright (C) 1992, 1993, 1994, 1995
6 * Remy Card (card@masi.ibp.fr)
7 * Laboratoire MASI - Institut Blaise Pascal
8 * Universite Pierre et Marie Curie (Paris VI)

--- 905 unchanged lines hidden (view full) ---

914 * a directory, then a forward search is made for a block group with both
915 * free space and a low directory-to-inode ratio; if that fails, then of
916 * the groups with above-average free space, that group with the fewest
917 * directories already is chosen.
918 *
919 * For other inodes, search forward from the parent directory's block
920 * group to find a free inode.
921 */
922struct inode *__ext4_new_inode(handle_t *handle, struct inode *dir,
922struct inode *__ext4_new_inode(struct user_namespace *mnt_userns,
923 handle_t *handle, struct inode *dir,
923 umode_t mode, const struct qstr *qstr,
924 __u32 goal, uid_t *owner, __u32 i_flags,
925 int handle_type, unsigned int line_no,
926 int nblocks)
927{
928 struct super_block *sb;
929 struct buffer_head *inode_bitmap_bh = NULL;
930 struct buffer_head *group_desc_bh;

--- 33 unchanged lines hidden (view full) ---

964 * transaction
965 */
966 if (owner) {
967 inode->i_mode = mode;
968 i_uid_write(inode, owner[0]);
969 i_gid_write(inode, owner[1]);
970 } else if (test_opt(sb, GRPID)) {
971 inode->i_mode = mode;
924 umode_t mode, const struct qstr *qstr,
925 __u32 goal, uid_t *owner, __u32 i_flags,
926 int handle_type, unsigned int line_no,
927 int nblocks)
928{
929 struct super_block *sb;
930 struct buffer_head *inode_bitmap_bh = NULL;
931 struct buffer_head *group_desc_bh;

--- 33 unchanged lines hidden (view full) ---

965 * transaction
966 */
967 if (owner) {
968 inode->i_mode = mode;
969 i_uid_write(inode, owner[0]);
970 i_gid_write(inode, owner[1]);
971 } else if (test_opt(sb, GRPID)) {
972 inode->i_mode = mode;
972 inode->i_uid = current_fsuid();
973 inode->i_uid = fsuid_into_mnt(mnt_userns);
973 inode->i_gid = dir->i_gid;
974 } else
974 inode->i_gid = dir->i_gid;
975 } else
975 inode_init_owner(&init_user_ns, inode, dir, mode);
976 inode_init_owner(mnt_userns, inode, dir, mode);
976
977 if (ext4_has_feature_project(sb) &&
978 ext4_test_inode_flag(dir, EXT4_INODE_PROJINHERIT))
979 ei->i_projid = EXT4_I(dir)->i_projid;
980 else
981 ei->i_projid = make_kprojid(&init_user_ns, EXT4_DEF_PROJID);
982
983 if (!(i_flags & EXT4_EA_INODE_FL)) {

--- 621 unchanged lines hidden ---
977
978 if (ext4_has_feature_project(sb) &&
979 ext4_test_inode_flag(dir, EXT4_INODE_PROJINHERIT))
980 ei->i_projid = EXT4_I(dir)->i_projid;
981 else
982 ei->i_projid = make_kprojid(&init_user_ns, EXT4_DEF_PROJID);
983
984 if (!(i_flags & EXT4_EA_INODE_FL)) {

--- 621 unchanged lines hidden ---