[RHEL7,COMMIT] fuse kio: Cleanup in pcs_fuse_submit()

Submitted by Konstantin Khorenko on Sept. 5, 2018, 9:43 a.m.

Details

Message ID 201809050943.w859hKlU010619@finist_ce7.work
State New
Series "fuse kio: Cleanup in pcs_fuse_submit()"
Headers show

Commit Message

Konstantin Khorenko Sept. 5, 2018, 9:43 a.m.
The commit is pushed to "branch-rh7-3.10.0-862.11.6.vz7.71.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.11.6.vz7.71.8
------>
commit 12c3f4a5842d13218ff97267394ac48c72de3e76
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Wed Sep 5 12:43:20 2018 +0300

    fuse kio: Cleanup in pcs_fuse_submit()
    
    Instead of 3 declarations of ret, use only one.
    
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index 7f5ffac41c97..f73b72f036e8 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -864,6 +864,7 @@  static void pcs_fuse_submit(struct pcs_fuse_cluster *pfc, struct fuse_req *req,
 	struct fuse_inode *fi = get_fuse_inode(req->io_inode);
 	struct pcs_dentry_info *di = pcs_inode_from_fuse(fi);
 	struct pcs_int_request* ireq;
+	int ret;
 
 	BUG_ON(!di);
 	BUG_ON(req->cache != pcs_fuse_req_cachep);
@@ -876,17 +877,15 @@  static void pcs_fuse_submit(struct pcs_fuse_cluster *pfc, struct fuse_req *req,
 
 	switch (r->req.in.h.opcode) {
 	case FUSE_WRITE:
-	case FUSE_READ: {
-		int ret = pcs_fuse_prep_rw(r);
+	case FUSE_READ:
+		ret = pcs_fuse_prep_rw(r);
 		if (!ret)
 			goto submit;
 		if (ret > 0)
 			/* Pended, nothing to do. */
 			return;
 		break;
-	}
 	case FUSE_FALLOCATE: {
-		int ret;
 		struct fuse_fallocate_in *inarg = (void*) req->in.args[0].value;
 
 		if (pfc->fc->no_fallocate) {
@@ -921,9 +920,7 @@  static void pcs_fuse_submit(struct pcs_fuse_cluster *pfc, struct fuse_req *req,
 	case FUSE_FLUSH:
 		pcs_fuse_prep_io(r, PCS_REQ_T_SYNC, 0, 0, 0);
 		goto submit;
-	case FUSE_IOCTL: {
-		int ret;
-
+	case FUSE_IOCTL:
 		if (pfc->fc->no_fiemap) {
 			r->req.out.h.error = -EOPNOTSUPP;
 			goto error;
@@ -937,7 +934,6 @@  static void pcs_fuse_submit(struct pcs_fuse_cluster *pfc, struct fuse_req *req,
 			return;
 		break;
 	}
-	}
 	r->req.out.h.error = 0;
 error:
 	DTRACE("do fuse_request_end req:%p op:%d err:%d\n", &r->req, r->req.in.h.opcode, r->req.out.h.error);