Re: [PATCH 1/2 v2] udf : enable error print in udf_read_tagged().

From: NamJae Jeon
Date: Mon Oct 03 2011 - 19:21:00 EST


2011/10/4 Joe Perches <joe@xxxxxxxxxxx>:
> On Mon, 2011-10-03 at 22:58 +0900, NamJae Jeon wrote:
>> 2011/10/3 Joe Perches <joe@xxxxxxxxxxx>:
>> > On Mon, 2011-10-03 at 16:19 +0900, Namjae Jeon wrote:
>> >> And I use pr_fmt instead of printk by joe's suggestion. I try to modify totally it to pr_fmt also.
>> > []
>> >> diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
>> > []
>> >> @@ -19,18 +21,15 @@
>> >> Â#undef UDFFS_DEBUG
>> >>
>> >> Â#ifdef UDFFS_DEBUG
>> >> -#define udf_debug(f, a...) \
>> >> -do { \
>> >> - Â Â printk(KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \
>> >> - Â Â Â Â Â Â __FILE__, __LINE__, __func__); \
>> >> - Â Â printk(f, ##a); \
>> >> -} while (0)
>> >> +#define udf_debug(fmt, ...) Â\
>> >> + Â Â pr_debug("DEBUG %s:%d:%s: ", fmt, Â Â Â \
>> >> + Â Â Â Â Â Â __FILE__, __LINE__, __func__, __VA_ARGS__);
>> >
>> > This doesn't compile properly if UDFFS_DEBUG is
>> > #defined.
>> >
>> > No comma should be between "DEBUG %s:%d:%s: " and fmt.
>> Hi. Joe.
>> oops! it's my mistake.
>> I Âsent v3 patch again.
>> Would you review one more ?
>
> It looks OK except for a few issues.
>
> The udf_debug macro doesn't need a semicolon after
> pr_debug(foo); it should be pr_debug(foo)
> Same for udf_info.
>
> The output prefixes are a mixture of "udf: " and "UDF-fs: "
>
> Some lines are printed with 2 newlines.
>
> I've done the patch below on top of your patch.
> It should fix up these trivial things.
>
> Perhaps you'll inspect this too.
Yes, right. It is good point.
I will post new patch included your fixed.
Thanks.
>
> Convert printks to pr_<level>.
> Coalesce formats.
> Rename udf_warning to udf_warn.
> Add __attribute__((format(printf... verification to udf_warn.
> Rename udf_error to udf_err.
> Remove static from udf_err for consistency with other udf_<level> uses.
> Use printf extension "%pV" in udf_warn and udf_err
> Remove now unused static char error_buf[1024].
> Add no_printk to udf_debug when not #define UDF_DEBUG.
> Align multiline arguments to open parenthesis.
> Add newline to message formats where appropriate.
>
> ---
>
> Âfs/udf/balloc.c  Â|  Â9 +-
> Âfs/udf/directory.c | Â Â9 +-
> Âfs/udf/inode.c   |  Â3 +-
> Âfs/udf/namei.c   |  Â6 +-
> Âfs/udf/partition.c | Â 12 ++--
> Âfs/udf/super.c   | Â213 ++++++++++++++++++++++++----------------------------
> Âfs/udf/udfdecl.h  |  26 ++++---
> Â7 files changed, 132 insertions(+), 146 deletions(-)
>
> diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
> index 95518a9..48bd5c7 100644
> --- a/fs/udf/balloc.c
> +++ b/fs/udf/balloc.c
> @@ -59,8 +59,8 @@ static int __load_block_bitmap(struct super_block *sb,
> Â Â Â Âint nr_groups = bitmap->s_nr_groups;
>
> Â Â Â Âif (block_group >= nr_groups) {
> - Â Â Â Â Â Â Â udf_debug("block_group (%d) > nr_groups (%d)\n", block_group,
> - Â Â Â Â Â Â Â Â Â Â Â Â nr_groups);
> + Â Â Â Â Â Â Â udf_debug("block_group (%d) > nr_groups (%d)\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â block_group, nr_groups);
> Â Â Â Â}
>
> Â Â Â Âif (bitmap->s_block_bitmap[block_group]) {
> @@ -155,7 +155,7 @@ static void udf_bitmap_free_blocks(struct super_block *sb,
> Â Â Â Â Â Â Â Â Â Â Â Âif (udf_set_bit(bit + i, bh->b_data)) {
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("bit %ld already set\n", bit + i);
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("byte=%2x\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ((char *)bh->b_data)[(bit + i) >> 3]);
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ((char *)bh->b_data)[(bit + i) >> 3]);
> Â Â Â Â Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Âudf_add_free_space(sb, sbi->s_partition, count);
> @@ -369,7 +369,8 @@ static void udf_table_free_blocks(struct super_block *sb,
> Â Â Â Âif (bloc->logicalBlockNum + count < count ||
> Â Â Â Â Â Â(bloc->logicalBlockNum + count) > partmap->s_partition_len) {
> Â Â Â Â Â Â Â Âudf_debug("%d < %d || %d + %d > %d\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â bloc->logicalBlockNum, 0, bloc->logicalBlockNum, count,
> + Â Â Â Â Â Â Â Â Â Â Â Â bloc->logicalBlockNum, 0,
> + Â Â Â Â Â Â Â Â Â Â Â Â bloc->logicalBlockNum, count,
> Â Â Â Â Â Â Â Â Â Â Â Â Âpartmap->s_partition_len);
> Â Â Â Â Â Â Â Âgoto error_return;
> Â Â Â Â}
> diff --git a/fs/udf/directory.c b/fs/udf/directory.c
> index a4caf7a..73136e6 100644
> --- a/fs/udf/directory.c
> +++ b/fs/udf/directory.c
> @@ -162,8 +162,8 @@ struct fileIdentDesc *udf_get_fileident(void *buffer, int bufsize, int *offset)
> Â Â Â Âint padlen;
>
> Â Â Â Âif ((!buffer) || (!offset)) {
> - Â Â Â Â Â Â Â udf_debug("invalidparms\n, buffer=%p, offset=%p\n", buffer,
> - Â Â Â Â Â Â Â Â Â Â Â Â offset);
> + Â Â Â Â Â Â Â udf_debug("invalidparms, buffer=%p, offset=%p\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â buffer, offset);
> Â Â Â Â Â Â Â Âreturn NULL;
> Â Â Â Â}
>
> @@ -175,9 +175,8 @@ struct fileIdentDesc *udf_get_fileident(void *buffer, int bufsize, int *offset)
> Â Â Â Âif (fi->descTag.tagIdent != cpu_to_le16(TAG_IDENT_FID)) {
> Â Â Â Â Â Â Â Âudf_debug("0x%x != TAG_IDENT_FID\n",
> Â Â Â Â Â Â Â Â Â Â Â Â Âle16_to_cpu(fi->descTag.tagIdent));
> - Â Â Â Â Â Â Â udf_debug("offset: %u sizeof: %lu bufsize: %u\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â *offset, (unsigned long)sizeof(struct fileIdentDesc),
> - Â Â Â Â Â Â Â Â Â Â Â Â bufsize);
> + Â Â Â Â Â Â Â udf_debug("offset: %u sizeof: %zu bufsize: %u\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â *offset, sizeof(struct fileIdentDesc), bufsize);
> Â Â Â Â Â Â Â Âreturn NULL;
> Â Â Â Â}
> Â Â Â Âif ((*offset + sizeof(struct fileIdentDesc)) > bufsize)
> diff --git a/fs/udf/inode.c b/fs/udf/inode.c
> index 58665ce..6621c2a 100644
> --- a/fs/udf/inode.c
> +++ b/fs/udf/inode.c
> @@ -1982,8 +1982,7 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos,
> Â Â Â Â Â Â Â Â*elen = le32_to_cpu(lad->extLength) & UDF_EXTENT_LENGTH_MASK;
> Â Â Â Â Â Â Â Âbreak;
> Â Â Â Âdefault:
> - Â Â Â Â Â Â Â udf_debug("alloc_type = %d unsupported\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â iinfo->i_alloc_type);
> + Â Â Â Â Â Â Â udf_debug("alloc_type = %d unsupported\n", iinfo->i_alloc_type);
> Â Â Â Â Â Â Â Âreturn -1;
> Â Â Â Â}
>
> diff --git a/fs/udf/namei.c b/fs/udf/namei.c
> index f1dce84..bd936c9 100644
> --- a/fs/udf/namei.c
> +++ b/fs/udf/namei.c
> @@ -799,9 +799,9 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry)
> Â Â Â Âif (retval)
> Â Â Â Â Â Â Â Âgoto end_rmdir;
> Â Â Â Âif (inode->i_nlink != 2)
> - Â Â Â Â Â Â Â udf_warning(inode->i_sb, "udf_rmdir",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â "empty directory has nlink != 2 (%d)",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â inode->i_nlink);
> + Â Â Â Â Â Â Â udf_warn(inode->i_sb, "udf_rmdir",
> + Â Â Â Â Â Â Â Â Â Â Â Â"empty directory has nlink != 2 (%d)\n",
> + Â Â Â Â Â Â Â Â Â Â Â Âinode->i_nlink);
> Â Â Â Âclear_nlink(inode);
> Â Â Â Âinode->i_size = 0;
> Â Â Â Âinode_dec_link_count(dir);
> diff --git a/fs/udf/partition.c b/fs/udf/partition.c
> index a71090e..849039a 100644
> --- a/fs/udf/partition.c
> +++ b/fs/udf/partition.c
> @@ -33,8 +33,8 @@ uint32_t udf_get_pblock(struct super_block *sb, uint32_t block,
> Â Â Â Âstruct udf_sb_info *sbi = UDF_SB(sb);
> Â Â Â Âstruct udf_part_map *map;
> Â Â Â Âif (partition >= sbi->s_partitions) {
> - Â Â Â Â Â Â Â udf_debug("block=%d, partition=%d, offset=%d: "
> - Â Â Â Â Â Â Â Â Â Â Â Â "invalid partition\n", block, partition, offset);
> + Â Â Â Â Â Â Â udf_debug("block=%d, partition=%d, offset=%d: invalid partition\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â block, partition, offset);
> Â Â Â Â Â Â Â Âreturn 0xFFFFFFFF;
> Â Â Â Â}
> Â Â Â Âmap = &sbi->s_partmaps[partition];
> @@ -60,8 +60,8 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block,
> Â Â Â Âvdata = &map->s_type_specific.s_virtual;
>
> Â Â Â Âif (block > vdata->s_num_entries) {
> - Â Â Â Â Â Â Â udf_debug("Trying to access block beyond end of VAT "
> - Â Â Â Â Â Â Â Â Â Â Â Â "(%d max %d)\n", block, vdata->s_num_entries);
> + Â Â Â Â Â Â Â udf_debug("Trying to access block beyond end of VAT (%d max %d)\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â block, vdata->s_num_entries);
> Â Â Â Â Â Â Â Âreturn 0xFFFFFFFF;
> Â Â Â Â}
>
> @@ -322,8 +322,8 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block,
> Â Â Â ÂBUG_ON(!inode);
> Â Â Â Âretblk = udf_try_read_meta(inode, block, partition, offset);
> Â Â Â Âif (retblk == 0xFFFFFFFF) {
> - Â Â Â Â Â Â Â udf_warning(sb, __func__, "error reading from METADATA, "
> - Â Â Â Â Â Â Â Â Â Â Â "trying to read from MIRROR");
> + Â Â Â Â Â Â Â udf_warn(sb, __func__,
> + Â Â Â Â Â Â Â Â Â Â Â Â"error reading from METADATA, trying to read from MIRROR\n");
> Â Â Â Â Â Â Â Âinode = mdata->s_mirror_fe;
> Â Â Â Â Â Â Â Âif (!inode)
> Â Â Â Â Â Â Â Â Â Â Â Âreturn 0xFFFFFFFF;
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index bbf6256..ab921f9 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -75,8 +75,6 @@
>
> Â#define UDF_DEFAULT_BLOCKSIZE 2048
>
> -static char error_buf[1024];
> -
> Â/* These are the "meat" - everything else is stuffing */
> Âstatic int udf_fill_super(struct super_block *, void *, int);
> Âstatic void udf_put_super(struct super_block *);
> @@ -92,8 +90,6 @@ static void udf_close_lvid(struct super_block *);
> Âstatic unsigned int udf_count_free(struct super_block *);
> Âstatic int udf_statfs(struct dentry *, struct kstatfs *);
> Âstatic int udf_show_options(struct seq_file *, struct vfsmount *);
> -static void udf_error(struct super_block *sb, const char *function,
> - Â Â Â Â Â Â Â Â Â Â const char *fmt, ...);
>
> Âstruct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi)
> Â{
> @@ -244,9 +240,9 @@ static int udf_sb_alloc_partition_maps(struct super_block *sb, u32 count)
> Â Â Â Âsbi->s_partmaps = kcalloc(count, sizeof(struct udf_part_map),
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ÂGFP_KERNEL);
> Â Â Â Âif (!sbi->s_partmaps) {
> - Â Â Â Â Â Â Â udf_error(sb, __func__,
> - Â Â Â Â Â Â Â Â Â Â Â Â "Unable to allocate space for %d partition maps",
> - Â Â Â Â Â Â Â Â Â Â Â Â count);
> + Â Â Â Â Â Â Â udf_err(sb, __func__,
> + Â Â Â Â Â Â Â Â Â Â Â "Unable to allocate space for %d partition maps\n",
> + Â Â Â Â Â Â Â Â Â Â Â count);
> Â Â Â Â Â Â Â Âsbi->s_partitions = 0;
> Â Â Â Â Â Â Â Âreturn -ENOMEM;
> Â Â Â Â}
> @@ -550,8 +546,7 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
> Â Â Â Â Â Â Â Â Â Â Â Âuopt->dmode = option & 0777;
> Â Â Â Â Â Â Â Â Â Â Â Âbreak;
> Â Â Â Â Â Â Â Âdefault:
> - Â Â Â Â Â Â Â Â Â Â Â pr_err("bad mount option \"%s\" "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â"or missing value\n", p);
> + Â Â Â Â Â Â Â Â Â Â Â pr_err("bad mount option \"%s\" or missing value\n", p);
> Â Â Â Â Â Â Â Â Â Â Â Âreturn 0;
> Â Â Â Â Â Â Â Â}
> Â Â Â Â}
> @@ -645,20 +640,16 @@ static loff_t udf_check_vsd(struct super_block *sb)
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("ISO9660 Boot Record found\n");
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âbreak;
> Â Â Â Â Â Â Â Â Â Â Â Âcase 1:
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_debug("ISO9660 Primary Volume Descriptor "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "found\n");
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_debug("ISO9660 Primary Volume Descriptor found\n");
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âbreak;
> Â Â Â Â Â Â Â Â Â Â Â Âcase 2:
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_debug("ISO9660 Supplementary Volume "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "Descriptor found\n");
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_debug("ISO9660 Supplementary Volume Descriptor found\n");
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âbreak;
> Â Â Â Â Â Â Â Â Â Â Â Âcase 3:
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_debug("ISO9660 Volume Partition Descriptor "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "found\n");
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_debug("ISO9660 Volume Partition Descriptor found\n");
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âbreak;
> Â Â Â Â Â Â Â Â Â Â Â Âcase 255:
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_debug("ISO9660 Volume Descriptor Set "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "Terminator found\n");
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_debug("ISO9660 Volume Descriptor Set Terminator found\n");
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âbreak;
> Â Â Â Â Â Â Â Â Â Â Â Âdefault:
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("ISO9660 VRS (%u) found\n",
> @@ -809,8 +800,7 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block)
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âpvoldesc->recordingDateAndTime)) {
> Â#ifdef UDFFS_DEBUG
> Â Â Â Â Â Â Â Âstruct timestamp *ts = &pvoldesc->recordingDateAndTime;
> - Â Â Â Â Â Â Â udf_debug("recording time %04u/%02u/%02u"
> - Â Â Â Â Â Â Â Â Â Â Â Â " %02u:%02u (%x)\n",
> + Â Â Â Â Â Â Â udf_debug("recording time %04u/%02u/%02u %02u:%02u (%x)\n",
> Â Â Â Â Â Â Â Â Â Â Â Â Âle16_to_cpu(ts->year), ts->month, ts->day, ts->hour,
> Â Â Â Â Â Â Â Â Â Â Â Â Âts->minute, le16_to_cpu(ts->typeAndTimezone));
> Â#endif
> @@ -821,7 +811,7 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block)
> Â Â Â Â Â Â Â Â Â Â Â Âstrncpy(UDF_SB(sb)->s_volume_ident, outstr->u_name,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âoutstr->u_len > 31 ? 31 : outstr->u_len);
> Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("volIdent[] = '%s'\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â UDF_SB(sb)->s_volume_ident);
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â UDF_SB(sb)->s_volume_ident);
> Â Â Â Â Â Â Â Â}
>
> Â Â Â Âif (!udf_build_ustr(instr, pvoldesc->volSetIdent, 128))
> @@ -853,18 +843,16 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
> Â Â Â Âaddr.partitionReferenceNum = map->s_partition_num;
>
> Â Â Â Âudf_debug("Metadata file location: block = %d part = %d\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â addr.logicalBlockNum, addr.partitionReferenceNum);
> + Â Â Â Â Â Â Â Â addr.logicalBlockNum, addr.partitionReferenceNum);
>
> Â Â Â Âmdata->s_metadata_fe = udf_iget(sb, &addr);
>
> Â Â Â Âif (mdata->s_metadata_fe == NULL) {
> - Â Â Â Â Â Â Â udf_warning(sb, __func__, "metadata inode efe not found, "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "will try mirror inode.");
> + Â Â Â Â Â Â Â udf_warn(sb, __func__, "metadata inode efe not found, will try mirror inode\n");
> Â Â Â Â Â Â Â Âfe_error = 1;
> Â Â Â Â} else if (UDF_I(mdata->s_metadata_fe)->i_alloc_type !=
> Â Â Â Â Â Â Â Â ICBTAG_FLAG_AD_SHORT) {
> - Â Â Â Â Â Â Â udf_warning(sb, __func__, "metadata inode efe does not have "
> - Â Â Â Â Â Â Â Â Â Â Â "short allocation descriptors!");
> + Â Â Â Â Â Â Â udf_warn(sb, __func__, "metadata inode efe does not have short allocation descriptors!\n");
> Â Â Â Â Â Â Â Âfe_error = 1;
> Â Â Â Â Â Â Â Âiput(mdata->s_metadata_fe);
> Â Â Â Â Â Â Â Âmdata->s_metadata_fe = NULL;
> @@ -875,22 +863,22 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
> Â Â Â Âaddr.partitionReferenceNum = map->s_partition_num;
>
> Â Â Â Âudf_debug("Mirror metadata file location: block = %d part = %d\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â addr.logicalBlockNum, addr.partitionReferenceNum);
> + Â Â Â Â Â Â Â Â addr.logicalBlockNum, addr.partitionReferenceNum);
>
> Â Â Â Âmdata->s_mirror_fe = udf_iget(sb, &addr);
>
> Â Â Â Âif (mdata->s_mirror_fe == NULL) {
> Â Â Â Â Â Â Â Âif (fe_error) {
> - Â Â Â Â Â Â Â Â Â Â Â udf_error(sb, __func__, "mirror inode efe not found "
> - Â Â Â Â Â Â Â Â Â Â Â "and metadata inode is missing too, exiting...");
> + Â Â Â Â Â Â Â Â Â Â Â udf_err(sb, __func__,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "mirror inode efe not found and metadata inode is missing too, exiting...\n");
> Â Â Â Â Â Â Â Â Â Â Â Âgoto error_exit;
> Â Â Â Â Â Â Â Â} else
> - Â Â Â Â Â Â Â Â Â Â Â udf_warning(sb, __func__, "mirror inode efe not found,"
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â " but metadata inode is OK");
> + Â Â Â Â Â Â Â Â Â Â Â udf_warn(sb, __func__,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â"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_warning(sb, __func__, "mirror inode efe does not have "
> - Â Â Â Â Â Â Â Â Â Â Â "short allocation descriptors!");
> + Â Â Â Â Â Â Â udf_warn(sb, __func__,
> + Â Â Â Â Â Â Â Â Â Â Â Â"mirror inode efe does not have short allocation descriptors!\n");
> Â Â Â Â Â Â Â Âiput(mdata->s_mirror_fe);
> Â Â Â Â Â Â Â Âmdata->s_mirror_fe = NULL;
> Â Â Â Â Â Â Â Âif (fe_error)
> @@ -907,18 +895,17 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
> Â Â Â Â Â Â Â Âaddr.partitionReferenceNum = map->s_partition_num;
>
> Â Â Â Â Â Â Â Âudf_debug("Bitmap file location: block = %d part = %d\n",
> - Â Â Â Â Â Â Â Â Â Â Â addr.logicalBlockNum, addr.partitionReferenceNum);
> + Â Â Â Â Â Â Â Â Â Â Â Â addr.logicalBlockNum, addr.partitionReferenceNum);
>
> Â Â Â Â Â Â Â Âmdata->s_bitmap_fe = udf_iget(sb, &addr);
>
> Â Â Â Â Â Â Â Âif (mdata->s_bitmap_fe == NULL) {
> Â Â Â Â Â Â Â Â Â Â Â Âif (sb->s_flags & MS_RDONLY)
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_warning(sb, __func__, "bitmap inode efe "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "not found but it's ok since the disc"
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â " is mounted read-only");
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_warn(sb, __func__,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â"bitmap inode efe not found but it's ok since the disc is mounted read-only\n");
> Â Â Â Â Â Â Â Â Â Â Â Âelse {
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_error(sb, __func__, "bitmap inode efe not "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "found and attempted read-write mount");
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_err(sb, __func__,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "bitmap inode efe not found and attempted read-write mount\n");
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âgoto error_exit;
> Â Â Â Â Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Â}
> @@ -971,9 +958,9 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
> Â Â Â Â Â Â Â Âbitmap = vzalloc(size); /* TODO: get rid of vzalloc */
>
> Â Â Â Âif (bitmap == NULL) {
> - Â Â Â Â Â Â Â udf_error(sb, __func__,
> - Â Â Â Â Â Â Â Â Â Â Â Â "Unable to allocate space for bitmap "
> - Â Â Â Â Â Â Â Â Â Â Â Â "and %d buffer_head pointers", nr_groups);
> + Â Â Â Â Â Â Â udf_err(sb, __func__,
> + Â Â Â Â Â Â Â Â Â Â Â "Unable to allocate space for bitmap and %d buffer_head pointers\n",
> + Â Â Â Â Â Â Â Â Â Â Â nr_groups);
> Â Â Â Â Â Â Â Âreturn NULL;
> Â Â Â Â}
>
> @@ -1003,8 +990,8 @@ static int udf_fill_partdesc_info(struct super_block *sb,
> Â Â Â Âif (p->accessType == cpu_to_le32(PD_ACCESS_TYPE_OVERWRITABLE))
> Â Â Â Â Â Â Â Âmap->s_partition_flags |= UDF_PART_FLAG_OVERWRITABLE;
>
> - Â Â Â udf_debug("Partition (%d type %x) starts at physical %d, "
> - Â Â Â Â Â Â Â Â "block length %d\n", p_index,
> + Â Â Â udf_debug("Partition (%d type %x) starts at physical %d, block length %d\n",
> + Â Â Â Â Â Â Â Â p_index,
> Â Â Â Â Â Â Â Â Âmap->s_partition_type, map->s_partition_root,
> Â Â Â Â Â Â Â Â Âmap->s_partition_len);
>
> @@ -1023,12 +1010,12 @@ static int udf_fill_partdesc_info(struct super_block *sb,
> Â Â Â Â Â Â Â Âmap->s_uspace.s_table = udf_iget(sb, &loc);
> Â Â Â Â Â Â Â Âif (!map->s_uspace.s_table) {
> Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("cannot load unallocSpaceTable (part %d)\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â p_index);
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â p_index);
> Â Â Â Â Â Â Â Â Â Â Â Âreturn 1;
> Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Âmap->s_partition_flags |= UDF_PART_FLAG_UNALLOC_TABLE;
> Â Â Â Â Â Â Â Âudf_debug("unallocSpaceTable (part %d) @ %ld\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â p_index, map->s_uspace.s_table->i_ino);
> + Â Â Â Â Â Â Â Â Â Â Â Â p_index, map->s_uspace.s_table->i_ino);
> Â Â Â Â}
>
> Â Â Â Âif (phd->unallocSpaceBitmap.extLength) {
> @@ -1041,8 +1028,8 @@ static int udf_fill_partdesc_info(struct super_block *sb,
> Â Â Â Â Â Â Â Âbitmap->s_extPosition = le32_to_cpu(
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âphd->unallocSpaceBitmap.extPosition);
> Â Â Â Â Â Â Â Âmap->s_partition_flags |= UDF_PART_FLAG_UNALLOC_BITMAP;
> - Â Â Â Â Â Â Â udf_debug("unallocSpaceBitmap (part %d) @ %d\n", p_index,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â bitmap->s_extPosition);
> + Â Â Â Â Â Â Â udf_debug("unallocSpaceBitmap (part %d) @ %d\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â p_index, bitmap->s_extPosition);
> Â Â Â Â}
>
> Â Â Â Âif (phd->partitionIntegrityTable.extLength)
> @@ -1058,13 +1045,13 @@ static int udf_fill_partdesc_info(struct super_block *sb,
> Â Â Â Â Â Â Â Âmap->s_fspace.s_table = udf_iget(sb, &loc);
> Â Â Â Â Â Â Â Âif (!map->s_fspace.s_table) {
> Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("cannot load freedSpaceTable (part %d)\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â p_index);
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â p_index);
> Â Â Â Â Â Â Â Â Â Â Â Âreturn 1;
> Â Â Â Â Â Â Â Â}
>
> Â Â Â Â Â Â Â Âmap->s_partition_flags |= UDF_PART_FLAG_FREED_TABLE;
> Â Â Â Â Â Â Â Âudf_debug("freedSpaceTable (part %d) @ %ld\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â p_index, map->s_fspace.s_table->i_ino);
> + Â Â Â Â Â Â Â Â Â Â Â Â p_index, map->s_fspace.s_table->i_ino);
> Â Â Â Â}
>
> Â Â Â Âif (phd->freedSpaceBitmap.extLength) {
> @@ -1077,8 +1064,8 @@ static int udf_fill_partdesc_info(struct super_block *sb,
> Â Â Â Â Â Â Â Âbitmap->s_extPosition = le32_to_cpu(
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âphd->freedSpaceBitmap.extPosition);
> Â Â Â Â Â Â Â Âmap->s_partition_flags |= UDF_PART_FLAG_FREED_BITMAP;
> - Â Â Â Â Â Â Â udf_debug("freedSpaceBitmap (part %d) @ %d\n", p_index,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â bitmap->s_extPosition);
> + Â Â Â Â Â Â Â udf_debug("freedSpaceBitmap (part %d) @ %d\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â p_index, bitmap->s_extPosition);
> Â Â Â Â}
> Â Â Â Âreturn 0;
> Â}
> @@ -1118,11 +1105,9 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
> Â Â Â Âudf_find_vat_block(sb, p_index, type1_index, sbi->s_last_block);
> Â Â Â Âif (!sbi->s_vat_inode &&
> Â Â Â Â Â Âsbi->s_last_block != blocks - 1) {
> - Â Â Â Â Â Â Â printk(KERN_NOTICE "UDF-fs: Failed to read VAT inode from the"
> - Â Â Â Â Â Â Â Â Â Â Â" last recorded block (%lu), retrying with the last "
> - Â Â Â Â Â Â Â Â Â Â Â"block of the device (%lu).\n",
> - Â Â Â Â Â Â Â Â Â Â Â(unsigned long)sbi->s_last_block,
> - Â Â Â Â Â Â Â Â Â Â Â(unsigned long)blocks - 1);
> + Â Â Â Â Â Â Â pr_notice("Failed to read VAT inode from the last recorded block (%lu), retrying with the last block of the device (%lu)\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â (unsigned long)sbi->s_last_block,
> + Â Â Â Â Â Â Â Â Â Â Â Â (unsigned long)blocks - 1);
> Â Â Â Â Â Â Â Âudf_find_vat_block(sb, p_index, type1_index, blocks - 1);
> Â Â Â Â}
> Â Â Â Âif (!sbi->s_vat_inode)
> @@ -1220,8 +1205,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block)
> Â Â Â Âif (map->s_partition_type == UDF_METADATA_MAP25) {
> Â Â Â Â Â Â Â Âret = udf_load_metadata_files(sb, i);
> Â Â Â Â Â Â Â Âif (ret) {
> - Â Â Â Â Â Â Â Â Â Â Â printk(KERN_ERR "UDF-fs: error loading MetaData "
> - Â Â Â Â Â Â Â Â Â Â Â "partition map %d\n", i);
> + Â Â Â Â Â Â Â Â Â Â Â pr_err("error loading MetaData partition map %d\n", i);
> Â Â Â Â Â Â Â Â Â Â Â Âgoto out_bh;
> Â Â Â Â Â Â Â Â}
> Â Â Â Â} else {
> @@ -1234,9 +1218,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block)
> Â Â Â Â Â Â Â Â * overwrite blocks instead of relocating them).
> Â Â Â Â Â Â Â Â */
> Â Â Â Â Â Â Â Âsb->s_flags |= MS_RDONLY;
> - Â Â Â Â Â Â Â printk(KERN_NOTICE "UDF-fs: Filesystem marked read-only "
> - Â Â Â Â Â Â Â Â Â Â Â "because writing to pseudooverwrite partition is "
> - Â Â Â Â Â Â Â Â Â Â Â "not implemented.\n");
> + Â Â Â Â Â Â Â pr_notice("Filesystem marked read-only because writing to pseudooverwrite partition is not implemented\n");
> Â Â Â Â}
> Âout_bh:
> Â Â Â Â/* In case loading failed, we handle cleanup in udf_fill_super */
> @@ -1344,9 +1326,8 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âstruct metadataPartitionMap *mdm =
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â(struct metadataPartitionMap *)
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â&(lvd->partitionMaps[offset]);
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_debug("Parsing Logical vol part %d "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "type %d Âid=%s\n", i, type,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â UDF_ID_METADATA);
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â udf_debug("Parsing Logical vol part %d type %d Âid=%s\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â i, type, UDF_ID_METADATA);
>
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âmap->s_partition_type = UDF_METADATA_MAP25;
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âmap->s_partition_func = udf_get_pblock_meta25;
> @@ -1365,21 +1346,20 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âmdm->flags & 0x01;
>
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("Metadata Ident suffix=0x%x\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (le16_to_cpu(
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â((__le16 *)
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mdm->partIdent.identSuffix)[0])));
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â le16_to_cpu(*(__le16 *)
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âmdm->partIdent.identSuffix));
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("Metadata part num=%d\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â le16_to_cpu(mdm->partitionNum));
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â le16_to_cpu(mdm->partitionNum));
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("Metadata part alloc unit size=%d\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â le32_to_cpu(mdm->allocUnitSize));
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â le32_to_cpu(mdm->allocUnitSize));
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("Metadata file loc=%d\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â le32_to_cpu(mdm->metadataFileLoc));
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â le32_to_cpu(mdm->metadataFileLoc));
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("Mirror file loc=%d\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âle32_to_cpu(mdm->metadataMirrorFileLoc));
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â le32_to_cpu(mdm->metadataMirrorFileLoc));
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("Bitmap file loc=%d\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âle32_to_cpu(mdm->metadataBitmapFileLoc));
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â le32_to_cpu(mdm->metadataBitmapFileLoc));
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("Duplicate Flag: %d %d\n",
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mdata->s_dup_md_flag, mdm->flags);
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mdata->s_dup_md_flag, mdm->flags);
> Â Â Â Â Â Â Â Â Â Â Â Â} else {
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âudf_debug("Unknown ident: %s\n",
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âupm2->partIdent.ident);
> @@ -1397,8 +1377,8 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
> Â Â Â Â Â Â Â Âstruct long_ad *la = (struct long_ad *)&(lvd->logicalVolContentsUse[0]);
>
> Â Â Â Â Â Â Â Â*fileset = lelb_to_cpu(la->extLocation);
> - Â Â Â Â Â Â Â udf_debug("FileSet found in LogicalVolDesc at block=%d, "
> - Â Â Â Â Â Â Â Â Â Â Â Â "partition=%d\n", fileset->logicalBlockNum,
> + Â Â Â Â Â Â Â udf_debug("FileSet found in LogicalVolDesc at block=%d, partition=%d\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â fileset->logicalBlockNum,
> Â Â Â Â Â Â Â Â Â Â Â Â Âfileset->partitionReferenceNum);
> Â Â Â Â}
> Â Â Â Âif (lvd->integritySeqExt.extLength)
> @@ -1478,9 +1458,8 @@ static noinline int udf_process_sequence(struct super_block *sb, long block,
>
> Â Â Â Â Â Â Â Âbh = udf_read_tagged(sb, block, block, &ident);
> Â Â Â Â Â Â Â Âif (!bh) {
> - Â Â Â Â Â Â Â Â Â Â Â printk(KERN_ERR "udf: Block %Lu of volume descriptor "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â"sequence is corrupted or we could not read "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â"it.\n", (unsigned long long)block);
> + Â Â Â Â Â Â Â Â Â Â Â pr_err("Block %lu of volume descriptor sequence is corrupted or we could not read it\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â(unsigned long)block);
> Â Â Â Â Â Â Â Â Â Â Â Âreturn 1;
> Â Â Â Â Â Â Â Â}
>
> @@ -1553,7 +1532,7 @@ static noinline int udf_process_sequence(struct super_block *sb, long block,
> Â Â Â Â * in a suitable order
> Â Â Â Â */
> Â Â Â Âif (!vds[VDS_POS_PRIMARY_VOL_DESC].block) {
> - Â Â Â Â Â Â Â printk(KERN_ERR "udf: Primary Volume Descriptor not found!\n");
> + Â Â Â Â Â Â Â pr_err("Primary Volume Descriptor not found!\n");
> Â Â Â Â Â Â Â Âreturn 1;
> Â Â Â Â}
> Â Â Â Âif (udf_load_pvoldesc(sb, vds[VDS_POS_PRIMARY_VOL_DESC].block))
> @@ -1740,7 +1719,7 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt,
>
> Â Â Â Âif (!sb_set_blocksize(sb, uopt->blocksize)) {
> Â Â Â Â Â Â Â Âif (!silent)
> - Â Â Â Â Â Â Â Â Â Â Â printk(KERN_WARNING "UDF-fs: Bad block size\n");
> + Â Â Â Â Â Â Â Â Â Â Â pr_warn("Bad block size\n");
> Â Â Â Â Â Â Â Âreturn 0;
> Â Â Â Â}
> Â Â Â Âsbi->s_last_block = uopt->lastblock;
> @@ -1749,12 +1728,11 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt,
> Â Â Â Â Â Â Â Ânsr_off = udf_check_vsd(sb);
> Â Â Â Â Â Â Â Âif (!nsr_off) {
> Â Â Â Â Â Â Â Â Â Â Â Âif (!silent)
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â printk(KERN_WARNING "UDF-fs: No VRS found\n");
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â pr_warn("No VRS found\n");
> Â Â Â Â Â Â Â Â Â Â Â Âreturn 0;
> Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Âif (nsr_off == -1)
> - Â Â Â Â Â Â Â Â Â Â Â udf_debug("Failed to read byte 32768. Assuming open "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "disc. Skipping validity check\n");
> + Â Â Â Â Â Â Â Â Â Â Â udf_debug("Failed to read byte 32768. Assuming open disc. Skipping validity check\n");
> Â Â Â Â Â Â Â Âif (!sbi->s_last_block)
> Â Â Â Â Â Â Â Â Â Â Â Âsbi->s_last_block = udf_get_last_block(sb);
> Â Â Â Â} else {
> @@ -1765,7 +1743,7 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt,
> Â Â Â Âsbi->s_anchor = uopt->anchor;
> Â Â Â Âif (!udf_find_anchor(sb, fileset)) {
> Â Â Â Â Â Â Â Âif (!silent)
> - Â Â Â Â Â Â Â Â Â Â Â printk(KERN_WARNING "UDF-fs: No anchor found\n");
> + Â Â Â Â Â Â Â Â Â Â Â pr_warn("No anchor found\n");
> Â Â Â Â Â Â Â Âreturn 0;
> Â Â Â Â}
> Â Â Â Âreturn 1;
> @@ -1937,8 +1915,8 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
>
> Â Â Â Âif (uopt.flags & (1 << UDF_FLAG_UTF8) &&
> Â Â Â Â Â Âuopt.flags & (1 << UDF_FLAG_NLS_MAP)) {
> - Â Â Â Â Â Â Â udf_error(sb, "udf_read_super",
> - Â Â Â Â Â Â Â Â Â Â Â Â "utf8 cannot be combined with iocharset\n");
> + Â Â Â Â Â Â Â udf_err(sb, "udf_read_super",
> + Â Â Â Â Â Â Â Â Â Â Â "utf8 cannot be combined with iocharset\n");
> Â Â Â Â Â Â Â Âgoto error_out;
> Â Â Â Â}
> Â#ifdef CONFIG_UDF_NLS
> @@ -1987,15 +1965,14 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
> Â Â Â Â Â Â Â Âret = udf_load_vrs(sb, &uopt, silent, &fileset);
> Â Â Â Â Â Â Â Âif (!ret && uopt.blocksize != UDF_DEFAULT_BLOCKSIZE) {
> Â Â Â Â Â Â Â Â Â Â Â Âif (!silent)
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â printk(KERN_NOTICE
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â"UDF-fs: Rescanning with blocksize "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â"%d\n", UDF_DEFAULT_BLOCKSIZE);
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â pr_notice("Rescanning with blocksize %d\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â UDF_DEFAULT_BLOCKSIZE);
> Â Â Â Â Â Â Â Â Â Â Â Âuopt.blocksize = UDF_DEFAULT_BLOCKSIZE;
> Â Â Â Â Â Â Â Â Â Â Â Âret = udf_load_vrs(sb, &uopt, silent, &fileset);
> Â Â Â Â Â Â Â Â}
> Â Â Â Â}
> Â Â Â Âif (!ret) {
> - Â Â Â Â Â Â Â printk(KERN_WARNING "UDF-fs: No partition found (1)\n");
> + Â Â Â Â Â Â Â pr_warn("No partition found (1)\n");
> Â Â Â Â Â Â Â Âgoto error_out;
> Â Â Â Â}
>
> @@ -2010,8 +1987,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âle16_to_cpu(lvidiu->maxUDFWriteRev); */
>
> Â Â Â Â Â Â Â Âif (minUDFReadRev > UDF_MAX_READ_VERSION) {
> - Â Â Â Â Â Â Â Â Â Â Â printk(KERN_ERR "UDF-fs: minUDFReadRev=%x "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "(max is %x)\n",
> + Â Â Â Â Â Â Â Â Â Â Â pr_err("minUDFReadRev=%x (max is %x)\n",
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â le16_to_cpu(lvidiu->minUDFReadRev),
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â UDF_MAX_READ_VERSION);
> Â Â Â Â Â Â Â Â Â Â Â Âgoto error_out;
> @@ -2027,27 +2003,25 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
> Â Â Â Â}
>
> Â Â Â Âif (!sbi->s_partitions) {
> - Â Â Â Â Â Â Â printk(KERN_WARNING "UDF-fs: No partition found (2)\n");
> + Â Â Â Â Â Â Â pr_warn("No partition found (2)\n");
> Â Â Â Â Â Â Â Âgoto error_out;
> Â Â Â Â}
>
> Â Â Â Âif (sbi->s_partmaps[sbi->s_partition].s_partition_flags &
> Â Â Â Â Â Â Â Â Â Â Â ÂUDF_PART_FLAG_READ_ONLY) {
> - Â Â Â Â Â Â Â printk(KERN_NOTICE "UDF-fs: Partition marked readonly; "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â"forcing readonly mount\n");
> + Â Â Â Â Â Â Â pr_notice("Partition marked readonly; forcing readonly mount\n");
> Â Â Â Â Â Â Â Âsb->s_flags |= MS_RDONLY;
> Â Â Â Â}
>
> Â Â Â Âif (udf_find_fileset(sb, &fileset, &rootdir)) {
> - Â Â Â Â Â Â Â printk(KERN_WARNING "UDF-fs: No fileset found\n");
> + Â Â Â Â Â Â Â pr_warn("No fileset found\n");
> Â Â Â Â Â Â Â Âgoto error_out;
> Â Â Â Â}
>
> Â Â Â Âif (!silent) {
> Â Â Â Â Â Â Â Âstruct timestamp ts;
> Â Â Â Â Â Â Â Âudf_time_to_disk_stamp(&ts, sbi->s_record_time);
> - Â Â Â Â Â Â Â udf_info("UDF: Mounting volume '%s', "
> - Â Â Â Â Â Â Â Â Â Â Â Â"timestamp %04u/%02u/%02u %02u:%02u (%x)\n",
> + Â Â Â Â Â Â Â udf_info("Mounting volume '%s', timestamp %04u/%02u/%02u %02u:%02u (%x)\n",
> Â Â Â Â Â Â Â Â Â Â Â Â sbi->s_volume_ident, le16_to_cpu(ts.year), ts.month, ts.day,
> Â Â Â Â Â Â Â Â Â Â Â Â ts.hour, ts.minute, le16_to_cpu(ts.typeAndTimezone));
> Â Â Â Â}
> @@ -2059,8 +2033,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
> Â Â Â Â/* perhaps it's not extensible enough, but for now ... */
> Â Â Â Âinode = udf_iget(sb, &rootdir);
> Â Â Â Âif (!inode) {
> - Â Â Â Â Â Â Â printk(KERN_ERR "UDF-fs: Error in udf_iget, block=%d, "
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "partition=%d\n",
> + Â Â Â Â Â Â Â pr_err("Error in udf_iget, block=%d, partition=%d\n",
> Â Â Â Â Â Â Â Â Â Â Â rootdir.logicalBlockNum, rootdir.partitionReferenceNum);
> Â Â Â Â Â Â Â Âgoto error_out;
> Â Â Â Â}
> @@ -2068,7 +2041,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
> Â Â Â Â/* Allocate a dentry for the root inode */
> Â Â Â Âsb->s_root = d_alloc_root(inode);
> Â Â Â Âif (!sb->s_root) {
> - Â Â Â Â Â Â Â printk(KERN_ERR "UDF-fs: Couldn't allocate root dentry\n");
> + Â Â Â Â Â Â Â pr_err("Couldn't allocate root dentry\n");
> Â Â Â Â Â Â Â Âiput(inode);
> Â Â Â Â Â Â Â Âgoto error_out;
> Â Â Â Â}
> @@ -2096,32 +2069,40 @@ error_out:
> Â Â Â Âreturn -EINVAL;
> Â}
>
> -static void udf_error(struct super_block *sb, const char *function,
> - Â Â Â Â Â Â Â Â Â Â const char *fmt, ...)
> +void udf_err(struct super_block *sb, const char *function,
> + Â Â Â Â Â Âconst char *fmt, ...)
> Â{
> + Â Â Â struct va_format vaf;
> Â Â Â Âva_list args;
>
> - Â Â Â if (!(sb->s_flags & MS_RDONLY)) {
> + Â Â Â va_start(args, fmt);
> +
> + Â Â Â vaf.fmt = fmt;
> + Â Â Â vaf.va = &args;
> +
> + Â Â Â if (!(sb->s_flags & MS_RDONLY))
> Â Â Â Â Â Â Â Â/* mark sb error */
> Â Â Â Â Â Â Â Âsb->s_dirt = 1;
> - Â Â Â }
> - Â Â Â va_start(args, fmt);
> - Â Â Â vsnprintf(error_buf, sizeof(error_buf), fmt, args);
> +
> + Â Â Â pr_crit("error (device %s): %s: %pV", sb->s_id, function, &vaf);
> +
> Â Â Â Âva_end(args);
> - Â Â Â printk(KERN_CRIT "UDF-fs error (device %s): %s: %s\n",
> - Â Â Â Â Â Â Â sb->s_id, function, error_buf);
> Â}
>
> -void udf_warning(struct super_block *sb, const char *function,
> - Â Â Â Â Â Â Â Âconst char *fmt, ...)
> +void udf_warn(struct super_block *sb, const char *function,
> + Â Â Â Â Â Â const char *fmt, ...)
> Â{
> + Â Â Â struct va_format vaf;
> Â Â Â Âva_list args;
>
> Â Â Â Âva_start(args, fmt);
> - Â Â Â vsnprintf(error_buf, sizeof(error_buf), fmt, args);
> +
> + Â Â Â vaf.fmt = fmt;
> + Â Â Â vaf.va = &args;
> +
> + Â Â Â pr_warn("warning (device %s): %s: %pV", sb->s_id, function, &vaf);
> +
> Â Â Â Âva_end(args);
> - Â Â Â printk(KERN_WARNING "UDF-fs warning (device %s): %s: %s\n",
> - Â Â Â Â Â Â Âsb->s_id, function, error_buf);
> Â}
>
> Âstatic void udf_put_super(struct super_block *sb)
> @@ -2213,11 +2194,11 @@ static unsigned int udf_count_free_bitmap(struct super_block *sb,
> Â Â Â Âbh = udf_read_ptagged(sb, &loc, 0, &ident);
>
> Â Â Â Âif (!bh) {
> - Â Â Â Â Â Â Â printk(KERN_ERR "udf: udf_count_free failed\n");
> + Â Â Â Â Â Â Â pr_err("udf: udf_count_free failed\n");
> Â Â Â Â Â Â Â Âgoto out;
> Â Â Â Â} else if (ident != TAG_IDENT_SBD) {
> Â Â Â Â Â Â Â Âbrelse(bh);
> - Â Â Â Â Â Â Â printk(KERN_ERR "udf: udf_count_free failed\n");
> + Â Â Â Â Â Â Â pr_err("udf: udf_count_free failed\n");
> Â Â Â Â Â Â Â Âgoto out;
> Â Â Â Â}
>
> diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
> index f77c813..f1010b2 100644
> --- a/fs/udf/udfdecl.h
> +++ b/fs/udf/udfdecl.h
> @@ -20,18 +20,26 @@
>
> Â#undef UDFFS_DEBUG
>
> +__attribute__((format(printf, 3, 4)))
> +void udf_err(struct super_block *sb, const char *function,
> + Â Â Â Â Â Âconst char *fmt, ...);
> +
> +__attribute__((format(printf, 3, 4)))
> +void udf_warn(struct super_block *sb, const char *function,
> + Â Â Â Â Â Â const char *fmt, ...);
> +
> +#define udf_info(fmt, ...) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
> + Â Â Â pr_info("INFO " fmt, ##__VA_ARGS__)
> +
> Â#ifdef UDFFS_DEBUG
> -#define udf_debug(fmt, ...) Â Â\
> - Â Â Â pr_debug("DEBUG %s:%d:%s: " fmt, Â Â Â Â\
> - Â Â Â Â Â Â Â __FILE__, __LINE__, __func__, ##__VA_ARGS__);
> +#define udf_debug(fmt, ...) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â\
> + Â Â Â pr_debug("DEBUG %s:%d:%s: " fmt, Â Â Â Â Â Â Â Â Â Â Â Â\
> + Â Â Â Â Â Â Â Â__FILE__, __LINE__, __func__, ##__VA_ARGS__)
> Â#else
> -#define udf_debug(fmt, ...) /**/
> +#define udf_debug(fmt, ...) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â\
> + Â Â Â no_printk(KERN_DEBUG fmt, ##__VA_ARGS__)
> Â#endif
>
> -#define udf_info(f, a...) \
> - Â Â Â pr_info("INFO " f, ##a);
> -
> -
> Â#define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) )
> Â#define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) )
>
> @@ -111,8 +119,6 @@ struct extent_position {
>
> Â/* super.c */
>
> -__attribute__((format(printf, 3, 4)))
> -extern void udf_warning(struct super_block *, const char *, const char *, ...);
> Âstatic inline void udf_updated_lvid(struct super_block *sb)
> Â{
> Â Â Â Âstruct buffer_head *bh = UDF_SB(sb)->s_lvid_bh;
> --
> 1.7.6.405.gc1be0
>
>
>
>
èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—