Commit 78ace70c authored by Joe Perches's avatar Joe Perches Committed by Jan Kara

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent a40ecd7b
...@@ -201,7 +201,7 @@ struct short_ad *udf_get_fileshortad(uint8_t *ptr, int maxoffset, uint32_t *offs ...@@ -201,7 +201,7 @@ struct short_ad *udf_get_fileshortad(uint8_t *ptr, int maxoffset, uint32_t *offs
struct short_ad *sa; struct short_ad *sa;
if ((!ptr) || (!offset)) { if ((!ptr) || (!offset)) {
printk(KERN_ERR "udf: udf_get_fileshortad() invalidparms\n"); pr_err("%s: invalidparms\n", __func__);
return NULL; return NULL;
} }
...@@ -223,7 +223,7 @@ struct long_ad *udf_get_filelongad(uint8_t *ptr, int maxoffset, uint32_t *offset ...@@ -223,7 +223,7 @@ struct long_ad *udf_get_filelongad(uint8_t *ptr, int maxoffset, uint32_t *offset
struct long_ad *la; struct long_ad *la;
if ((!ptr) || (!offset)) { if ((!ptr) || (!offset)) {
printk(KERN_ERR "udf: udf_get_filelongad() invalidparms\n"); pr_err("%s: invalidparms\n", __func__);
return NULL; return NULL;
} }
......
...@@ -84,12 +84,10 @@ void udf_evict_inode(struct inode *inode) ...@@ -84,12 +84,10 @@ void udf_evict_inode(struct inode *inode)
end_writeback(inode); end_writeback(inode);
if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB && if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB &&
inode->i_size != iinfo->i_lenExtents) { inode->i_size != iinfo->i_lenExtents) {
printk(KERN_WARNING "UDF-fs (%s): Inode %lu (mode %o) has " udf_warn(inode->i_sb, "Inode %lu (mode %o) has inode size %llu different from extent length %llu. Filesystem need not be standards compliant.\n",
"inode size %llu different from extent length %llu. " inode->i_ino, inode->i_mode,
"Filesystem need not be standards compliant.\n", (unsigned long long)inode->i_size,
inode->i_sb->s_id, inode->i_ino, inode->i_mode, (unsigned long long)iinfo->i_lenExtents);
(unsigned long long)inode->i_size,
(unsigned long long)iinfo->i_lenExtents);
} }
kfree(iinfo->i_ext.i_data); kfree(iinfo->i_ext.i_data);
iinfo->i_ext.i_data = NULL; iinfo->i_ext.i_data = NULL;
...@@ -1177,16 +1175,15 @@ static void __udf_read_inode(struct inode *inode) ...@@ -1177,16 +1175,15 @@ static void __udf_read_inode(struct inode *inode)
*/ */
bh = udf_read_ptagged(inode->i_sb, &iinfo->i_location, 0, &ident); bh = udf_read_ptagged(inode->i_sb, &iinfo->i_location, 0, &ident);
if (!bh) { if (!bh) {
printk(KERN_ERR "udf: udf_read_inode(ino %ld) failed !bh\n", udf_err(inode->i_sb, "(ino %ld) failed !bh\n", inode->i_ino);
inode->i_ino);
make_bad_inode(inode); make_bad_inode(inode);
return; return;
} }
if (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE && if (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE &&
ident != TAG_IDENT_USE) { ident != TAG_IDENT_USE) {
printk(KERN_ERR "udf: udf_read_inode(ino %ld) " udf_err(inode->i_sb, "(ino %ld) failed ident=%d\n",
"failed ident=%d\n", inode->i_ino, ident); inode->i_ino, ident);
brelse(bh); brelse(bh);
make_bad_inode(inode); make_bad_inode(inode);
return; return;
...@@ -1226,8 +1223,8 @@ static void __udf_read_inode(struct inode *inode) ...@@ -1226,8 +1223,8 @@ static void __udf_read_inode(struct inode *inode)
} }
brelse(ibh); brelse(ibh);
} else if (fe->icbTag.strategyType != cpu_to_le16(4)) { } else if (fe->icbTag.strategyType != cpu_to_le16(4)) {
printk(KERN_ERR "udf: unsupported strategy type: %d\n", udf_err(inode->i_sb, "unsupported strategy type: %d\n",
le16_to_cpu(fe->icbTag.strategyType)); le16_to_cpu(fe->icbTag.strategyType));
brelse(bh); brelse(bh);
make_bad_inode(inode); make_bad_inode(inode);
return; return;
...@@ -1421,9 +1418,8 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) ...@@ -1421,9 +1418,8 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
udf_debug("METADATA BITMAP FILE-----\n"); udf_debug("METADATA BITMAP FILE-----\n");
break; break;
default: default:
printk(KERN_ERR "udf: udf_fill_inode(ino %ld) failed unknown " udf_err(inode->i_sb, "(ino %ld) failed unknown file type=%d\n",
"file type=%d\n", inode->i_ino, inode->i_ino, fe->icbTag.fileType);
fe->icbTag.fileType);
make_bad_inode(inode); make_bad_inode(inode);
return; return;
} }
...@@ -1446,8 +1442,8 @@ static int udf_alloc_i_data(struct inode *inode, size_t size) ...@@ -1446,8 +1442,8 @@ static int udf_alloc_i_data(struct inode *inode, size_t size)
iinfo->i_ext.i_data = kmalloc(size, GFP_KERNEL); iinfo->i_ext.i_data = kmalloc(size, GFP_KERNEL);
if (!iinfo->i_ext.i_data) { if (!iinfo->i_ext.i_data) {
printk(KERN_ERR "udf:udf_alloc_i_data (ino %ld) " udf_err(inode->i_sb, "(ino %ld) no free memory\n",
"no free memory\n", inode->i_ino); inode->i_ino);
return -ENOMEM; return -ENOMEM;
} }
...@@ -1697,9 +1693,8 @@ static int udf_update_inode(struct inode *inode, int do_sync) ...@@ -1697,9 +1693,8 @@ static int udf_update_inode(struct inode *inode, int do_sync)
if (do_sync) { if (do_sync) {
sync_dirty_buffer(bh); sync_dirty_buffer(bh);
if (buffer_write_io_error(bh)) { if (buffer_write_io_error(bh)) {
printk(KERN_WARNING "IO error syncing udf inode " udf_warn(inode->i_sb, "IO error syncing udf inode [%08lx]\n",
"[%s:%08lx]\n", inode->i_sb->s_id, inode->i_ino);
inode->i_ino);
err = -EIO; err = -EIO;
} }
} }
......
...@@ -547,8 +547,7 @@ static int udf_parse_options(char *options, struct udf_options *uopt, ...@@ -547,8 +547,7 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
uopt->dmode = option & 0777; uopt->dmode = option & 0777;
break; break;
default: default:
printk(KERN_ERR "udf: bad mount option \"%s\" " pr_err("bad mount option \"%s\" or missing value\n", p);
"or missing value\n", p);
return 0; return 0;
} }
} }
...@@ -1106,11 +1105,9 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index) ...@@ -1106,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); udf_find_vat_block(sb, p_index, type1_index, sbi->s_last_block);
if (!sbi->s_vat_inode && if (!sbi->s_vat_inode &&
sbi->s_last_block != blocks - 1) { sbi->s_last_block != blocks - 1) {
printk(KERN_NOTICE "UDF-fs: Failed to read VAT inode from the" pr_notice("Failed to read VAT inode from the last recorded block (%lu), retrying with the last block of the device (%lu).\n",
" last recorded block (%lu), retrying with the last " (unsigned long)sbi->s_last_block,
"block of the device (%lu).\n", (unsigned long)blocks - 1);
(unsigned long)sbi->s_last_block,
(unsigned long)blocks - 1);
udf_find_vat_block(sb, p_index, type1_index, blocks - 1); udf_find_vat_block(sb, p_index, type1_index, blocks - 1);
} }
if (!sbi->s_vat_inode) if (!sbi->s_vat_inode)
...@@ -1208,8 +1205,8 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) ...@@ -1208,8 +1205,8 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block)
if (map->s_partition_type == UDF_METADATA_MAP25) { if (map->s_partition_type == UDF_METADATA_MAP25) {
ret = udf_load_metadata_files(sb, i); ret = udf_load_metadata_files(sb, i);
if (ret) { if (ret) {
printk(KERN_ERR "UDF-fs: error loading MetaData " udf_err(sb, "error loading MetaData partition map %d\n",
"partition map %d\n", i); i);
goto out_bh; goto out_bh;
} }
} else { } else {
...@@ -1222,9 +1219,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) ...@@ -1222,9 +1219,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block)
* overwrite blocks instead of relocating them). * overwrite blocks instead of relocating them).
*/ */
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
printk(KERN_NOTICE "UDF-fs: Filesystem marked read-only " pr_notice("Filesystem marked read-only because writing to pseudooverwrite partition is not implemented\n");
"because writing to pseudooverwrite partition is "
"not implemented.\n");
} }
out_bh: out_bh:
/* In case loading failed, we handle cleanup in udf_fill_super */ /* 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,9 +1461,9 @@ static noinline int udf_process_sequence(struct super_block *sb, long block,
bh = udf_read_tagged(sb, block, block, &ident); bh = udf_read_tagged(sb, block, block, &ident);
if (!bh) { if (!bh) {
printk(KERN_ERR "udf: Block %Lu of volume descriptor " udf_err(sb,
"sequence is corrupted or we could not read " "Block %llu of volume descriptor sequence is corrupted or we could not read it\n",
"it.\n", (unsigned long long)block); (unsigned long long)block);
return 1; return 1;
} }
...@@ -1541,7 +1536,7 @@ static noinline int udf_process_sequence(struct super_block *sb, long block, ...@@ -1541,7 +1536,7 @@ static noinline int udf_process_sequence(struct super_block *sb, long block,
* in a suitable order * in a suitable order
*/ */
if (!vds[VDS_POS_PRIMARY_VOL_DESC].block) { if (!vds[VDS_POS_PRIMARY_VOL_DESC].block) {
printk(KERN_ERR "udf: Primary Volume Descriptor not found!\n"); udf_err(sb, "Primary Volume Descriptor not found!\n");
return 1; return 1;
} }
if (udf_load_pvoldesc(sb, vds[VDS_POS_PRIMARY_VOL_DESC].block)) 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,7 +1723,7 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt,
if (!sb_set_blocksize(sb, uopt->blocksize)) { if (!sb_set_blocksize(sb, uopt->blocksize)) {
if (!silent) if (!silent)
printk(KERN_WARNING "UDF-fs: Bad block size\n"); udf_warn(sb, "Bad block size\n");
return 0; return 0;
} }
sbi->s_last_block = uopt->lastblock; sbi->s_last_block = uopt->lastblock;
...@@ -1737,7 +1732,7 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt, ...@@ -1737,7 +1732,7 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt,
nsr_off = udf_check_vsd(sb); nsr_off = udf_check_vsd(sb);
if (!nsr_off) { if (!nsr_off) {
if (!silent) if (!silent)
printk(KERN_WARNING "UDF-fs: No VRS found\n"); udf_warn(sb, "No VRS found\n");
return 0; return 0;
} }
if (nsr_off == -1) if (nsr_off == -1)
...@@ -1753,7 +1748,7 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt, ...@@ -1753,7 +1748,7 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt,
sbi->s_anchor = uopt->anchor; sbi->s_anchor = uopt->anchor;
if (!udf_find_anchor(sb, fileset)) { if (!udf_find_anchor(sb, fileset)) {
if (!silent) if (!silent)
printk(KERN_WARNING "UDF-fs: No anchor found\n"); udf_warn(sb, "No anchor found\n");
return 0; return 0;
} }
return 1; return 1;
...@@ -1974,15 +1969,14 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ...@@ -1974,15 +1969,14 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
ret = udf_load_vrs(sb, &uopt, silent, &fileset); ret = udf_load_vrs(sb, &uopt, silent, &fileset);
if (!ret && uopt.blocksize != UDF_DEFAULT_BLOCKSIZE) { if (!ret && uopt.blocksize != UDF_DEFAULT_BLOCKSIZE) {
if (!silent) if (!silent)
printk(KERN_NOTICE pr_notice("Rescanning with blocksize %d\n",
"UDF-fs: Rescanning with blocksize " UDF_DEFAULT_BLOCKSIZE);
"%d\n", UDF_DEFAULT_BLOCKSIZE);
uopt.blocksize = UDF_DEFAULT_BLOCKSIZE; uopt.blocksize = UDF_DEFAULT_BLOCKSIZE;
ret = udf_load_vrs(sb, &uopt, silent, &fileset); ret = udf_load_vrs(sb, &uopt, silent, &fileset);
} }
} }
if (!ret) { if (!ret) {
printk(KERN_WARNING "UDF-fs: No partition found (1)\n"); udf_warn(sb, "No partition found (1)\n");
goto error_out; goto error_out;
} }
...@@ -1997,10 +1991,9 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ...@@ -1997,10 +1991,9 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
le16_to_cpu(lvidiu->maxUDFWriteRev); */ le16_to_cpu(lvidiu->maxUDFWriteRev); */
if (minUDFReadRev > UDF_MAX_READ_VERSION) { if (minUDFReadRev > UDF_MAX_READ_VERSION) {
printk(KERN_ERR "UDF-fs: minUDFReadRev=%x " udf_err(sb, "minUDFReadRev=%x (max is %x)\n",
"(max is %x)\n", le16_to_cpu(lvidiu->minUDFReadRev),
le16_to_cpu(lvidiu->minUDFReadRev), UDF_MAX_READ_VERSION);
UDF_MAX_READ_VERSION);
goto error_out; goto error_out;
} else if (minUDFWriteRev > UDF_MAX_WRITE_VERSION) } else if (minUDFWriteRev > UDF_MAX_WRITE_VERSION)
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
...@@ -2014,28 +2007,27 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ...@@ -2014,28 +2007,27 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
} }
if (!sbi->s_partitions) { if (!sbi->s_partitions) {
printk(KERN_WARNING "UDF-fs: No partition found (2)\n"); udf_warn(sb, "No partition found (2)\n");
goto error_out; goto error_out;
} }
if (sbi->s_partmaps[sbi->s_partition].s_partition_flags & if (sbi->s_partmaps[sbi->s_partition].s_partition_flags &
UDF_PART_FLAG_READ_ONLY) { UDF_PART_FLAG_READ_ONLY) {
printk(KERN_NOTICE "UDF-fs: Partition marked readonly; " pr_notice("Partition marked readonly; forcing readonly mount\n");
"forcing readonly mount\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
} }
if (udf_find_fileset(sb, &fileset, &rootdir)) { if (udf_find_fileset(sb, &fileset, &rootdir)) {
printk(KERN_WARNING "UDF-fs: No fileset found\n"); udf_warn(sb, "No fileset found\n");
goto error_out; goto error_out;
} }
if (!silent) { if (!silent) {
struct timestamp ts; struct timestamp ts;
udf_time_to_disk_stamp(&ts, sbi->s_record_time); udf_time_to_disk_stamp(&ts, sbi->s_record_time);
udf_info("UDF: Mounting volume '%s', " udf_info("Mounting volume '%s', timestamp %04u/%02u/%02u %02u:%02u (%x)\n",
"timestamp %04u/%02u/%02u %02u:%02u (%x)\n", sbi->s_volume_ident,
sbi->s_volume_ident, le16_to_cpu(ts.year), ts.month, ts.day, le16_to_cpu(ts.year), ts.month, ts.day,
ts.hour, ts.minute, le16_to_cpu(ts.typeAndTimezone)); ts.hour, ts.minute, le16_to_cpu(ts.typeAndTimezone));
} }
if (!(sb->s_flags & MS_RDONLY)) if (!(sb->s_flags & MS_RDONLY))
...@@ -2046,8 +2038,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ...@@ -2046,8 +2038,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
/* perhaps it's not extensible enough, but for now ... */ /* perhaps it's not extensible enough, but for now ... */
inode = udf_iget(sb, &rootdir); inode = udf_iget(sb, &rootdir);
if (!inode) { if (!inode) {
printk(KERN_ERR "UDF-fs: Error in udf_iget, block=%d, " udf_err(sb, "Error in udf_iget, block=%d, partition=%d\n",
"partition=%d\n",
rootdir.logicalBlockNum, rootdir.partitionReferenceNum); rootdir.logicalBlockNum, rootdir.partitionReferenceNum);
goto error_out; goto error_out;
} }
...@@ -2055,7 +2046,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ...@@ -2055,7 +2046,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
/* Allocate a dentry for the root inode */ /* Allocate a dentry for the root inode */
sb->s_root = d_alloc_root(inode); sb->s_root = d_alloc_root(inode);
if (!sb->s_root) { if (!sb->s_root) {
printk(KERN_ERR "UDF-fs: Couldn't allocate root dentry\n"); udf_err(sb, "Couldn't allocate root dentry\n");
iput(inode); iput(inode);
goto error_out; goto error_out;
} }
...@@ -2095,7 +2086,7 @@ void _udf_err(struct super_block *sb, const char *function, ...@@ -2095,7 +2086,7 @@ void _udf_err(struct super_block *sb, const char *function,
va_start(args, fmt); va_start(args, fmt);
vsnprintf(error_buf, sizeof(error_buf), fmt, args); vsnprintf(error_buf, sizeof(error_buf), fmt, args);
va_end(args); va_end(args);
printk(KERN_CRIT "UDF-fs error (device %s): %s: %s", pr_crit("error (device %s): %s: %s",
sb->s_id, function, error_buf); sb->s_id, function, error_buf);
} }
...@@ -2107,7 +2098,7 @@ void _udf_warn(struct super_block *sb, const char *function, ...@@ -2107,7 +2098,7 @@ void _udf_warn(struct super_block *sb, const char *function,
va_start(args, fmt); va_start(args, fmt);
vsnprintf(error_buf, sizeof(error_buf), fmt, args); vsnprintf(error_buf, sizeof(error_buf), fmt, args);
va_end(args); va_end(args);
printk(KERN_WARNING "UDF-fs warning (device %s): %s: %s", pr_warn("warning (device %s): %s: %s",
sb->s_id, function, error_buf); sb->s_id, function, error_buf);
} }
...@@ -2200,11 +2191,11 @@ static unsigned int udf_count_free_bitmap(struct super_block *sb, ...@@ -2200,11 +2191,11 @@ static unsigned int udf_count_free_bitmap(struct super_block *sb,
bh = udf_read_ptagged(sb, &loc, 0, &ident); bh = udf_read_ptagged(sb, &loc, 0, &ident);
if (!bh) { if (!bh) {
printk(KERN_ERR "udf: udf_count_free failed\n"); udf_err(sb, "udf_count_free failed\n");
goto out; goto out;
} else if (ident != TAG_IDENT_SBD) { } else if (ident != TAG_IDENT_SBD) {
brelse(bh); brelse(bh);
printk(KERN_ERR "udf: udf_count_free failed\n"); udf_err(sb, "udf_count_free failed\n");
goto out; goto out;
} }
......
...@@ -95,23 +95,21 @@ void udf_truncate_tail_extent(struct inode *inode) ...@@ -95,23 +95,21 @@ void udf_truncate_tail_extent(struct inode *inode)
lbcount += elen; lbcount += elen;
if (lbcount > inode->i_size) { if (lbcount > inode->i_size) {
if (lbcount - inode->i_size >= inode->i_sb->s_blocksize) if (lbcount - inode->i_size >= inode->i_sb->s_blocksize)
printk(KERN_WARNING udf_warn(inode->i_sb,
"udf_truncate_tail_extent(): Too long " "Too long extent after EOF in inode %u: i_size: %lld lbcount: %lld extent %u+%u\n",
"extent after EOF in inode %u: i_size: " (unsigned)inode->i_ino,
"%Ld lbcount: %Ld extent %u+%u\n", (long long)inode->i_size,
(unsigned)inode->i_ino, (long long)lbcount,
(long long)inode->i_size, (unsigned)eloc.logicalBlockNum,
(long long)lbcount, (unsigned)elen);
(unsigned)eloc.logicalBlockNum,
(unsigned)elen);
nelen = elen - (lbcount - inode->i_size); nelen = elen - (lbcount - inode->i_size);
epos.offset -= adsize; epos.offset -= adsize;
extent_trunc(inode, &epos, &eloc, etype, elen, nelen); extent_trunc(inode, &epos, &eloc, etype, elen, nelen);
epos.offset += adsize; epos.offset += adsize;
if (udf_next_aext(inode, &epos, &eloc, &elen, 1) != -1) if (udf_next_aext(inode, &epos, &eloc, &elen, 1) != -1)
printk(KERN_ERR "udf_truncate_tail_extent(): " udf_err(inode->i_sb,
"Extent after EOF in inode %u.\n", "Extent after EOF in inode %u\n",
(unsigned)inode->i_ino); (unsigned)inode->i_ino);
break; break;
} }
} }
......
#ifndef __UDF_DECL_H #ifndef __UDF_DECL_H
#define __UDF_DECL_H #define __UDF_DECL_H
#define pr_fmt(fmt) "UDF-fs: " fmt
#include "ecma_167.h" #include "ecma_167.h"
#include "osta_udf.h" #include "osta_udf.h"
...@@ -16,18 +18,11 @@ ...@@ -16,18 +18,11 @@
#define UDF_PREALLOCATE #define UDF_PREALLOCATE
#define UDF_DEFAULT_PREALLOC_BLOCKS 8 #define UDF_DEFAULT_PREALLOC_BLOCKS 8
#undef UDFFS_DEBUG __attribute__((format(printf, 3, 4)))
extern void _udf_err(struct super_block *sb, const char *function,
#ifdef UDFFS_DEBUG const char *fmt, ...);
#define udf_debug(f, a...) \ #define udf_err(sb, fmt, ...) \
do { \ _udf_err(sb, __func__, fmt, ##__VA_ARGS__)
printk(KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \
__FILE__, __LINE__, __func__); \
printk(f, ##a); \
} while (0)
#else
#define udf_debug(f, a...) /**/
#endif
__attribute__((format(printf, 3, 4))) __attribute__((format(printf, 3, 4)))
extern void _udf_warn(struct super_block *sb, const char *function, extern void _udf_warn(struct super_block *sb, const char *function,
...@@ -35,14 +30,19 @@ extern void _udf_warn(struct super_block *sb, const char *function, ...@@ -35,14 +30,19 @@ extern void _udf_warn(struct super_block *sb, const char *function,
#define udf_warn(sb, fmt, ...) \ #define udf_warn(sb, fmt, ...) \
_udf_warn(sb, __func__, fmt, ##__VA_ARGS__) _udf_warn(sb, __func__, fmt, ##__VA_ARGS__)
__attribute__((format(printf, 3, 4))) #define udf_info(fmt, ...) \
extern void _udf_err(struct super_block *sb, const char *function, pr_info("INFO " fmt, ##__VA_ARGS__)
const char *fmt, ...);
#define udf_err(sb, fmt, ...) \
_udf_err(sb, __func__, fmt, ##__VA_ARGS__)
#define udf_info(f, a...) \ #undef UDFFS_DEBUG
printk(KERN_INFO "UDF-fs INFO " f, ##a);
#ifdef UDFFS_DEBUG
#define udf_debug(fmt, ...) \
printk(KERN_DEBUG pr_fmt("%s:%d:%s: " fmt), \
__FILE__, __LINE__, __func__, ##__VA_ARGS__)
#else
#define udf_debug(fmt, ...) \
no_printk(fmt, ##__VA_ARGS__)
#endif
#define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) ) #define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) )
#define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) ) #define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) )
......
...@@ -34,9 +34,10 @@ ...@@ -34,9 +34,10 @@
* http://www.boulder.nist.gov/timefreq/pubs/bulletin/leapsecond.htm * http://www.boulder.nist.gov/timefreq/pubs/bulletin/leapsecond.htm
*/ */
#include "udfdecl.h"
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include "udfdecl.h"
#define EPOCH_YEAR 1970 #define EPOCH_YEAR 1970
......
...@@ -114,7 +114,7 @@ int udf_CS0toUTF8(struct ustr *utf_o, const struct ustr *ocu_i) ...@@ -114,7 +114,7 @@ int udf_CS0toUTF8(struct ustr *utf_o, const struct ustr *ocu_i)
cmp_id = ocu_i->u_cmpID; cmp_id = ocu_i->u_cmpID;
if (cmp_id != 8 && cmp_id != 16) { if (cmp_id != 8 && cmp_id != 16) {
memset(utf_o, 0, sizeof(struct ustr)); memset(utf_o, 0, sizeof(struct ustr));
printk(KERN_ERR "udf: unknown compression code (%d) stri=%s\n", pr_err("unknown compression code (%d) stri=%s\n",
cmp_id, ocu_i->u_name); cmp_id, ocu_i->u_name);
return 0; return 0;
} }
...@@ -242,7 +242,7 @@ static int udf_UTF8toCS0(dstring *ocu, struct ustr *utf, int length) ...@@ -242,7 +242,7 @@ static int udf_UTF8toCS0(dstring *ocu, struct ustr *utf, int length)
if (utf_cnt) { if (utf_cnt) {
error_out: error_out:
ocu[++u_len] = '?'; ocu[++u_len] = '?';
printk(KERN_DEBUG "udf: bad UTF-8 character\n"); printk(KERN_DEBUG pr_fmt("bad UTF-8 character\n"));
} }
ocu[length - 1] = (uint8_t)u_len + 1; ocu[length - 1] = (uint8_t)u_len + 1;
...@@ -267,7 +267,7 @@ static int udf_CS0toNLS(struct nls_table *nls, struct ustr *utf_o, ...@@ -267,7 +267,7 @@ static int udf_CS0toNLS(struct nls_table *nls, struct ustr *utf_o,
cmp_id = ocu_i->u_cmpID; cmp_id = ocu_i->u_cmpID;
if (cmp_id != 8 && cmp_id != 16) { if (cmp_id != 8 && cmp_id != 16) {
memset(utf_o, 0, sizeof(struct ustr)); memset(utf_o, 0, sizeof(struct ustr));
printk(KERN_ERR "udf: unknown compression code (%d) stri=%s\n", pr_err("unknown compression code (%d) stri=%s\n",
cmp_id, ocu_i->u_name); cmp_id, ocu_i->u_name);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment