aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2005-06-30 05:59:05 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-30 11:45:12 -0400
commit8cb681b9c7fff5cb35b5c05ba4f1b7e285e258fb (patch)
treeaf1985fb5aaff49de369c5a0665c63b5e271e77f /fs
parent1d2cc3b87b1694df72ab75cee8e12f8b369577ce (diff)
[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: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/freevxfs/vxfs_bmap.c2
-rw-r--r--fs/freevxfs/vxfs_lookup.c8
-rw-r--r--fs/freevxfs/vxfs_olt.c10
-rw-r--r--fs/freevxfs/vxfs_super.c7
4 files changed, 13 insertions, 14 deletions
diff --git a/fs/freevxfs/vxfs_bmap.c b/fs/freevxfs/vxfs_bmap.c
index bc4b57da306a..d3f6b2835bc8 100644
--- a/fs/freevxfs/vxfs_bmap.c
+++ b/fs/freevxfs/vxfs_bmap.c
@@ -101,7 +101,7 @@ vxfs_bmap_ext4(struct inode *ip, long bn)
101 return 0; 101 return 0;
102 102
103fail_size: 103fail_size:
104 printk("vxfs: indirect extent to big!\n"); 104 printk("vxfs: indirect extent too big!\n");
105fail_buf: 105fail_buf:
106 return 0; 106 return 0;
107} 107}
diff --git a/fs/freevxfs/vxfs_lookup.c b/fs/freevxfs/vxfs_lookup.c
index 506ae251d2c0..554eb455722c 100644
--- a/fs/freevxfs/vxfs_lookup.c
+++ b/fs/freevxfs/vxfs_lookup.c
@@ -61,13 +61,13 @@ struct file_operations vxfs_dir_operations = {
61}; 61};
62 62
63 63
64static __inline__ u_long 64static inline u_long
65dir_pages(struct inode *inode) 65dir_pages(struct inode *inode)
66{ 66{
67 return (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 67 return (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
68} 68}
69 69
70static __inline__ u_long 70static inline u_long
71dir_blocks(struct inode *ip) 71dir_blocks(struct inode *ip)
72{ 72{
73 u_long bsize = ip->i_sb->s_blocksize; 73 u_long bsize = ip->i_sb->s_blocksize;
@@ -79,7 +79,7 @@ dir_blocks(struct inode *ip)
79 * 79 *
80 * len <= VXFS_NAMELEN and de != NULL are guaranteed by caller. 80 * len <= VXFS_NAMELEN and de != NULL are guaranteed by caller.
81 */ 81 */
82static __inline__ int 82static inline int
83vxfs_match(int len, const char * const name, struct vxfs_direct *de) 83vxfs_match(int len, const char * const name, struct vxfs_direct *de)
84{ 84{
85 if (len != de->d_namelen) 85 if (len != de->d_namelen)
@@ -89,7 +89,7 @@ vxfs_match(int len, const char * const name, struct vxfs_direct *de)
89 return !memcmp(name, de->d_name, len); 89 return !memcmp(name, de->d_name, len);
90} 90}
91 91
92static __inline__ struct vxfs_direct * 92static inline struct vxfs_direct *
93vxfs_next_entry(struct vxfs_direct *de) 93vxfs_next_entry(struct vxfs_direct *de)
94{ 94{
95 return ((struct vxfs_direct *)((char*)de + de->d_reclen)); 95 return ((struct vxfs_direct *)((char*)de + de->d_reclen));
diff --git a/fs/freevxfs/vxfs_olt.c b/fs/freevxfs/vxfs_olt.c
index 7a204e31aad9..133476201d84 100644
--- a/fs/freevxfs/vxfs_olt.c
+++ b/fs/freevxfs/vxfs_olt.c
@@ -38,7 +38,7 @@
38#include "vxfs_olt.h" 38#include "vxfs_olt.h"
39 39
40 40
41static __inline__ void 41static inline void
42vxfs_get_fshead(struct vxfs_oltfshead *fshp, struct vxfs_sb_info *infp) 42vxfs_get_fshead(struct vxfs_oltfshead *fshp, struct vxfs_sb_info *infp)
43{ 43{
44 if (infp->vsi_fshino) 44 if (infp->vsi_fshino)
@@ -46,7 +46,7 @@ vxfs_get_fshead(struct vxfs_oltfshead *fshp, struct vxfs_sb_info *infp)
46 infp->vsi_fshino = fshp->olt_fsino[0]; 46 infp->vsi_fshino = fshp->olt_fsino[0];
47} 47}
48 48
49static __inline__ void 49static inline void
50vxfs_get_ilist(struct vxfs_oltilist *ilistp, struct vxfs_sb_info *infp) 50vxfs_get_ilist(struct vxfs_oltilist *ilistp, struct vxfs_sb_info *infp)
51{ 51{
52 if (infp->vsi_iext) 52 if (infp->vsi_iext)
@@ -54,7 +54,7 @@ vxfs_get_ilist(struct vxfs_oltilist *ilistp, struct vxfs_sb_info *infp)
54 infp->vsi_iext = ilistp->olt_iext[0]; 54 infp->vsi_iext = ilistp->olt_iext[0];
55} 55}
56 56
57static __inline__ u_long 57static inline u_long
58vxfs_oblock(struct super_block *sbp, daddr_t block, u_long bsize) 58vxfs_oblock(struct super_block *sbp, daddr_t block, u_long bsize)
59{ 59{
60 if (sbp->s_blocksize % bsize) 60 if (sbp->s_blocksize % bsize)
@@ -104,8 +104,8 @@ vxfs_read_olt(struct super_block *sbp, u_long bsize)
104 goto fail; 104 goto fail;
105 } 105 }
106 106
107 oaddr = (char *)bp->b_data + op->olt_size; 107 oaddr = bp->b_data + op->olt_size;
108 eaddr = (char *)bp->b_data + (infp->vsi_oltsize * sbp->s_blocksize); 108 eaddr = bp->b_data + (infp->vsi_oltsize * sbp->s_blocksize);
109 109
110 while (oaddr < eaddr) { 110 while (oaddr < eaddr) {
111 struct vxfs_oltcommon *ocp = 111 struct vxfs_oltcommon *ocp =
diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c
index 0ae2c7b8182a..27f66d3e8a04 100644
--- a/fs/freevxfs/vxfs_super.c
+++ b/fs/freevxfs/vxfs_super.c
@@ -155,12 +155,11 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
155 155
156 sbp->s_flags |= MS_RDONLY; 156 sbp->s_flags |= MS_RDONLY;
157 157
158 infp = kmalloc(sizeof(*infp), GFP_KERNEL); 158 infp = kcalloc(1, sizeof(*infp), GFP_KERNEL);
159 if (!infp) { 159 if (!infp) {
160 printk(KERN_WARNING "vxfs: unable to allocate incore superblock\n"); 160 printk(KERN_WARNING "vxfs: unable to allocate incore superblock\n");
161 return -ENOMEM; 161 return -ENOMEM;
162 } 162 }
163 memset(infp, 0, sizeof(*infp));
164 163
165 bsize = sb_min_blocksize(sbp, BLOCK_SIZE); 164 bsize = sb_min_blocksize(sbp, BLOCK_SIZE);
166 if (!bsize) { 165 if (!bsize) {
@@ -196,7 +195,7 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
196#endif 195#endif
197 196
198 sbp->s_magic = rsbp->vs_magic; 197 sbp->s_magic = rsbp->vs_magic;
199 sbp->s_fs_info = (void *)infp; 198 sbp->s_fs_info = infp;
200 199
201 infp->vsi_raw = rsbp; 200 infp->vsi_raw = rsbp;
202 infp->vsi_bp = bp; 201 infp->vsi_bp = bp;
@@ -263,7 +262,7 @@ vxfs_init(void)
263 sizeof(struct vxfs_inode_info), 0, 262 sizeof(struct vxfs_inode_info), 0,
264 SLAB_RECLAIM_ACCOUNT, NULL, NULL); 263 SLAB_RECLAIM_ACCOUNT, NULL, NULL);
265 if (vxfs_inode_cachep) 264 if (vxfs_inode_cachep)
266 return (register_filesystem(&vxfs_fs_type)); 265 return register_filesystem(&vxfs_fs_type);
267 return -ENOMEM; 266 return -ENOMEM;
268} 267}
269 268