Skip to content

Commit

Permalink
fs/affs: pr_debug cleanup
Browse files Browse the repository at this point in the history
- Remove AFFS: prefix (defined in pr_fmt)

- Use __func__

- Separate format/arguments on lines > 80 characters.

Signed-off-by: Fabian Frederick <[email protected]>
Cc: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Fabian Frederick authored and torvalds committed Jun 6, 2014
1 parent 0158de1 commit 9606d9a
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 59 deletions.
10 changes: 5 additions & 5 deletions fs/affs/affs.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,15 @@ affs_set_blocksize(struct super_block *sb, int size)
static inline struct buffer_head *
affs_bread(struct super_block *sb, int block)
{
pr_debug("affs_bread: %d\n", block);
pr_debug("%s: %d\n", __func__, block);
if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size)
return sb_bread(sb, block);
return NULL;
}
static inline struct buffer_head *
affs_getblk(struct super_block *sb, int block)
{
pr_debug("affs_getblk: %d\n", block);
pr_debug("%s: %d\n", __func__, block);
if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size)
return sb_getblk(sb, block);
return NULL;
Expand All @@ -229,7 +229,7 @@ static inline struct buffer_head *
affs_getzeroblk(struct super_block *sb, int block)
{
struct buffer_head *bh;
pr_debug("affs_getzeroblk: %d\n", block);
pr_debug("%s: %d\n", __func__, block);
if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size) {
bh = sb_getblk(sb, block);
lock_buffer(bh);
Expand All @@ -244,7 +244,7 @@ static inline struct buffer_head *
affs_getemptyblk(struct super_block *sb, int block)
{
struct buffer_head *bh;
pr_debug("affs_getemptyblk: %d\n", block);
pr_debug("%s: %d\n", __func__, block);
if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size) {
bh = sb_getblk(sb, block);
wait_on_buffer(bh);
Expand All @@ -257,7 +257,7 @@ static inline void
affs_brelse(struct buffer_head *bh)
{
if (bh)
pr_debug("affs_brelse: %lld\n", (long long) bh->b_blocknr);
pr_debug("%s: %lld\n", __func__, (long long) bh->b_blocknr);
brelse(bh);
}

Expand Down
9 changes: 5 additions & 4 deletions fs/affs/amigaffs.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ affs_insert_hash(struct inode *dir, struct buffer_head *bh)
ino = bh->b_blocknr;
offset = affs_hash_name(sb, AFFS_TAIL(sb, bh)->name + 1, AFFS_TAIL(sb, bh)->name[0]);

pr_debug("AFFS: insert_hash(dir=%u, ino=%d)\n", (u32)dir->i_ino, ino);
pr_debug("%s(dir=%u, ino=%d)\n", __func__, (u32)dir->i_ino, ino);

dir_bh = affs_bread(sb, dir->i_ino);
if (!dir_bh)
Expand Down Expand Up @@ -84,7 +84,8 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh)
sb = dir->i_sb;
rem_ino = rem_bh->b_blocknr;
offset = affs_hash_name(sb, AFFS_TAIL(sb, rem_bh)->name+1, AFFS_TAIL(sb, rem_bh)->name[0]);
pr_debug("AFFS: remove_hash(dir=%d, ino=%d, hashval=%d)\n", (u32)dir->i_ino, rem_ino, offset);
pr_debug("%s(dir=%d, ino=%d, hashval=%d)\n",
__func__, (u32)dir->i_ino, rem_ino, offset);

bh = affs_bread(sb, dir->i_ino);
if (!bh)
Expand Down Expand Up @@ -147,7 +148,7 @@ affs_remove_link(struct dentry *dentry)
u32 link_ino, ino;
int retval;

pr_debug("AFFS: remove_link(key=%ld)\n", inode->i_ino);
pr_debug("%s(key=%ld)\n", __func__, inode->i_ino);
retval = -EIO;
bh = affs_bread(sb, inode->i_ino);
if (!bh)
Expand Down Expand Up @@ -279,7 +280,7 @@ affs_remove_header(struct dentry *dentry)
if (!inode)
goto done;

pr_debug("AFFS: remove_header(key=%ld)\n", inode->i_ino);
pr_debug("%s(key=%ld)\n", __func__, inode->i_ino);
retval = -EIO;
bh = affs_bread(sb, (u32)(long)dentry->d_fsdata);
if (!bh)
Expand Down
8 changes: 4 additions & 4 deletions fs/affs/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ affs_count_free_blocks(struct super_block *sb)
u32 free;
int i;

pr_debug("AFFS: count_free_blocks()\n");
pr_debug("%s()\n", __func__);

if (sb->s_flags & MS_RDONLY)
return 0;
Expand All @@ -43,7 +43,7 @@ affs_free_block(struct super_block *sb, u32 block)
u32 blk, bmap, bit, mask, tmp;
__be32 *data;

pr_debug("AFFS: free_block(%u)\n", block);
pr_debug("%s(%u)\n", __func__, block);

if (block > sbi->s_partition_size)
goto err_range;
Expand Down Expand Up @@ -125,7 +125,7 @@ affs_alloc_block(struct inode *inode, u32 goal)
sb = inode->i_sb;
sbi = AFFS_SB(sb);

pr_debug("AFFS: balloc(inode=%lu,goal=%u): ", inode->i_ino, goal);
pr_debug("balloc(inode=%lu,goal=%u): ", inode->i_ino, goal);

if (AFFS_I(inode)->i_pa_cnt) {
pr_debug("%d\n", AFFS_I(inode)->i_lastalloc+1);
Expand Down Expand Up @@ -291,7 +291,7 @@ int affs_init_bitmap(struct super_block *sb, int *flags)
*flags |= MS_RDONLY;
goto out;
}
pr_debug("AFFS: read bitmap block %d: %d\n", blk, bm->bm_key);
pr_debug("read bitmap block %d: %d\n", blk, bm->bm_key);
bm->bm_free = memweight(bh->b_data + 4, sb->s_blocksize - 4);

/* Don't try read the extension if this is the last block,
Expand Down
8 changes: 4 additions & 4 deletions fs/affs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ affs_readdir(struct file *file, struct dir_context *ctx)
u32 ino;
int error = 0;

pr_debug("AFFS: readdir(ino=%lu,f_pos=%lx)\n",
inode->i_ino, (unsigned long)ctx->pos);
pr_debug("%s(ino=%lu,f_pos=%lx)\n",
__func__, inode->i_ino, (unsigned long)ctx->pos);

if (ctx->pos < 2) {
file->private_data = (void *)0;
Expand All @@ -81,7 +81,7 @@ affs_readdir(struct file *file, struct dir_context *ctx)
*/
ino = (u32)(long)file->private_data;
if (ino && file->f_version == inode->i_version) {
pr_debug("AFFS: readdir() left off=%d\n", ino);
pr_debug("readdir() left off=%d\n", ino);
goto inside;
}

Expand Down Expand Up @@ -117,7 +117,7 @@ affs_readdir(struct file *file, struct dir_context *ctx)

namelen = min(AFFS_TAIL(sb, fh_bh)->name[0], (u8)30);
name = AFFS_TAIL(sb, fh_bh)->name + 1;
pr_debug("AFFS: readdir(): dir_emit(\"%.*s\", "
pr_debug("readdir(): dir_emit(\"%.*s\", "
"ino=%u), hash=%d, f_pos=%x\n",
namelen, name, ino, hash_pos, (u32)ctx->pos);

Expand Down
24 changes: 14 additions & 10 deletions fs/affs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const struct inode_operations affs_file_inode_operations = {
static int
affs_file_open(struct inode *inode, struct file *filp)
{
pr_debug("AFFS: open(%lu,%d)\n",
pr_debug("open(%lu,%d)\n",
inode->i_ino, atomic_read(&AFFS_I(inode)->i_opencnt));
atomic_inc(&AFFS_I(inode)->i_opencnt);
return 0;
Expand All @@ -54,7 +54,7 @@ affs_file_open(struct inode *inode, struct file *filp)
static int
affs_file_release(struct inode *inode, struct file *filp)
{
pr_debug("AFFS: release(%lu, %d)\n",
pr_debug("release(%lu, %d)\n",
inode->i_ino, atomic_read(&AFFS_I(inode)->i_opencnt));

if (atomic_dec_and_test(&AFFS_I(inode)->i_opencnt)) {
Expand Down Expand Up @@ -324,7 +324,8 @@ affs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh_resul
struct buffer_head *ext_bh;
u32 ext;

pr_debug("AFFS: get_block(%u, %lu)\n", (u32)inode->i_ino, (unsigned long)block);
pr_debug("%s(%u, %lu)\n",
__func__, (u32)inode->i_ino, (unsigned long)block);

BUG_ON(block > (sector_t)0x7fffffffUL);

Expand Down Expand Up @@ -508,7 +509,7 @@ affs_do_readpage_ofs(struct page *page, unsigned to)
u32 bidx, boff, bsize;
u32 tmp;

pr_debug("AFFS: read_page(%u, %ld, 0, %d)\n", (u32)inode->i_ino,
pr_debug("%s(%u, %ld, 0, %d)\n", __func__, (u32)inode->i_ino,
page->index, to);
BUG_ON(to > PAGE_CACHE_SIZE);
kmap(page);
Expand Down Expand Up @@ -544,7 +545,7 @@ affs_extent_file_ofs(struct inode *inode, u32 newsize)
u32 size, bsize;
u32 tmp;

pr_debug("AFFS: extent_file(%u, %d)\n", (u32)inode->i_ino, newsize);
pr_debug("%s(%u, %d)\n", __func__, (u32)inode->i_ino, newsize);
bsize = AFFS_SB(sb)->s_data_blksize;
bh = NULL;
size = AFFS_I(inode)->mmu_private;
Expand Down Expand Up @@ -610,7 +611,7 @@ affs_readpage_ofs(struct file *file, struct page *page)
u32 to;
int err;

pr_debug("AFFS: read_page(%u, %ld)\n", (u32)inode->i_ino, page->index);
pr_debug("%s(%u, %ld)\n", __func__, (u32)inode->i_ino, page->index);
to = PAGE_CACHE_SIZE;
if (((page->index + 1) << PAGE_CACHE_SHIFT) > inode->i_size) {
to = inode->i_size & ~PAGE_CACHE_MASK;
Expand All @@ -633,7 +634,8 @@ static int affs_write_begin_ofs(struct file *file, struct address_space *mapping
pgoff_t index;
int err = 0;

pr_debug("AFFS: write_begin(%u, %llu, %llu)\n", (u32)inode->i_ino, (unsigned long long)pos, (unsigned long long)pos + len);
pr_debug("%s(%u, %llu, %llu)\n", __func__, (u32)inode->i_ino,
(unsigned long long)pos, (unsigned long long)pos + len);
if (pos > AFFS_I(inode)->mmu_private) {
/* XXX: this probably leaves a too-big i_size in case of
* failure. Should really be updating i_size at write_end time
Expand Down Expand Up @@ -682,7 +684,9 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping,
* due to write_begin.
*/

pr_debug("AFFS: write_begin(%u, %llu, %llu)\n", (u32)inode->i_ino, (unsigned long long)pos, (unsigned long long)pos + len);
pr_debug("%s(%u, %llu, %llu)\n",
__func__, (u32)inode->i_ino, (unsigned long long)pos,
(unsigned long long)pos + len);
bsize = AFFS_SB(sb)->s_data_blksize;
data = page_address(page);

Expand Down Expand Up @@ -804,7 +808,7 @@ affs_free_prealloc(struct inode *inode)
{
struct super_block *sb = inode->i_sb;

pr_debug("AFFS: free_prealloc(ino=%lu)\n", inode->i_ino);
pr_debug("free_prealloc(ino=%lu)\n", inode->i_ino);

while (AFFS_I(inode)->i_pa_cnt) {
AFFS_I(inode)->i_pa_cnt--;
Expand All @@ -824,7 +828,7 @@ affs_truncate(struct inode *inode)
struct buffer_head *ext_bh;
int i;

pr_debug("AFFS: truncate(inode=%d, oldsize=%u, newsize=%u)\n",
pr_debug("truncate(inode=%d, oldsize=%u, newsize=%u)\n",
(u32)inode->i_ino, (u32)AFFS_I(inode)->mmu_private, (u32)inode->i_size);

last_blk = 0;
Expand Down
14 changes: 8 additions & 6 deletions fs/affs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino)
if (!(inode->i_state & I_NEW))
return inode;

pr_debug("AFFS: affs_iget(%lu)\n", inode->i_ino);
pr_debug("affs_iget(%lu)\n", inode->i_ino);

block = inode->i_ino;
bh = affs_bread(sb, block);
Expand Down Expand Up @@ -175,7 +175,7 @@ affs_write_inode(struct inode *inode, struct writeback_control *wbc)
uid_t uid;
gid_t gid;

pr_debug("AFFS: write_inode(%lu)\n",inode->i_ino);
pr_debug("write_inode(%lu)\n", inode->i_ino);

if (!inode->i_nlink)
// possibly free block
Expand Down Expand Up @@ -220,7 +220,7 @@ affs_notify_change(struct dentry *dentry, struct iattr *attr)
struct inode *inode = dentry->d_inode;
int error;

pr_debug("AFFS: notify_change(%lu,0x%x)\n",inode->i_ino,attr->ia_valid);
pr_debug("notify_change(%lu,0x%x)\n", inode->i_ino, attr->ia_valid);

error = inode_change_ok(inode,attr);
if (error)
Expand Down Expand Up @@ -258,7 +258,8 @@ void
affs_evict_inode(struct inode *inode)
{
unsigned long cache_page;
pr_debug("AFFS: evict_inode(ino=%lu, nlink=%u)\n", inode->i_ino, inode->i_nlink);
pr_debug("evict_inode(ino=%lu, nlink=%u)\n",
inode->i_ino, inode->i_nlink);
truncate_inode_pages_final(&inode->i_data);

if (!inode->i_nlink) {
Expand All @@ -271,7 +272,7 @@ affs_evict_inode(struct inode *inode)
affs_free_prealloc(inode);
cache_page = (unsigned long)AFFS_I(inode)->i_lc;
if (cache_page) {
pr_debug("AFFS: freeing ext cache\n");
pr_debug("freeing ext cache\n");
AFFS_I(inode)->i_lc = NULL;
AFFS_I(inode)->i_ac = NULL;
free_page(cache_page);
Expand Down Expand Up @@ -350,7 +351,8 @@ affs_add_entry(struct inode *dir, struct inode *inode, struct dentry *dentry, s3
u32 block = 0;
int retval;

pr_debug("AFFS: add_entry(dir=%u, inode=%u, \"%*s\", type=%d)\n", (u32)dir->i_ino,
pr_debug("%s(dir=%u, inode=%u, \"%*s\", type=%d)\n",
__func__, (u32)dir->i_ino,
(u32)inode->i_ino, (int)dentry->d_name.len, dentry->d_name.name, type);

retval = -EIO;
Expand Down
39 changes: 23 additions & 16 deletions fs/affs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ affs_find_entry(struct inode *dir, struct dentry *dentry)
toupper_t toupper = affs_get_toupper(sb);
u32 key;

pr_debug("AFFS: find_entry(\"%.*s\")\n", (int)dentry->d_name.len, dentry->d_name.name);
pr_debug("%s(\"%.*s\")\n",
__func__, (int)dentry->d_name.len, dentry->d_name.name);

bh = affs_bread(sb, dir->i_ino);
if (!bh)
Expand Down Expand Up @@ -218,7 +219,8 @@ affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
struct buffer_head *bh;
struct inode *inode = NULL;

pr_debug("AFFS: lookup(\"%.*s\")\n",(int)dentry->d_name.len,dentry->d_name.name);
pr_debug("%s(\"%.*s\")\n",
__func__, (int)dentry->d_name.len, dentry->d_name.name);

affs_lock_dir(dir);
bh = affs_find_entry(dir, dentry);
Expand Down Expand Up @@ -248,9 +250,9 @@ affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
int
affs_unlink(struct inode *dir, struct dentry *dentry)
{
pr_debug("AFFS: unlink(dir=%d, %lu \"%.*s\")\n", (u32)dir->i_ino,
dentry->d_inode->i_ino,
(int)dentry->d_name.len, dentry->d_name.name);
pr_debug("%s(dir=%d, %lu \"%.*s\")\n",
__func__, (u32)dir->i_ino, dentry->d_inode->i_ino,
(int)dentry->d_name.len, dentry->d_name.name);

return affs_remove_header(dentry);
}
Expand All @@ -262,7 +264,8 @@ affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl)
struct inode *inode;
int error;

pr_debug("AFFS: create(%lu,\"%.*s\",0%ho)\n",dir->i_ino,(int)dentry->d_name.len,
pr_debug("%s(%lu,\"%.*s\",0%ho)\n",
__func__, dir->i_ino, (int)dentry->d_name.len,
dentry->d_name.name,mode);

inode = affs_new_inode(dir);
Expand Down Expand Up @@ -291,8 +294,9 @@ affs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
struct inode *inode;
int error;

pr_debug("AFFS: mkdir(%lu,\"%.*s\",0%ho)\n",dir->i_ino,
(int)dentry->d_name.len,dentry->d_name.name,mode);
pr_debug("%s(%lu,\"%.*s\",0%ho)\n",
__func__, dir->i_ino, (int)dentry->d_name.len,
dentry->d_name.name, mode);

inode = affs_new_inode(dir);
if (!inode)
Expand All @@ -317,8 +321,8 @@ affs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
int
affs_rmdir(struct inode *dir, struct dentry *dentry)
{
pr_debug("AFFS: rmdir(dir=%u, %lu \"%.*s\")\n", (u32)dir->i_ino,
dentry->d_inode->i_ino,
pr_debug("%s(dir=%u, %lu \"%.*s\")\n",
__func__, (u32)dir->i_ino, dentry->d_inode->i_ino,
(int)dentry->d_name.len, dentry->d_name.name);

return affs_remove_header(dentry);
Expand All @@ -334,8 +338,9 @@ affs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
int i, maxlen, error;
char c, lc;

pr_debug("AFFS: symlink(%lu,\"%.*s\" -> \"%s\")\n",dir->i_ino,
(int)dentry->d_name.len,dentry->d_name.name,symname);
pr_debug("%s(%lu,\"%.*s\" -> \"%s\")\n",
__func__, dir->i_ino, (int)dentry->d_name.len,
dentry->d_name.name, symname);

maxlen = AFFS_SB(sb)->s_hashsize * sizeof(u32) - 1;
inode = affs_new_inode(dir);
Expand Down Expand Up @@ -404,7 +409,8 @@ affs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
{
struct inode *inode = old_dentry->d_inode;

pr_debug("AFFS: link(%u, %u, \"%.*s\")\n", (u32)inode->i_ino, (u32)dir->i_ino,
pr_debug("%s(%u, %u, \"%.*s\")\n",
__func__, (u32)inode->i_ino, (u32)dir->i_ino,
(int)dentry->d_name.len,dentry->d_name.name);

return affs_add_entry(dir, inode, dentry, ST_LINKFILE);
Expand All @@ -418,9 +424,10 @@ affs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct buffer_head *bh = NULL;
int retval;

pr_debug("AFFS: rename(old=%u,\"%*s\" to new=%u,\"%*s\")\n",
(u32)old_dir->i_ino, (int)old_dentry->d_name.len, old_dentry->d_name.name,
(u32)new_dir->i_ino, (int)new_dentry->d_name.len, new_dentry->d_name.name);
pr_debug("%s(old=%u,\"%*s\" to new=%u,\"%*s\")\n",
__func__, (u32)old_dir->i_ino, (int)old_dentry->d_name.len,
old_dentry->d_name.name, (u32)new_dir->i_ino,
(int)new_dentry->d_name.len, new_dentry->d_name.name);

retval = affs_check_name(new_dentry->d_name.name,
new_dentry->d_name.len,
Expand Down
Loading

0 comments on commit 9606d9a

Please sign in to comment.