summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIoana Ciornei <ciorneiioana@gmail.com>2015-10-22 17:06:07 +0200
committerIlya Dryomov <idryomov@gmail.com>2015-11-02 23:36:49 +0100
commit8a703a383dd3458753e0ad71860ed3a5097692b3 (patch)
treef0bc933e97115512764123d95af522aff9a06e0b /net
parentceph: make fsync() wait unsafe requests that created/modified inode (diff)
downloadlinux-8a703a383dd3458753e0ad71860ed3a5097692b3.tar.xz
linux-8a703a383dd3458753e0ad71860ed3a5097692b3.zip
libceph: evaluate osd_req_op_data() arguments only once
This patch changes the osd_req_op_data() macro to not evaluate arguments more than once in order to follow the kernel coding style. Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Reviewed-by: Alex Elder <elder@linaro.org> [idryomov@gmail.com: changelog, formatting] Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/osd_client.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index a362d7e94cf3..191bc21cecea 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -120,11 +120,13 @@ static void ceph_osd_data_bio_init(struct ceph_osd_data *osd_data,
}
#endif /* CONFIG_BLOCK */
-#define osd_req_op_data(oreq, whch, typ, fld) \
- ({ \
- BUG_ON(whch >= (oreq)->r_num_ops); \
- &(oreq)->r_ops[whch].typ.fld; \
- })
+#define osd_req_op_data(oreq, whch, typ, fld) \
+({ \
+ struct ceph_osd_request *__oreq = (oreq); \
+ unsigned int __whch = (whch); \
+ BUG_ON(__whch >= __oreq->r_num_ops); \
+ &__oreq->r_ops[__whch].typ.fld; \
+})
static struct ceph_osd_data *
osd_req_op_raw_data_in(struct ceph_osd_request *osd_req, unsigned int which)