diff mbox series

ceph: chagne to void return type for __do_request()

Message ID 20180728083048.21475-1-cgxu519@gmx.com (mailing list archive)
State New, archived
Headers show
Series ceph: chagne to void return type for __do_request() | expand

Commit Message

Chengguang Xu July 28, 2018, 8:30 a.m. UTC
We do not check return code for __do_request() in all callers,
so change to void return type.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
 fs/ceph/mds_client.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Yan, Zheng July 31, 2018, 9:56 a.m. UTC | #1
On Sat, Jul 28, 2018 at 4:33 PM Chengguang Xu <cgxu519@gmx.com> wrote:
>
> We do not check return code for __do_request() in all callers,
> so change to void return type.
>
> Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
> ---
>  fs/ceph/mds_client.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index d01a262ba691..c65192102381 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -2255,7 +2255,7 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc,
>  /*
>   * send request, or put it on the appropriate wait list.
>   */
> -static int __do_request(struct ceph_mds_client *mdsc,
> +static void __do_request(struct ceph_mds_client *mdsc,
>                         struct ceph_mds_request *req)
>  {
>         struct ceph_mds_session *session = NULL;
> @@ -2265,7 +2265,7 @@ static int __do_request(struct ceph_mds_client *mdsc,
>         if (req->r_err || test_bit(CEPH_MDS_R_GOT_RESULT, &req->r_req_flags)) {
>                 if (test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags))
>                         __unregister_request(mdsc, req);
> -               goto out;
> +               return;
>         }
>
>         if (req->r_timeout &&
> @@ -2288,7 +2288,7 @@ static int __do_request(struct ceph_mds_client *mdsc,
>                 if (mdsc->mdsmap->m_epoch == 0) {
>                         dout("do_request no mdsmap, waiting for map\n");
>                         list_add(&req->r_wait, &mdsc->waiting_for_map);
> -                       goto finish;
> +                       return;
>                 }
>                 if (!(mdsc->fsc->mount_options->flags &
>                       CEPH_MOUNT_OPT_MOUNTWAIT) &&
> @@ -2306,7 +2306,7 @@ static int __do_request(struct ceph_mds_client *mdsc,
>             ceph_mdsmap_get_state(mdsc->mdsmap, mds) < CEPH_MDS_STATE_ACTIVE) {
>                 dout("do_request no mds or not active, waiting for map\n");
>                 list_add(&req->r_wait, &mdsc->waiting_for_map);
> -               goto out;
> +               return;
>         }
>
>         /* get, open session */
> @@ -2356,8 +2356,7 @@ static int __do_request(struct ceph_mds_client *mdsc,
>                 complete_request(mdsc, req);
>                 __unregister_request(mdsc, req);
>         }
> -out:
> -       return err;
> +       return;
>  }
>
>  /*
> --
> 2.17.1
>

Applied, thanks

Yan, Zheng


> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index d01a262ba691..c65192102381 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2255,7 +2255,7 @@  static int __prepare_send_request(struct ceph_mds_client *mdsc,
 /*
  * send request, or put it on the appropriate wait list.
  */
-static int __do_request(struct ceph_mds_client *mdsc,
+static void __do_request(struct ceph_mds_client *mdsc,
 			struct ceph_mds_request *req)
 {
 	struct ceph_mds_session *session = NULL;
@@ -2265,7 +2265,7 @@  static int __do_request(struct ceph_mds_client *mdsc,
 	if (req->r_err || test_bit(CEPH_MDS_R_GOT_RESULT, &req->r_req_flags)) {
 		if (test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags))
 			__unregister_request(mdsc, req);
-		goto out;
+		return;
 	}
 
 	if (req->r_timeout &&
@@ -2288,7 +2288,7 @@  static int __do_request(struct ceph_mds_client *mdsc,
 		if (mdsc->mdsmap->m_epoch == 0) {
 			dout("do_request no mdsmap, waiting for map\n");
 			list_add(&req->r_wait, &mdsc->waiting_for_map);
-			goto finish;
+			return;
 		}
 		if (!(mdsc->fsc->mount_options->flags &
 		      CEPH_MOUNT_OPT_MOUNTWAIT) &&
@@ -2306,7 +2306,7 @@  static int __do_request(struct ceph_mds_client *mdsc,
 	    ceph_mdsmap_get_state(mdsc->mdsmap, mds) < CEPH_MDS_STATE_ACTIVE) {
 		dout("do_request no mds or not active, waiting for map\n");
 		list_add(&req->r_wait, &mdsc->waiting_for_map);
-		goto out;
+		return;
 	}
 
 	/* get, open session */
@@ -2356,8 +2356,7 @@  static int __do_request(struct ceph_mds_client *mdsc,
 		complete_request(mdsc, req);
 		__unregister_request(mdsc, req);
 	}
-out:
-	return err;
+	return;
 }
 
 /*