Commit 8cb681b9 authored by Pekka Enberg's avatar Pekka Enberg Committed by Linus Torvalds
Browse files

[PATCH] freevxfs: minor cleanups



This patch addresses the following minor issues:

  - Typo in printk
  - Redundant casts
  - Use C99 struct initializers instead of memset
  - Parenthesis around return value
  - Use inline instead of __inline__
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1d2cc3b8
...@@ -101,7 +101,7 @@ vxfs_bmap_ext4(struct inode *ip, long bn) ...@@ -101,7 +101,7 @@ vxfs_bmap_ext4(struct inode *ip, long bn)
return 0; return 0;
fail_size: fail_size:
printk("vxfs: indirect extent to big!\n"); printk("vxfs: indirect extent too big!\n");
fail_buf: fail_buf:
return 0; return 0;
} }
......
...@@ -61,13 +61,13 @@ struct file_operations vxfs_dir_operations = { ...@@ -61,13 +61,13 @@ struct file_operations vxfs_dir_operations = {
}; };
static __inline__ u_long static inline u_long
dir_pages(struct inode *inode) dir_pages(struct inode *inode)
{ {
return (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; return (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
} }
static __inline__ u_long static inline u_long
dir_blocks(struct inode *ip) dir_blocks(struct inode *ip)
{ {
u_long bsize = ip->i_sb->s_blocksize; u_long bsize = ip->i_sb->s_blocksize;
...@@ -79,7 +79,7 @@ dir_blocks(struct inode *ip) ...@@ -79,7 +79,7 @@ dir_blocks(struct inode *ip)
* *
* len <= VXFS_NAMELEN and de != NULL are guaranteed by caller. * len <= VXFS_NAMELEN and de != NULL are guaranteed by caller.
*/ */
static __inline__ int static inline int
vxfs_match(int len, const char * const name, struct vxfs_direct *de) vxfs_match(int len, const char * const name, struct vxfs_direct *de)
{ {
if (len != de->d_namelen) if (len != de->d_namelen)
...@@ -89,7 +89,7 @@ vxfs_match(int len, const char * const name, struct vxfs_direct *de) ...@@ -89,7 +89,7 @@ vxfs_match(int len, const char * const name, struct vxfs_direct *de)
return !memcmp(name, de->d_name, len); return !memcmp(name, de->d_name, len);
} }
static __inline__ struct vxfs_direct * static inline struct vxfs_direct *
vxfs_next_entry(struct vxfs_direct *de) vxfs_next_entry(struct vxfs_direct *de)
{ {
return ((struct vxfs_direct *)((char*)de + de->d_reclen)); return ((struct vxfs_direct *)((char*)de + de->d_reclen));
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "vxfs_olt.h" #include "vxfs_olt.h"
static __inline__ void static inline void
vxfs_get_fshead(struct vxfs_oltfshead *fshp, struct vxfs_sb_info *infp) vxfs_get_fshead(struct vxfs_oltfshead *fshp, struct vxfs_sb_info *infp)
{ {
if (infp->vsi_fshino) if (infp->vsi_fshino)
...@@ -46,7 +46,7 @@ vxfs_get_fshead(struct vxfs_oltfshead *fshp, struct vxfs_sb_info *infp) ...@@ -46,7 +46,7 @@ vxfs_get_fshead(struct vxfs_oltfshead *fshp, struct vxfs_sb_info *infp)
infp->vsi_fshino = fshp->olt_fsino[0]; infp->vsi_fshino = fshp->olt_fsino[0];
} }
static __inline__ void static inline void
vxfs_get_ilist(struct vxfs_oltilist *ilistp, struct vxfs_sb_info *infp) vxfs_get_ilist(struct vxfs_oltilist *ilistp, struct vxfs_sb_info *infp)
{ {
if (infp->vsi_iext) if (infp->vsi_iext)
...@@ -54,7 +54,7 @@ vxfs_get_ilist(struct vxfs_oltilist *ilistp, struct vxfs_sb_info *infp) ...@@ -54,7 +54,7 @@ vxfs_get_ilist(struct vxfs_oltilist *ilistp, struct vxfs_sb_info *infp)
infp->vsi_iext = ilistp->olt_iext[0]; infp->vsi_iext = ilistp->olt_iext[0];
} }
static __inline__ u_long static inline u_long
vxfs_oblock(struct super_block *sbp, daddr_t block, u_long bsize) vxfs_oblock(struct super_block *sbp, daddr_t block, u_long bsize)
{ {
if (sbp->s_blocksize % bsize) if (sbp->s_blocksize % bsize)
...@@ -104,8 +104,8 @@ vxfs_read_olt(struct super_block *sbp, u_long bsize) ...@@ -104,8 +104,8 @@ vxfs_read_olt(struct super_block *sbp, u_long bsize)
goto fail; goto fail;
} }
oaddr = (char *)bp->b_data + op->olt_size; oaddr = bp->b_data + op->olt_size;
eaddr = (char *)bp->b_data + (infp->vsi_oltsize * sbp->s_blocksize); eaddr = bp->b_data + (infp->vsi_oltsize * sbp->s_blocksize);
while (oaddr < eaddr) { while (oaddr < eaddr) {
struct vxfs_oltcommon *ocp = struct vxfs_oltcommon *ocp =
......
...@@ -155,12 +155,11 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent) ...@@ -155,12 +155,11 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
sbp->s_flags |= MS_RDONLY; sbp->s_flags |= MS_RDONLY;
infp = kmalloc(sizeof(*infp), GFP_KERNEL); infp = kcalloc(1, sizeof(*infp), GFP_KERNEL);
if (!infp) { if (!infp) {
printk(KERN_WARNING "vxfs: unable to allocate incore superblock\n"); printk(KERN_WARNING "vxfs: unable to allocate incore superblock\n");
return -ENOMEM; return -ENOMEM;
} }
memset(infp, 0, sizeof(*infp));
bsize = sb_min_blocksize(sbp, BLOCK_SIZE); bsize = sb_min_blocksize(sbp, BLOCK_SIZE);
if (!bsize) { if (!bsize) {
...@@ -196,7 +195,7 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent) ...@@ -196,7 +195,7 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
#endif #endif
sbp->s_magic = rsbp->vs_magic; sbp->s_magic = rsbp->vs_magic;
sbp->s_fs_info = (void *)infp; sbp->s_fs_info = infp;
infp->vsi_raw = rsbp; infp->vsi_raw = rsbp;
infp->vsi_bp = bp; infp->vsi_bp = bp;
...@@ -263,7 +262,7 @@ vxfs_init(void) ...@@ -263,7 +262,7 @@ vxfs_init(void)
sizeof(struct vxfs_inode_info), 0, sizeof(struct vxfs_inode_info), 0,
SLAB_RECLAIM_ACCOUNT, NULL, NULL); SLAB_RECLAIM_ACCOUNT, NULL, NULL);
if (vxfs_inode_cachep) if (vxfs_inode_cachep)
return (register_filesystem(&vxfs_fs_type)); return register_filesystem(&vxfs_fs_type);
return -ENOMEM; return -ENOMEM;
} }
......
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