From: Namjae Jeon <linkinjeon@gmail.com>
To: jack@suse.cz
Cc: linux-kernel@vger.kernel.org, Namjae Jeon <linkinjeon@gmail.com>,
Ashish Sangwan <ashishsangwan2@gmail.com>
Subject: [PATCH v2] udf : skip finding mirror meta in same location with metadata.
Date: Sat, 15 Oct 2011 17:41:46 +0900 [thread overview]
Message-ID: <1318668106-2147-1-git-send-email-linkinjeon@gmail.com> (raw)
If metadata duplicate flag is clear, it means there is mirror metadata file in same location with metadata file.
So this patch try to skip finding mirror partition on this case.
Mount time is improved and avoid unnecessarily loading mirror metadata.
Signed-off-by: Ashish Sangwan <ashishsangwan2@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
---
fs/udf/super.c | 51 +++++++++++++++++++++++++++++++--------------------
1 files changed, 31 insertions(+), 20 deletions(-)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index e58123a..f76f9e6 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -857,28 +857,39 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
mdata->s_metadata_fe = NULL;
}
- /* mirror file entry */
- addr.logicalBlockNum = mdata->s_mirror_file_loc;
- addr.partitionReferenceNum = map->s_partition_num;
+ if (!mdata->s_dup_md_flag) {
+ udf_info("There is mirror metadata file in same location with metadata file.");
+ if (fe_error) {
+ udf_err(sb, "So mirror inode efe can not found too");
+ goto error_exit;
+ } else {
+ mdata->s_mirror_fe = mdata->s_metadata_fe;
+ }
+ } else {
- udf_debug("Mirror metadata file location: block = %d part = %d\n",
- addr.logicalBlockNum, addr.partitionReferenceNum);
+ /* mirror file entry */
+ addr.logicalBlockNum = mdata->s_mirror_file_loc;
+ addr.partitionReferenceNum = map->s_partition_num;
- mdata->s_mirror_fe = udf_iget(sb, &addr);
+ udf_debug("Mirror metadata file location: block = %d part = %d\n",
+ addr.logicalBlockNum, addr.partitionReferenceNum);
- if (mdata->s_mirror_fe == NULL) {
- if (fe_error) {
- udf_err(sb, "mirror inode efe not found and metadata inode is missing too, exiting...\n");
- goto error_exit;
- } else
- udf_warn(sb, "mirror inode efe not found, but metadata inode is OK\n");
- } else if (UDF_I(mdata->s_mirror_fe)->i_alloc_type !=
- ICBTAG_FLAG_AD_SHORT) {
- udf_warn(sb, "mirror inode efe does not have short allocation descriptors!\n");
- iput(mdata->s_mirror_fe);
- mdata->s_mirror_fe = NULL;
- if (fe_error)
- goto error_exit;
+ mdata->s_mirror_fe = udf_iget(sb, &addr);
+
+ if (mdata->s_mirror_fe == NULL) {
+ if (fe_error) {
+ udf_err(sb, "mirror inode efe not found and metadata inode is missing too, exiting...\n");
+ goto error_exit;
+ } else
+ udf_warn(sb, "mirror inode efe not found, but metadata inode is OK\n");
+ } else if (UDF_I(mdata->s_mirror_fe)->i_alloc_type !=
+ ICBTAG_FLAG_AD_SHORT) {
+ udf_warn(sb, "mirror inode efe does not have short allocation descriptors!\n");
+ iput(mdata->s_mirror_fe);
+ mdata->s_mirror_fe = NULL;
+ if (fe_error)
+ goto error_exit;
+ }
}
/*
--
1.7.4.4
next reply other threads:[~2011-10-15 8:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-15 8:41 Namjae Jeon [this message]
2011-10-17 13:41 ` [PATCH v2] udf : skip finding mirror meta in same location with metadata Jan Kara
2011-10-18 17:06 ` NamJae Jeon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1318668106-2147-1-git-send-email-linkinjeon@gmail.com \
--to=linkinjeon@gmail.com \
--cc=ashishsangwan2@gmail.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox