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