Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: change some error-less functions to void types

There are several functions which have no opportunity to return
an error, and don't contain any ASSERTs which could be argued
to be better constructed as error cases. So, make them voids
to simplify the callers.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>

authored by

Eric Sandeen and committed by
Darrick J. Wong
91083269 75efa57d

+26 -58
+1 -3
fs/xfs/libxfs/xfs_dquot_buf.c
··· 110 110 /* 111 111 * Do some primitive error checking on ondisk dquot data structures. 112 112 */ 113 - int 113 + void 114 114 xfs_dqblk_repair( 115 115 struct xfs_mount *mp, 116 116 struct xfs_dqblk *dqb, ··· 133 133 xfs_update_cksum((char *)dqb, sizeof(struct xfs_dqblk), 134 134 XFS_DQUOT_CRC_OFF); 135 135 } 136 - 137 - return 0; 138 136 } 139 137 140 138 STATIC bool
+1 -1
fs/xfs/libxfs/xfs_quota_defs.h
··· 142 142 extern xfs_failaddr_t xfs_dqblk_verify(struct xfs_mount *mp, 143 143 struct xfs_dqblk *dqb, xfs_dqid_t id, uint type); 144 144 extern int xfs_calc_dquots_per_chunk(unsigned int nbblks); 145 - extern int xfs_dqblk_repair(struct xfs_mount *mp, struct xfs_dqblk *dqb, 145 + extern void xfs_dqblk_repair(struct xfs_mount *mp, struct xfs_dqblk *dqb, 146 146 xfs_dqid_t id, uint type); 147 147 148 148 #endif /* __XFS_QUOTA_H__ */
+5 -7
fs/xfs/libxfs/xfs_sb.c
··· 1085 1085 return error; 1086 1086 } 1087 1087 1088 - int 1088 + void 1089 1089 xfs_fs_geometry( 1090 1090 struct xfs_sb *sbp, 1091 1091 struct xfs_fsop_geom *geo, ··· 1109 1109 memcpy(geo->uuid, &sbp->sb_uuid, sizeof(sbp->sb_uuid)); 1110 1110 1111 1111 if (struct_version < 2) 1112 - return 0; 1112 + return; 1113 1113 1114 1114 geo->sunit = sbp->sb_unit; 1115 1115 geo->swidth = sbp->sb_width; 1116 1116 1117 1117 if (struct_version < 3) 1118 - return 0; 1118 + return; 1119 1119 1120 1120 geo->version = XFS_FSOP_GEOM_VERSION; 1121 1121 geo->flags = XFS_FSOP_GEOM_FLAGS_NLINK | ··· 1159 1159 geo->dirblocksize = xfs_dir2_dirblock_bytes(sbp); 1160 1160 1161 1161 if (struct_version < 4) 1162 - return 0; 1162 + return; 1163 1163 1164 1164 if (xfs_sb_version_haslogv2(sbp)) 1165 1165 geo->flags |= XFS_FSOP_GEOM_FLAGS_LOGV2; ··· 1167 1167 geo->logsunit = sbp->sb_logsunit; 1168 1168 1169 1169 if (struct_version < 5) 1170 - return 0; 1170 + return; 1171 1171 1172 1172 geo->version = XFS_FSOP_GEOM_VERSION_V5; 1173 - 1174 - return 0; 1175 1173 } 1176 1174 1177 1175 /* Read a secondary superblock. */
+1 -1
fs/xfs/libxfs/xfs_sb.h
··· 33 33 extern int xfs_update_secondary_sbs(struct xfs_mount *mp); 34 34 35 35 #define XFS_FS_GEOM_MAX_STRUCT_VER (4) 36 - extern int xfs_fs_geometry(struct xfs_sb *sbp, struct xfs_fsop_geom *geo, 36 + extern void xfs_fs_geometry(struct xfs_sb *sbp, struct xfs_fsop_geom *geo, 37 37 int struct_version); 38 38 extern int xfs_sb_read_secondary(struct xfs_mount *mp, 39 39 struct xfs_trans *tp, xfs_agnumber_t agno,
+1 -2
fs/xfs/xfs_fsops.c
··· 289 289 * exported through ioctl XFS_IOC_FSCOUNTS 290 290 */ 291 291 292 - int 292 + void 293 293 xfs_fs_counts( 294 294 xfs_mount_t *mp, 295 295 xfs_fsop_counts_t *cnt) ··· 302 302 spin_lock(&mp->m_sb_lock); 303 303 cnt->freertx = mp->m_sb.sb_frextents; 304 304 spin_unlock(&mp->m_sb_lock); 305 - return 0; 306 305 } 307 306 308 307 /*
+1 -1
fs/xfs/xfs_fsops.h
··· 8 8 9 9 extern int xfs_growfs_data(xfs_mount_t *mp, xfs_growfs_data_t *in); 10 10 extern int xfs_growfs_log(xfs_mount_t *mp, xfs_growfs_log_t *in); 11 - extern int xfs_fs_counts(xfs_mount_t *mp, xfs_fsop_counts_t *cnt); 11 + extern void xfs_fs_counts(xfs_mount_t *mp, xfs_fsop_counts_t *cnt); 12 12 extern int xfs_reserve_blocks(xfs_mount_t *mp, uint64_t *inval, 13 13 xfs_fsop_resblks_t *outval); 14 14 extern int xfs_fs_goingdown(xfs_mount_t *mp, uint32_t inflags);
+7 -20
fs/xfs/xfs_inode.c
··· 1116 1116 /* 1117 1117 * Increment the link count on an inode & log the change. 1118 1118 */ 1119 - static int 1119 + static void 1120 1120 xfs_bumplink( 1121 1121 xfs_trans_t *tp, 1122 1122 xfs_inode_t *ip) ··· 1126 1126 ASSERT(ip->i_d.di_version > 1); 1127 1127 inc_nlink(VFS_I(ip)); 1128 1128 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); 1129 - return 0; 1130 1129 } 1131 1130 1132 1131 int ··· 1234 1235 if (error) 1235 1236 goto out_trans_cancel; 1236 1237 1237 - error = xfs_bumplink(tp, dp); 1238 - if (error) 1239 - goto out_trans_cancel; 1238 + xfs_bumplink(tp, dp); 1240 1239 } 1241 1240 1242 1241 /* ··· 1451 1454 xfs_trans_ichgtime(tp, tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); 1452 1455 xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE); 1453 1456 1454 - error = xfs_bumplink(tp, sip); 1455 - if (error) 1456 - goto error_return; 1457 + xfs_bumplink(tp, sip); 1457 1458 1458 1459 /* 1459 1460 * If this is a synchronous mount, make sure that the ··· 3092 3097 error = xfs_droplink(tp, dp2); 3093 3098 if (error) 3094 3099 goto out_trans_abort; 3095 - error = xfs_bumplink(tp, dp1); 3096 - if (error) 3097 - goto out_trans_abort; 3100 + xfs_bumplink(tp, dp1); 3098 3101 } 3099 3102 3100 3103 /* ··· 3116 3123 error = xfs_droplink(tp, dp1); 3117 3124 if (error) 3118 3125 goto out_trans_abort; 3119 - error = xfs_bumplink(tp, dp2); 3120 - if (error) 3121 - goto out_trans_abort; 3126 + xfs_bumplink(tp, dp2); 3122 3127 } 3123 3128 3124 3129 /* ··· 3313 3322 XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); 3314 3323 3315 3324 if (new_parent && src_is_directory) { 3316 - error = xfs_bumplink(tp, target_dp); 3317 - if (error) 3318 - goto out_trans_cancel; 3325 + xfs_bumplink(tp, target_dp); 3319 3326 } 3320 3327 } else { /* target_ip != NULL */ 3321 3328 /* ··· 3432 3443 */ 3433 3444 if (wip) { 3434 3445 ASSERT(VFS_I(wip)->i_nlink == 0); 3435 - error = xfs_bumplink(tp, wip); 3436 - if (error) 3437 - goto out_trans_cancel; 3446 + xfs_bumplink(tp, wip); 3438 3447 error = xfs_iunlink_remove(tp, wip); 3439 3448 if (error) 3440 3449 goto out_trans_cancel;
+2 -7
fs/xfs/xfs_ioctl.c
··· 788 788 { 789 789 struct xfs_fsop_geom fsgeo; 790 790 size_t len; 791 - int error; 792 791 793 - error = xfs_fs_geometry(&mp->m_sb, &fsgeo, struct_version); 794 - if (error) 795 - return error; 792 + xfs_fs_geometry(&mp->m_sb, &fsgeo, struct_version); 796 793 797 794 if (struct_version <= 3) 798 795 len = sizeof(struct xfs_fsop_geom_v1); ··· 2043 2046 case XFS_IOC_FSCOUNTS: { 2044 2047 xfs_fsop_counts_t out; 2045 2048 2046 - error = xfs_fs_counts(mp, &out); 2047 - if (error) 2048 - return error; 2049 + xfs_fs_counts(mp, &out); 2049 2050 2050 2051 if (copy_to_user(arg, &out, sizeof(out))) 2051 2052 return -EFAULT;
+1 -4
fs/xfs/xfs_ioctl32.c
··· 53 53 compat_xfs_fsop_geom_v1_t __user *arg32) 54 54 { 55 55 struct xfs_fsop_geom fsgeo; 56 - int error; 57 56 58 - error = xfs_fs_geometry(&mp->m_sb, &fsgeo, 3); 59 - if (error) 60 - return error; 57 + xfs_fs_geometry(&mp->m_sb, &fsgeo, 3); 61 58 /* The 32-bit variant simply has some padding at the end */ 62 59 if (copy_to_user(arg32, &fsgeo, sizeof(struct compat_xfs_fsop_geom_v1))) 63 60 return -EFAULT;
+2 -8
fs/xfs/xfs_log_recover.c
··· 5167 5167 } 5168 5168 } 5169 5169 5170 - STATIC int 5170 + STATIC void 5171 5171 xlog_unpack_data( 5172 5172 struct xlog_rec_header *rhead, 5173 5173 char *dp, ··· 5190 5190 dp += BBSIZE; 5191 5191 } 5192 5192 } 5193 - 5194 - return 0; 5195 5193 } 5196 5194 5197 5195 /* ··· 5204 5206 int pass, 5205 5207 struct list_head *buffer_list) 5206 5208 { 5207 - int error; 5208 5209 __le32 old_crc = rhead->h_crc; 5209 5210 __le32 crc; 5210 - 5211 5211 5212 5212 crc = xlog_cksum(log, rhead, dp, be32_to_cpu(rhead->h_len)); 5213 5213 ··· 5245 5249 return -EFSCORRUPTED; 5246 5250 } 5247 5251 5248 - error = xlog_unpack_data(rhead, dp, log); 5249 - if (error) 5250 - return error; 5252 + xlog_unpack_data(rhead, dp, log); 5251 5253 5252 5254 return xlog_recover_process_data(log, rhash, rhead, dp, pass, 5253 5255 buffer_list);
+4 -4
fs/xfs/xfs_super.c
··· 444 444 char *str; 445 445 }; 446 446 447 - STATIC int 447 + STATIC void 448 448 xfs_showargs( 449 449 struct xfs_mount *mp, 450 450 struct seq_file *m) ··· 523 523 524 524 if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) 525 525 seq_puts(m, ",noquota"); 526 - 527 - return 0; 528 526 } 527 + 529 528 static uint64_t 530 529 xfs_max_file_offset( 531 530 unsigned int blockshift) ··· 1444 1445 struct seq_file *m, 1445 1446 struct dentry *root) 1446 1447 { 1447 - return xfs_showargs(XFS_M(root->d_sb), m); 1448 + xfs_showargs(XFS_M(root->d_sb), m); 1449 + return 0; 1448 1450 } 1449 1451 1450 1452 /*