summaryrefslogtreecommitdiffstats
path: root/fs/erofs/zmap.c
diff options
context:
space:
mode:
authorGao Xiang <gaoxiang25@huawei.com>2019-09-04 10:09:09 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-05 20:10:09 +0200
commit4f761fa253b49f657de7ef6f695a124e08e56c3a (patch)
tree84d1dc58a8c8f20a77bfe9994fbf3b08b363f333 /fs/erofs/zmap.c
parent84947eb603719f87ec91f0ba23126e40de7a268a (diff)
downloadlinux-4f761fa253b49f657de7ef6f695a124e08e56c3a.tar.gz
linux-4f761fa253b49f657de7ef6f695a124e08e56c3a.tar.bz2
linux-4f761fa253b49f657de7ef6f695a124e08e56c3a.zip
erofs: rename errln/infoln/debugln to erofs_{err, info, dbg}
Add prefix "erofs_" to these functions and print sb->s_id as a prefix to erofs_{err, info} so that the user knows which file system is affected. Reported-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com> Link: https://lore.kernel.org/r/20190904020912.63925-23-gaoxiang25@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/erofs/zmap.c')
-rw-r--r--fs/erofs/zmap.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/fs/erofs/zmap.c b/fs/erofs/zmap.c
index 9c141f145508..6a26c293ae2d 100644
--- a/fs/erofs/zmap.c
+++ b/fs/erofs/zmap.c
@@ -64,8 +64,8 @@ static int fill_inode_lazy(struct inode *inode)
vi->z_algorithmtype[1] = h->h_algorithmtype >> 4;
if (vi->z_algorithmtype[0] >= Z_EROFS_COMPRESSION_MAX) {
- errln("unknown compression format %u for nid %llu, please upgrade kernel",
- vi->z_algorithmtype[0], vi->nid);
+ erofs_err(sb, "unknown compression format %u for nid %llu, please upgrade kernel",
+ vi->z_algorithmtype[0], vi->nid);
err = -EOPNOTSUPP;
goto unmap_done;
}
@@ -75,8 +75,8 @@ static int fill_inode_lazy(struct inode *inode)
((h->h_clusterbits >> 3) & 3);
if (vi->z_physical_clusterbits[0] != LOG_BLOCK_SIZE) {
- errln("unsupported physical clusterbits %u for nid %llu, please upgrade kernel",
- vi->z_physical_clusterbits[0], vi->nid);
+ erofs_err(sb, "unsupported physical clusterbits %u for nid %llu, please upgrade kernel",
+ vi->z_physical_clusterbits[0], vi->nid);
err = -EOPNOTSUPP;
goto unmap_done;
}
@@ -335,7 +335,8 @@ static int vle_extent_lookback(struct z_erofs_maprecorder *m,
int err;
if (lcn < lookback_distance) {
- errln("bogus lookback distance @ nid %llu", vi->nid);
+ erofs_err(m->inode->i_sb,
+ "bogus lookback distance @ nid %llu", vi->nid);
DBG_BUGON(1);
return -EFSCORRUPTED;
}
@@ -349,8 +350,9 @@ static int vle_extent_lookback(struct z_erofs_maprecorder *m,
switch (m->type) {
case Z_EROFS_VLE_CLUSTER_TYPE_NONHEAD:
if (!m->delta[0]) {
- errln("invalid lookback distance 0 at nid %llu",
- vi->nid);
+ erofs_err(m->inode->i_sb,
+ "invalid lookback distance 0 @ nid %llu",
+ vi->nid);
DBG_BUGON(1);
return -EFSCORRUPTED;
}
@@ -362,8 +364,9 @@ static int vle_extent_lookback(struct z_erofs_maprecorder *m,
map->m_la = (lcn << lclusterbits) | m->clusterofs;
break;
default:
- errln("unknown type %u at lcn %lu of nid %llu",
- m->type, lcn, vi->nid);
+ erofs_err(m->inode->i_sb,
+ "unknown type %u @ lcn %lu of nid %llu",
+ m->type, lcn, vi->nid);
DBG_BUGON(1);
return -EOPNOTSUPP;
}
@@ -421,8 +424,9 @@ int z_erofs_map_blocks_iter(struct inode *inode,
}
/* m.lcn should be >= 1 if endoff < m.clusterofs */
if (!m.lcn) {
- errln("invalid logical cluster 0 at nid %llu",
- vi->nid);
+ erofs_err(inode->i_sb,
+ "invalid logical cluster 0 at nid %llu",
+ vi->nid);
err = -EFSCORRUPTED;
goto unmap_out;
}
@@ -437,8 +441,9 @@ int z_erofs_map_blocks_iter(struct inode *inode,
goto unmap_out;
break;
default:
- errln("unknown type %u at offset %llu of nid %llu",
- m.type, ofs, vi->nid);
+ erofs_err(inode->i_sb,
+ "unknown type %u @ offset %llu of nid %llu",
+ m.type, ofs, vi->nid);
err = -EOPNOTSUPP;
goto unmap_out;
}
@@ -453,9 +458,9 @@ unmap_out:
kunmap_atomic(m.kaddr);
out:
- debugln("%s, m_la %llu m_pa %llu m_llen %llu m_plen %llu m_flags 0%o",
- __func__, map->m_la, map->m_pa,
- map->m_llen, map->m_plen, map->m_flags);
+ erofs_dbg("%s, m_la %llu m_pa %llu m_llen %llu m_plen %llu m_flags 0%o",
+ __func__, map->m_la, map->m_pa,
+ map->m_llen, map->m_plen, map->m_flags);
trace_z_erofs_map_blocks_iter_exit(inode, map, flags, err);