diff options
author | Joe Perches <joe@perches.com> | 2011-10-10 04:08:05 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-10-31 18:43:52 -0400 |
commit | 78ace70c4186c0d18314eb001637aa97d1585e65 (patch) | |
tree | 34227a6d50b93eb66df22ba130bea8ed932a5896 /fs/udf/super.c | |
parent | a40ecd7b3ccf520ff02da93e8d1ba6cd55c2e359 (diff) |
udf: Convert printks to pr_<level>
Use the current logging styles.
Convert a few printks that should have been udf_warn and udf_err.
Coalesce formats. Add #define pr_fmt.
Move an #include "udfdecls.h" above other includes in udftime.c
so pr_fmt works correctly. Strip prefixes from conversions as appropriate.
Reorder logging definitions in udfdecl.h
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 73 |
1 files changed, 32 insertions, 41 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index 622331f1290d..39e3f351c7a6 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -547,8 +547,7 @@ static int udf_parse_options(char *options, struct udf_options *uopt, | |||
547 | uopt->dmode = option & 0777; | 547 | uopt->dmode = option & 0777; |
548 | break; | 548 | break; |
549 | default: | 549 | default: |
550 | printk(KERN_ERR "udf: bad mount option \"%s\" " | 550 | pr_err("bad mount option \"%s\" or missing value\n", p); |
551 | "or missing value\n", p); | ||
552 | return 0; | 551 | return 0; |
553 | } | 552 | } |
554 | } | 553 | } |
@@ -1106,11 +1105,9 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index) | |||
1106 | udf_find_vat_block(sb, p_index, type1_index, sbi->s_last_block); | 1105 | udf_find_vat_block(sb, p_index, type1_index, sbi->s_last_block); |
1107 | if (!sbi->s_vat_inode && | 1106 | if (!sbi->s_vat_inode && |
1108 | sbi->s_last_block != blocks - 1) { | 1107 | sbi->s_last_block != blocks - 1) { |
1109 | printk(KERN_NOTICE "UDF-fs: Failed to read VAT inode from the" | 1108 | pr_notice("Failed to read VAT inode from the last recorded block (%lu), retrying with the last block of the device (%lu).\n", |
1110 | " last recorded block (%lu), retrying with the last " | 1109 | (unsigned long)sbi->s_last_block, |
1111 | "block of the device (%lu).\n", | 1110 | (unsigned long)blocks - 1); |
1112 | (unsigned long)sbi->s_last_block, | ||
1113 | (unsigned long)blocks - 1); | ||
1114 | udf_find_vat_block(sb, p_index, type1_index, blocks - 1); | 1111 | udf_find_vat_block(sb, p_index, type1_index, blocks - 1); |
1115 | } | 1112 | } |
1116 | if (!sbi->s_vat_inode) | 1113 | if (!sbi->s_vat_inode) |
@@ -1208,8 +1205,8 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) | |||
1208 | if (map->s_partition_type == UDF_METADATA_MAP25) { | 1205 | if (map->s_partition_type == UDF_METADATA_MAP25) { |
1209 | ret = udf_load_metadata_files(sb, i); | 1206 | ret = udf_load_metadata_files(sb, i); |
1210 | if (ret) { | 1207 | if (ret) { |
1211 | printk(KERN_ERR "UDF-fs: error loading MetaData " | 1208 | udf_err(sb, "error loading MetaData partition map %d\n", |
1212 | "partition map %d\n", i); | 1209 | i); |
1213 | goto out_bh; | 1210 | goto out_bh; |
1214 | } | 1211 | } |
1215 | } else { | 1212 | } else { |
@@ -1222,9 +1219,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) | |||
1222 | * overwrite blocks instead of relocating them). | 1219 | * overwrite blocks instead of relocating them). |
1223 | */ | 1220 | */ |
1224 | sb->s_flags |= MS_RDONLY; | 1221 | sb->s_flags |= MS_RDONLY; |
1225 | printk(KERN_NOTICE "UDF-fs: Filesystem marked read-only " | 1222 | pr_notice("Filesystem marked read-only because writing to pseudooverwrite partition is not implemented\n"); |
1226 | "because writing to pseudooverwrite partition is " | ||
1227 | "not implemented.\n"); | ||
1228 | } | 1223 | } |
1229 | out_bh: | 1224 | out_bh: |
1230 | /* In case loading failed, we handle cleanup in udf_fill_super */ | 1225 | /* In case loading failed, we handle cleanup in udf_fill_super */ |
@@ -1466,9 +1461,9 @@ static noinline int udf_process_sequence(struct super_block *sb, long block, | |||
1466 | 1461 | ||
1467 | bh = udf_read_tagged(sb, block, block, &ident); | 1462 | bh = udf_read_tagged(sb, block, block, &ident); |
1468 | if (!bh) { | 1463 | if (!bh) { |
1469 | printk(KERN_ERR "udf: Block %Lu of volume descriptor " | 1464 | udf_err(sb, |
1470 | "sequence is corrupted or we could not read " | 1465 | "Block %llu of volume descriptor sequence is corrupted or we could not read it\n", |
1471 | "it.\n", (unsigned long long)block); | 1466 | (unsigned long long)block); |
1472 | return 1; | 1467 | return 1; |
1473 | } | 1468 | } |
1474 | 1469 | ||
@@ -1541,7 +1536,7 @@ static noinline int udf_process_sequence(struct super_block *sb, long block, | |||
1541 | * in a suitable order | 1536 | * in a suitable order |
1542 | */ | 1537 | */ |
1543 | if (!vds[VDS_POS_PRIMARY_VOL_DESC].block) { | 1538 | if (!vds[VDS_POS_PRIMARY_VOL_DESC].block) { |
1544 | printk(KERN_ERR "udf: Primary Volume Descriptor not found!\n"); | 1539 | udf_err(sb, "Primary Volume Descriptor not found!\n"); |
1545 | return 1; | 1540 | return 1; |
1546 | } | 1541 | } |
1547 | if (udf_load_pvoldesc(sb, vds[VDS_POS_PRIMARY_VOL_DESC].block)) | 1542 | if (udf_load_pvoldesc(sb, vds[VDS_POS_PRIMARY_VOL_DESC].block)) |
@@ -1728,7 +1723,7 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt, | |||
1728 | 1723 | ||
1729 | if (!sb_set_blocksize(sb, uopt->blocksize)) { | 1724 | if (!sb_set_blocksize(sb, uopt->blocksize)) { |
1730 | if (!silent) | 1725 | if (!silent) |
1731 | printk(KERN_WARNING "UDF-fs: Bad block size\n"); | 1726 | udf_warn(sb, "Bad block size\n"); |
1732 | return 0; | 1727 | return 0; |
1733 | } | 1728 | } |
1734 | sbi->s_last_block = uopt->lastblock; | 1729 | sbi->s_last_block = uopt->lastblock; |
@@ -1737,7 +1732,7 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt, | |||
1737 | nsr_off = udf_check_vsd(sb); | 1732 | nsr_off = udf_check_vsd(sb); |
1738 | if (!nsr_off) { | 1733 | if (!nsr_off) { |
1739 | if (!silent) | 1734 | if (!silent) |
1740 | printk(KERN_WARNING "UDF-fs: No VRS found\n"); | 1735 | udf_warn(sb, "No VRS found\n"); |
1741 | return 0; | 1736 | return 0; |
1742 | } | 1737 | } |
1743 | if (nsr_off == -1) | 1738 | if (nsr_off == -1) |
@@ -1753,7 +1748,7 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt, | |||
1753 | sbi->s_anchor = uopt->anchor; | 1748 | sbi->s_anchor = uopt->anchor; |
1754 | if (!udf_find_anchor(sb, fileset)) { | 1749 | if (!udf_find_anchor(sb, fileset)) { |
1755 | if (!silent) | 1750 | if (!silent) |
1756 | printk(KERN_WARNING "UDF-fs: No anchor found\n"); | 1751 | udf_warn(sb, "No anchor found\n"); |
1757 | return 0; | 1752 | return 0; |
1758 | } | 1753 | } |
1759 | return 1; | 1754 | return 1; |
@@ -1974,15 +1969,14 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
1974 | ret = udf_load_vrs(sb, &uopt, silent, &fileset); | 1969 | ret = udf_load_vrs(sb, &uopt, silent, &fileset); |
1975 | if (!ret && uopt.blocksize != UDF_DEFAULT_BLOCKSIZE) { | 1970 | if (!ret && uopt.blocksize != UDF_DEFAULT_BLOCKSIZE) { |
1976 | if (!silent) | 1971 | if (!silent) |
1977 | printk(KERN_NOTICE | 1972 | pr_notice("Rescanning with blocksize %d\n", |
1978 | "UDF-fs: Rescanning with blocksize " | 1973 | UDF_DEFAULT_BLOCKSIZE); |
1979 | "%d\n", UDF_DEFAULT_BLOCKSIZE); | ||
1980 | uopt.blocksize = UDF_DEFAULT_BLOCKSIZE; | 1974 | uopt.blocksize = UDF_DEFAULT_BLOCKSIZE; |
1981 | ret = udf_load_vrs(sb, &uopt, silent, &fileset); | 1975 | ret = udf_load_vrs(sb, &uopt, silent, &fileset); |
1982 | } | 1976 | } |
1983 | } | 1977 | } |
1984 | if (!ret) { | 1978 | if (!ret) { |
1985 | printk(KERN_WARNING "UDF-fs: No partition found (1)\n"); | 1979 | udf_warn(sb, "No partition found (1)\n"); |
1986 | goto error_out; | 1980 | goto error_out; |
1987 | } | 1981 | } |
1988 | 1982 | ||
@@ -1997,10 +1991,9 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
1997 | le16_to_cpu(lvidiu->maxUDFWriteRev); */ | 1991 | le16_to_cpu(lvidiu->maxUDFWriteRev); */ |
1998 | 1992 | ||
1999 | if (minUDFReadRev > UDF_MAX_READ_VERSION) { | 1993 | if (minUDFReadRev > UDF_MAX_READ_VERSION) { |
2000 | printk(KERN_ERR "UDF-fs: minUDFReadRev=%x " | 1994 | udf_err(sb, "minUDFReadRev=%x (max is %x)\n", |
2001 | "(max is %x)\n", | 1995 | le16_to_cpu(lvidiu->minUDFReadRev), |
2002 | le16_to_cpu(lvidiu->minUDFReadRev), | 1996 | UDF_MAX_READ_VERSION); |
2003 | UDF_MAX_READ_VERSION); | ||
2004 | goto error_out; | 1997 | goto error_out; |
2005 | } else if (minUDFWriteRev > UDF_MAX_WRITE_VERSION) | 1998 | } else if (minUDFWriteRev > UDF_MAX_WRITE_VERSION) |
2006 | sb->s_flags |= MS_RDONLY; | 1999 | sb->s_flags |= MS_RDONLY; |
@@ -2014,28 +2007,27 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
2014 | } | 2007 | } |
2015 | 2008 | ||
2016 | if (!sbi->s_partitions) { | 2009 | if (!sbi->s_partitions) { |
2017 | printk(KERN_WARNING "UDF-fs: No partition found (2)\n"); | 2010 | udf_warn(sb, "No partition found (2)\n"); |
2018 | goto error_out; | 2011 | goto error_out; |
2019 | } | 2012 | } |
2020 | 2013 | ||
2021 | if (sbi->s_partmaps[sbi->s_partition].s_partition_flags & | 2014 | if (sbi->s_partmaps[sbi->s_partition].s_partition_flags & |
2022 | UDF_PART_FLAG_READ_ONLY) { | 2015 | UDF_PART_FLAG_READ_ONLY) { |
2023 | printk(KERN_NOTICE "UDF-fs: Partition marked readonly; " | 2016 | pr_notice("Partition marked readonly; forcing readonly mount\n"); |
2024 | "forcing readonly mount\n"); | ||
2025 | sb->s_flags |= MS_RDONLY; | 2017 | sb->s_flags |= MS_RDONLY; |
2026 | } | 2018 | } |
2027 | 2019 | ||
2028 | if (udf_find_fileset(sb, &fileset, &rootdir)) { | 2020 | if (udf_find_fileset(sb, &fileset, &rootdir)) { |
2029 | printk(KERN_WARNING "UDF-fs: No fileset found\n"); | 2021 | udf_warn(sb, "No fileset found\n"); |
2030 | goto error_out; | 2022 | goto error_out; |
2031 | } | 2023 | } |
2032 | 2024 | ||
2033 | if (!silent) { | 2025 | if (!silent) { |
2034 | struct timestamp ts; | 2026 | struct timestamp ts; |
2035 | udf_time_to_disk_stamp(&ts, sbi->s_record_time); | 2027 | udf_time_to_disk_stamp(&ts, sbi->s_record_time); |
2036 | udf_info("UDF: Mounting volume '%s', " | 2028 | udf_info("Mounting volume '%s', timestamp %04u/%02u/%02u %02u:%02u (%x)\n", |
2037 | "timestamp %04u/%02u/%02u %02u:%02u (%x)\n", | 2029 | sbi->s_volume_ident, |
2038 | sbi->s_volume_ident, le16_to_cpu(ts.year), ts.month, ts.day, | 2030 | le16_to_cpu(ts.year), ts.month, ts.day, |
2039 | ts.hour, ts.minute, le16_to_cpu(ts.typeAndTimezone)); | 2031 | ts.hour, ts.minute, le16_to_cpu(ts.typeAndTimezone)); |
2040 | } | 2032 | } |
2041 | if (!(sb->s_flags & MS_RDONLY)) | 2033 | if (!(sb->s_flags & MS_RDONLY)) |
@@ -2046,8 +2038,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
2046 | /* perhaps it's not extensible enough, but for now ... */ | 2038 | /* perhaps it's not extensible enough, but for now ... */ |
2047 | inode = udf_iget(sb, &rootdir); | 2039 | inode = udf_iget(sb, &rootdir); |
2048 | if (!inode) { | 2040 | if (!inode) { |
2049 | printk(KERN_ERR "UDF-fs: Error in udf_iget, block=%d, " | 2041 | udf_err(sb, "Error in udf_iget, block=%d, partition=%d\n", |
2050 | "partition=%d\n", | ||
2051 | rootdir.logicalBlockNum, rootdir.partitionReferenceNum); | 2042 | rootdir.logicalBlockNum, rootdir.partitionReferenceNum); |
2052 | goto error_out; | 2043 | goto error_out; |
2053 | } | 2044 | } |
@@ -2055,7 +2046,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
2055 | /* Allocate a dentry for the root inode */ | 2046 | /* Allocate a dentry for the root inode */ |
2056 | sb->s_root = d_alloc_root(inode); | 2047 | sb->s_root = d_alloc_root(inode); |
2057 | if (!sb->s_root) { | 2048 | if (!sb->s_root) { |
2058 | printk(KERN_ERR "UDF-fs: Couldn't allocate root dentry\n"); | 2049 | udf_err(sb, "Couldn't allocate root dentry\n"); |
2059 | iput(inode); | 2050 | iput(inode); |
2060 | goto error_out; | 2051 | goto error_out; |
2061 | } | 2052 | } |
@@ -2095,7 +2086,7 @@ void _udf_err(struct super_block *sb, const char *function, | |||
2095 | va_start(args, fmt); | 2086 | va_start(args, fmt); |
2096 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); | 2087 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); |
2097 | va_end(args); | 2088 | va_end(args); |
2098 | printk(KERN_CRIT "UDF-fs error (device %s): %s: %s", | 2089 | pr_crit("error (device %s): %s: %s", |
2099 | sb->s_id, function, error_buf); | 2090 | sb->s_id, function, error_buf); |
2100 | } | 2091 | } |
2101 | 2092 | ||
@@ -2107,7 +2098,7 @@ void _udf_warn(struct super_block *sb, const char *function, | |||
2107 | va_start(args, fmt); | 2098 | va_start(args, fmt); |
2108 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); | 2099 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); |
2109 | va_end(args); | 2100 | va_end(args); |
2110 | printk(KERN_WARNING "UDF-fs warning (device %s): %s: %s", | 2101 | pr_warn("warning (device %s): %s: %s", |
2111 | sb->s_id, function, error_buf); | 2102 | sb->s_id, function, error_buf); |
2112 | } | 2103 | } |
2113 | 2104 | ||
@@ -2200,11 +2191,11 @@ static unsigned int udf_count_free_bitmap(struct super_block *sb, | |||
2200 | bh = udf_read_ptagged(sb, &loc, 0, &ident); | 2191 | bh = udf_read_ptagged(sb, &loc, 0, &ident); |
2201 | 2192 | ||
2202 | if (!bh) { | 2193 | if (!bh) { |
2203 | printk(KERN_ERR "udf: udf_count_free failed\n"); | 2194 | udf_err(sb, "udf_count_free failed\n"); |
2204 | goto out; | 2195 | goto out; |
2205 | } else if (ident != TAG_IDENT_SBD) { | 2196 | } else if (ident != TAG_IDENT_SBD) { |
2206 | brelse(bh); | 2197 | brelse(bh); |
2207 | printk(KERN_ERR "udf: udf_count_free failed\n"); | 2198 | udf_err(sb, "udf_count_free failed\n"); |
2208 | goto out; | 2199 | goto out; |
2209 | } | 2200 | } |
2210 | 2201 | ||