ialloc.c (97eb3f24352ec6632c2127b35d8087d2a809a9b9) ialloc.c (0562e0bad483d10e9651fbb8f21dc3d0bad57374)
1/*
2 * linux/fs/ext4/ialloc.c
3 *
4 * Copyright (C) 1992, 1993, 1994, 1995
5 * Remy Card (card@masi.ibp.fr)
6 * Laboratoire MASI - Institut Blaise Pascal
7 * Universite Pierre et Marie Curie (Paris VI)
8 *

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

147 return bh;
148 }
149 /*
150 * submit the buffer_head for read. We can
151 * safely mark the bitmap as uptodate now.
152 * We do it here so the bitmap uptodate bit
153 * get set with buffer lock held.
154 */
1/*
2 * linux/fs/ext4/ialloc.c
3 *
4 * Copyright (C) 1992, 1993, 1994, 1995
5 * Remy Card (card@masi.ibp.fr)
6 * Laboratoire MASI - Institut Blaise Pascal
7 * Universite Pierre et Marie Curie (Paris VI)
8 *

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

147 return bh;
148 }
149 /*
150 * submit the buffer_head for read. We can
151 * safely mark the bitmap as uptodate now.
152 * We do it here so the bitmap uptodate bit
153 * get set with buffer lock held.
154 */
155 trace_ext4_load_inode_bitmap(sb, block_group);
155 set_bitmap_uptodate(bh);
156 if (bh_submit_read(bh) < 0) {
157 put_bh(bh);
158 ext4_error(sb, "Cannot read inode bitmap - "
159 "block_group = %u, inode_bitmap = %llu",
160 block_group, bitmap_blk);
161 return NULL;
162 }

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

644 /*
645 * If this didn't work, use the Orlov search algorithm
646 * to find a new flex group; we pass in the mode to
647 * avoid the topdir algorithms.
648 */
649 *group = parent_group + flex_size;
650 if (*group > ngroups)
651 *group = 0;
156 set_bitmap_uptodate(bh);
157 if (bh_submit_read(bh) < 0) {
158 put_bh(bh);
159 ext4_error(sb, "Cannot read inode bitmap - "
160 "block_group = %u, inode_bitmap = %llu",
161 block_group, bitmap_blk);
162 return NULL;
163 }

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

645 /*
646 * If this didn't work, use the Orlov search algorithm
647 * to find a new flex group; we pass in the mode to
648 * avoid the topdir algorithms.
649 */
650 *group = parent_group + flex_size;
651 if (*group > ngroups)
652 *group = 0;
652 return find_group_orlov(sb, parent, group, mode, 0);
653 return find_group_orlov(sb, parent, group, mode, NULL);
653 }
654
655 /*
656 * Try to place the inode in its parent directory
657 */
658 *group = parent_group;
659 desc = ext4_get_group_desc(sb, *group, NULL);
660 if (desc && ext4_free_inodes_count(sb, desc) &&

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

1049 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
1050 /* set extent flag only for directory, file and normal symlink*/
1051 if (S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode)) {
1052 ext4_set_inode_flag(inode, EXT4_INODE_EXTENTS);
1053 ext4_ext_tree_init(handle, inode);
1054 }
1055 }
1056
654 }
655
656 /*
657 * Try to place the inode in its parent directory
658 */
659 *group = parent_group;
660 desc = ext4_get_group_desc(sb, *group, NULL);
661 if (desc && ext4_free_inodes_count(sb, desc) &&

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

1050 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
1051 /* set extent flag only for directory, file and normal symlink*/
1052 if (S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode)) {
1053 ext4_set_inode_flag(inode, EXT4_INODE_EXTENTS);
1054 ext4_ext_tree_init(handle, inode);
1055 }
1056 }
1057
1058 if (ext4_handle_valid(handle)) {
1059 ei->i_sync_tid = handle->h_transaction->t_tid;
1060 ei->i_datasync_tid = handle->h_transaction->t_tid;
1061 }
1062
1057 err = ext4_mark_inode_dirty(handle, inode);
1058 if (err) {
1059 ext4_std_error(sb, err);
1060 goto fail_free_drop;
1061 }
1062
1063 ext4_debug("allocating inode %lu\n", inode->i_ino);
1064 trace_ext4_allocate_inode(inode, dir, mode);

--- 264 unchanged lines hidden ---
1063 err = ext4_mark_inode_dirty(handle, inode);
1064 if (err) {
1065 ext4_std_error(sb, err);
1066 goto fail_free_drop;
1067 }
1068
1069 ext4_debug("allocating inode %lu\n", inode->i_ino);
1070 trace_ext4_allocate_inode(inode, dir, mode);

--- 264 unchanged lines hidden ---