Commit b67798d5 authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o
Browse files

ext2: unindent codeblock in ext2_xattr_set()



Replace one else in ext2_xattr_set() with a goto. This makes following
code changes simpler to follow. No functional changes.

Signed-off-by: default avatarJan Kara <jack@suse.cz>
Reviewed-by: default avatarRitesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/20220712105436.32204-7-jack@suse.cz


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 90ae40d2
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -517,7 +517,8 @@ ext2_xattr_set(struct inode *inode, int name_index, const char *name,
	/* Here we know that we can set the new attribute. */

	if (header) {
		/* assert(header == HDR(bh)); */
		int offset;

		lock_buffer(bh);
		if (header->h_refcount == cpu_to_le32(1)) {
			__u32 hash = le32_to_cpu(header->h_hash);
@@ -531,9 +532,8 @@ ext2_xattr_set(struct inode *inode, int name_index, const char *name,
					      bh->b_blocknr);

			/* keep the buffer locked while modifying it. */
		} else {
			int offset;

			goto update_block;
		}
		unlock_buffer(bh);
		ea_bdebug(bh, "cloning");
		header = kmemdup(HDR(bh), bh->b_size, GFP_KERNEL);
@@ -546,7 +546,6 @@ ext2_xattr_set(struct inode *inode, int name_index, const char *name,
		here = ENTRY((char *)header + offset);
		offset = (char *)last - bh->b_data;
		last = ENTRY((char *)header + offset);
		}
	} else {
		/* Allocate a buffer where we construct the new block. */
		header = kzalloc(sb->s_blocksize, GFP_KERNEL);
@@ -559,6 +558,7 @@ ext2_xattr_set(struct inode *inode, int name_index, const char *name,
		last = here = ENTRY(header+1);
	}

update_block:
	/* Iff we are modifying the block in-place, bh is locked here. */

	if (not_found) {