Skip to contentSkip to conversation

udf : skip finding mirror meta in same location with metadata.

PATCH Superseded Namjae Jeon 1 participant 1 message Oct 15, 2011 UDF filesystem

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udf : skip finding mirror meta in same location with metadata.

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.

---
 fs/udf/super.c |   52 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 20 deletions(-)
fs/udf/super.c +31 -19
index e58123a..d2882c1 100644
@@ -857,28 +857,40 @@ 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;
+		}
 	}
 
 	/*
Signature · 1 line
1.7.4.4