From patchwork Fri Dec 16 15:24:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13075121 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D498C4167B for ; Fri, 16 Dec 2022 15:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231407AbiLPP1i (ORCPT ); Fri, 16 Dec 2022 10:27:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231414AbiLPP1I (ORCPT ); Fri, 16 Dec 2022 10:27:08 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 148D7654FD for ; Fri, 16 Dec 2022 07:27:07 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 720F65D11B; Fri, 16 Dec 2022 15:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1671204422; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NIssPDrVT8jTgIMMnSaDSivCgqUxAS0hMnEO3fTZXFA=; b=Akwl69CsPEdgNVGgGVMVZjRxTXp9kH/TGyOYYAg2oSEyrHRCdjSVfUASVO/bBtIfRYrJ6e En/rOM5zQb7vZZy3fQ/KtpnYt91L6rkOIL7ecbEb9e6fMOPXSjsmoO92F5eF3/Pvvt3URk EVF9Eeu8xQgT9fgwFPbk308rNmkkmt8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1671204422; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NIssPDrVT8jTgIMMnSaDSivCgqUxAS0hMnEO3fTZXFA=; b=78+8Ho478PLhUJlF6m5EsSPgkElaEVLNYPg+CWnQxZ7YmbmnjxYauwJmtX8L4GyTxWX6CV xrxwIRUvB15fgSDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4EAA81390E; Fri, 16 Dec 2022 15:27:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sYQzE0aOnGPfCAAAMHmgww (envelope-from ); Fri, 16 Dec 2022 15:27:02 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id C085AA0771; Fri, 16 Dec 2022 16:26:56 +0100 (CET) From: Jan Kara To: Cc: Jan Kara Subject: [PATCH 14/20] udf: Convert udf_add_nondir() to new directory iteration Date: Fri, 16 Dec 2022 16:24:18 +0100 Message-Id: <20221216152656.6236-14-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221216121344.14025-1-jack@suse.cz> References: <20221216121344.14025-1-jack@suse.cz> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1647; i=jack@suse.cz; h=from:subject; bh=GND/383bgVCfa9glLZilZ0DKkGPqHfu8c99Y8TfNhEs=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBjnI2idEBqeOHEY9dQ5rMP8wGoX/Mg84q9pcim0P9I RrvvoFGJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCY5yNogAKCRCcnaoHP2RA2YjvCA DrGf1NoEwjVZuG7+3b+Ei5LKVA1XdNWk6WhIjz5kBjjr3qgz5jOGaCru/MNiF1xi/1Qtqn99mSeQnc kKu0AkdNTLbFXKNqyPzySM5l6GffH2Bvfa1JE+FXTmm6AA4tyvV0BFCEhgci6fN0CpvMOrcXY+4jtV 3NXxFWZjW49VfKVGF17N8KZF2LlGSjkZNqj81ehK4m8hu3m0V+qXyiGQKS0lvysS6OqDOu6Pd4GIxg 0jPVs067hGzOKoBiYzIilbto4fvjQl3utl66M1u270h21iN7GIMtg/FAWLmvbHX4BfJ7kMIoM1+sYi dY55XINmvdpSw+wKBaurdu1a2DbwUU X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Convert udf_add_nondir() to new directory iteration code. Signed-off-by: Jan Kara --- fs/udf/namei.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/fs/udf/namei.c b/fs/udf/namei.c index cfcdc9ec8fe3..038066caa4f5 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -843,26 +843,23 @@ static int udf_add_nondir(struct dentry *dentry, struct inode *inode) { struct udf_inode_info *iinfo = UDF_I(inode); struct inode *dir = d_inode(dentry->d_parent); - struct udf_fileident_bh fibh; - struct fileIdentDesc cfi, *fi; + struct udf_fileident_iter iter; int err; - fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); - if (unlikely(!fi)) { + err = udf_fiiter_add_entry(dir, dentry, &iter); + if (err) { inode_dec_link_count(inode); discard_new_inode(inode); return err; } - cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); - cfi.icb.extLocation = cpu_to_lelb(iinfo->i_location); - *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = + iter.fi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); + iter.fi.icb.extLocation = cpu_to_lelb(iinfo->i_location); + *(__le32 *)((struct allocDescImpUse *)iter.fi.icb.impUse)->impUse = cpu_to_le32(iinfo->i_unique & 0x00000000FFFFFFFFUL); - udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); + udf_fiiter_write_fi(&iter, NULL); dir->i_ctime = dir->i_mtime = current_time(dir); mark_inode_dirty(dir); - if (fibh.sbh != fibh.ebh) - brelse(fibh.ebh); - brelse(fibh.sbh); + udf_fiiter_release(&iter); d_instantiate_new(dentry, inode); return 0;