Skip to content

Commit

Permalink
libceph, ceph, rbd: convert to use the preferred fallthrough macro
Browse files Browse the repository at this point in the history
Convert the uses of fallthrough comments to fallthrough macro.

[ idryomov: do the same for ceph and rbd ]

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
MiaoheLin authored and idryomov committed Aug 19, 2020
1 parent 256cf46 commit 3f19ae8
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions drivers/block/rbd.c
Expand Up @@ -3293,7 +3293,7 @@ static bool rbd_obj_advance_copyup(struct rbd_obj_request *obj_req, int *result)
case __RBD_OBJ_COPYUP_OBJECT_MAPS:
if (!pending_result_dec(&obj_req->pending, result))
return false;
/* fall through */
fallthrough;
case RBD_OBJ_COPYUP_OBJECT_MAPS:
if (*result) {
rbd_warn(rbd_dev, "snap object map update failed: %d",
Expand All @@ -3312,7 +3312,7 @@ static bool rbd_obj_advance_copyup(struct rbd_obj_request *obj_req, int *result)
case __RBD_OBJ_COPYUP_WRITE_OBJECT:
if (!pending_result_dec(&obj_req->pending, result))
return false;
/* fall through */
fallthrough;
case RBD_OBJ_COPYUP_WRITE_OBJECT:
return true;
default:
Expand Down Expand Up @@ -3399,7 +3399,7 @@ static bool rbd_obj_advance_write(struct rbd_obj_request *obj_req, int *result)
case __RBD_OBJ_WRITE_COPYUP:
if (!rbd_obj_advance_copyup(obj_req, result))
return false;
/* fall through */
fallthrough;
case RBD_OBJ_WRITE_COPYUP:
if (*result) {
rbd_warn(rbd_dev, "copyup failed: %d", *result);
Expand Down Expand Up @@ -3592,7 +3592,7 @@ static bool rbd_img_advance(struct rbd_img_request *img_req, int *result)
case __RBD_IMG_OBJECT_REQUESTS:
if (!pending_result_dec(&img_req->pending, result))
return false;
/* fall through */
fallthrough;
case RBD_IMG_OBJECT_REQUESTS:
return true;
default:
Expand Down
2 changes: 1 addition & 1 deletion fs/ceph/file.c
Expand Up @@ -252,7 +252,7 @@ static int ceph_init_file(struct inode *inode, struct file *file, int fmode)
case S_IFREG:
ceph_fscache_register_inode_cookie(inode);
ceph_fscache_file_set_cookie(inode, file);
/* fall through */
fallthrough;
case S_IFDIR:
ret = ceph_init_file_info(inode, file, fmode,
S_ISDIR(inode->i_mode));
Expand Down
20 changes: 10 additions & 10 deletions net/ceph/ceph_hash.c
Expand Up @@ -50,35 +50,35 @@ unsigned int ceph_str_hash_rjenkins(const char *str, unsigned int length)
switch (len) {
case 11:
c = c + ((__u32)k[10] << 24);
/* fall through */
fallthrough;
case 10:
c = c + ((__u32)k[9] << 16);
/* fall through */
fallthrough;
case 9:
c = c + ((__u32)k[8] << 8);
/* the first byte of c is reserved for the length */
/* fall through */
fallthrough;
case 8:
b = b + ((__u32)k[7] << 24);
/* fall through */
fallthrough;
case 7:
b = b + ((__u32)k[6] << 16);
/* fall through */
fallthrough;
case 6:
b = b + ((__u32)k[5] << 8);
/* fall through */
fallthrough;
case 5:
b = b + k[4];
/* fall through */
fallthrough;
case 4:
a = a + ((__u32)k[3] << 24);
/* fall through */
fallthrough;
case 3:
a = a + ((__u32)k[2] << 16);
/* fall through */
fallthrough;
case 2:
a = a + ((__u32)k[1] << 8);
/* fall through */
fallthrough;
case 1:
a = a + k[0];
/* case 0: nothing left to add */
Expand Down
2 changes: 1 addition & 1 deletion net/ceph/crush/mapper.c
Expand Up @@ -987,7 +987,7 @@ int crush_do_rule(const struct crush_map *map,
case CRUSH_RULE_CHOOSELEAF_FIRSTN:
case CRUSH_RULE_CHOOSE_FIRSTN:
firstn = 1;
/* fall through */
fallthrough;
case CRUSH_RULE_CHOOSELEAF_INDEP:
case CRUSH_RULE_CHOOSE_INDEP:
if (wsize == 0)
Expand Down
4 changes: 2 additions & 2 deletions net/ceph/messenger.c
Expand Up @@ -412,7 +412,7 @@ static void ceph_sock_state_change(struct sock *sk)
switch (sk->sk_state) {
case TCP_CLOSE:
dout("%s TCP_CLOSE\n", __func__);
/* fall through */
fallthrough;
case TCP_CLOSE_WAIT:
dout("%s TCP_CLOSE_WAIT\n", __func__);
con_sock_state_closing(con);
Expand Down Expand Up @@ -2751,7 +2751,7 @@ static int try_read(struct ceph_connection *con)
switch (ret) {
case -EBADMSG:
con->error_msg = "bad crc/signature";
/* fall through */
fallthrough;
case -EBADE:
ret = -EIO;
break;
Expand Down
2 changes: 1 addition & 1 deletion net/ceph/mon_client.c
Expand Up @@ -1307,7 +1307,7 @@ static struct ceph_msg *mon_alloc_msg(struct ceph_connection *con,
* request had a non-zero tid. Work around this weirdness
* by allocating a new message.
*/
/* fall through */
fallthrough;
case CEPH_MSG_MON_MAP:
case CEPH_MSG_MDS_MAP:
case CEPH_MSG_OSD_MAP:
Expand Down
4 changes: 2 additions & 2 deletions net/ceph/osd_client.c
Expand Up @@ -3854,7 +3854,7 @@ static void scan_requests(struct ceph_osd *osd,
if (!force_resend && !force_resend_writes)
break;

/* fall through */
fallthrough;
case CALC_TARGET_NEED_RESEND:
cancel_linger_map_check(lreq);
/*
Expand Down Expand Up @@ -3891,7 +3891,7 @@ static void scan_requests(struct ceph_osd *osd,
!force_resend_writes))
break;

/* fall through */
fallthrough;
case CALC_TARGET_NEED_RESEND:
cancel_map_check(req);
unlink_request(osd, req);
Expand Down

0 comments on commit 3f19ae8

Please sign in to comment.