1 ext4: convert do_split() to use the ERR_PTR convention
3 From: Theodore Ts'o <tytso@mit.edu>
5 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 fs/ext4/namei.c | 23 +++++++++++------------
8 1 file changed, 11 insertions(+), 12 deletions(-)
10 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
11 index e6d5165..dec92b6 100644
14 @@ -1509,7 +1509,7 @@ static struct ext4_dir_entry_2* dx_pack_dirents(char *base, unsigned blocksize)
16 static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
17 struct buffer_head **bh,struct dx_frame *frame,
18 - struct dx_hash_info *hinfo, int *error)
19 + struct dx_hash_info *hinfo)
21 unsigned blocksize = dir->i_sb->s_blocksize;
22 unsigned count, continued;
23 @@ -1532,8 +1532,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
27 - *error = PTR_ERR(bh2);
29 + return (struct ext4_dir_entry_2 *) bh2;
32 BUFFER_TRACE(*bh, "get_write_access");
33 @@ -1593,8 +1592,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
34 dxtrace(dx_show_leaf (hinfo, (struct ext4_dir_entry_2 *) data2, blocksize, 1));
36 /* Which block gets the new entry? */
37 - if (hinfo->hash >= hash2)
39 + if (hinfo->hash >= hash2) {
43 @@ -1614,8 +1612,7 @@ journal_error:
46 ext4_std_error(dir->i_sb, err);
49 + return ERR_PTR(err);
52 int ext4_find_dest_de(struct inode *dir, struct inode *inode,
53 @@ -1838,8 +1835,8 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
54 ext4_handle_dirty_dx_node(handle, dir, frame->bh);
55 ext4_handle_dirty_dirent_node(handle, dir, bh);
57 - de = do_split(handle,dir, &bh, frame, &hinfo, &retval);
59 + de = do_split(handle,dir, &bh, frame, &hinfo);
62 * Even if the block split failed, we have to properly write
63 * out all the changes we did so far. Otherwise we can end up
64 @@ -1847,7 +1844,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
66 ext4_mark_inode_dirty(handle, dir);
73 @@ -2071,9 +2068,11 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
77 - de = do_split(handle, dir, &bh, frame, &hinfo, &err);
79 + de = do_split(handle, dir, &bh, frame, &hinfo);
84 err = add_dirent_to_buf(handle, dentry, inode, de, bh);