@@ -953,35 +953,35 @@ static inline bool ptlrpc_nrs_req_can_move(struct ptlrpc_request *req)
/** @} nrs */
/**
- * Returns 1 if request buffer at offset @index was already swabbed
+ * Returns true if request buffer at offset @index was already swabbed
*/
-static inline int lustre_req_swabbed(struct ptlrpc_request *req, size_t index)
+static inline bool lustre_req_swabbed(struct ptlrpc_request *req, size_t index)
{
LASSERT(index < sizeof(req->rq_req_swab_mask) * 8);
return req->rq_req_swab_mask & (1 << index);
}
/**
- * Returns 1 if request reply buffer at offset @index was already swabbed
+ * Returns true if request reply buffer at offset @index was already swabbed
*/
-static inline int lustre_rep_swabbed(struct ptlrpc_request *req, size_t index)
+static inline bool lustre_rep_swabbed(struct ptlrpc_request *req, size_t index)
{
LASSERT(index < sizeof(req->rq_rep_swab_mask) * 8);
return req->rq_rep_swab_mask & (1 << index);
}
/**
- * Returns 1 if request needs to be swabbed into local cpu byteorder
+ * Returns true if request needs to be swabbed into local cpu byteorder
*/
-static inline int ptlrpc_req_need_swab(struct ptlrpc_request *req)
+static inline bool ptlrpc_req_need_swab(struct ptlrpc_request *req)
{
return lustre_req_swabbed(req, MSG_PTLRPC_HEADER_OFF);
}
/**
- * Returns 1 if request reply needs to be swabbed into local cpu byteorder
+ * Returns true if request reply needs to be swabbed into local cpu byteorder
*/
-static inline int ptlrpc_rep_need_swab(struct ptlrpc_request *req)
+static inline bool ptlrpc_rep_need_swab(struct ptlrpc_request *req)
{
return lustre_rep_swabbed(req, MSG_PTLRPC_HEADER_OFF);
}
@@ -1999,8 +1999,8 @@ struct ptlrpc_service *ptlrpc_register_service(struct ptlrpc_service_conf *conf,
*
* @{
*/
-int ptlrpc_buf_need_swab(struct ptlrpc_request *req, const int inout,
- u32 index);
+bool ptlrpc_buf_need_swab(struct ptlrpc_request *req, const int inout,
+ u32 index);
void ptlrpc_buf_set_swabbed(struct ptlrpc_request *req, const int inout,
u32 index);
int ptlrpc_unpack_rep_msg(struct ptlrpc_request *req, int len);
@@ -78,15 +78,14 @@ void ptlrpc_buf_set_swabbed(struct ptlrpc_request *req, const int inout,
lustre_set_rep_swabbed(req, index);
}
-int ptlrpc_buf_need_swab(struct ptlrpc_request *req, const int inout,
- u32 index)
+bool ptlrpc_buf_need_swab(struct ptlrpc_request *req, const int inout,
+ u32 index)
{
if (inout)
return (ptlrpc_req_need_swab(req) &&
!lustre_req_swabbed(req, index));
- else
- return (ptlrpc_rep_need_swab(req) &&
- !lustre_rep_swabbed(req, index));
+
+ return (ptlrpc_rep_need_swab(req) && !lustre_rep_swabbed(req, index));
}
/* early reply size */
@@ -217,7 +217,7 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
struct lustre_msg *msg = req->rq_repdata;
struct plain_header *phdr;
u32 cksum;
- int swabbed;
+ bool swabbed;
if (msg->lm_bufcount != PLAIN_PACK_SEGMENTS) {
CERROR("unexpected reply buf count %u\n", msg->lm_bufcount);
@@ -715,12 +715,11 @@ int plain_enlarge_reqbuf(struct ptlrpc_sec *sec,
.sc_policy = &plain_policy,
};
-static
-int plain_accept(struct ptlrpc_request *req)
+static int plain_accept(struct ptlrpc_request *req)
{
struct lustre_msg *msg = req->rq_reqbuf;
struct plain_header *phdr;
- int swabbed;
+ bool swabbed;
LASSERT(SPTLRPC_FLVR_POLICY(req->rq_flvr.sf_rpc) ==
SPTLRPC_POLICY_PLAIN);