Whamcloud - gitweb
Fix compiler warnings.
authorgirish <girish>
Mon, 21 Jul 2008 17:43:55 +0000 (17:43 +0000)
committergirish <girish>
Mon, 21 Jul 2008 17:43:55 +0000 (17:43 +0000)
b=15981
i=adilger
i=robert.read

22 files changed:
lnet/ulnds/socklnd/usocklnd.h
lnet/utils/debug.c
lustre/include/lustre_net.h
lustre/include/lustre_req_layout.h
lustre/ldlm/ldlm_lib.c
lustre/mgc/mgc_request.c
lustre/obdfilter/filter.c
lustre/osc/osc_create.c
lustre/ost/ost_handler.c
lustre/ptlrpc/client.c
lustre/ptlrpc/gss/sec_gss.c
lustre/ptlrpc/layout.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/sec.c
lustre/ptlrpc/sec_null.c
lustre/ptlrpc/sec_plain.c
lustre/ptlrpc/service.c
lustre/tests/write_time_limit.c
lustre/utils/liblustreapi.c
lustre/utils/lr_reader.c
lustre/utils/mkfs_lustre.c
lustre/utils/mount_lustre.c

index f2abf9d..f67a257 100644 (file)
@@ -8,7 +8,9 @@
  *   Lustre is a trademark of Cluster File Systems, Inc.
  *
  */
  *   Lustre is a trademark of Cluster File Systems, Inc.
  *
  */
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 #include <pthread.h>
 #include <poll.h>
 #include <lnet/lib-lnet.h>
 #include <pthread.h>
 #include <poll.h>
 #include <lnet/lib-lnet.h>
index 045fc2c..d0732e1 100644 (file)
@@ -24,7 +24,9 @@
  */
 
 #define __USE_FILE_OFFSET64
  */
 
 #define __USE_FILE_OFFSET64
+#ifndef _GNU_SOURCE
 #define  _GNU_SOURCE
 #define  _GNU_SOURCE
+#endif
 
 #include <stdio.h>
 #ifdef HAVE_NETDB_H
 
 #include <stdio.h>
 #ifdef HAVE_NETDB_H
index 12bed02..e705b87 100644 (file)
@@ -815,11 +815,11 @@ int ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
                              __u32 version, int opcode, char **bufs,
                              struct ptlrpc_cli_ctx *ctx);
 struct ptlrpc_request *ptlrpc_prep_req(struct obd_import *imp, __u32 version,
                              __u32 version, int opcode, char **bufs,
                              struct ptlrpc_cli_ctx *ctx);
 struct ptlrpc_request *ptlrpc_prep_req(struct obd_import *imp, __u32 version,
-                                       int opcode, int count, int *lengths,
+                                       int opcode, int count, __u32 *lengths,
                                        char **bufs);
 struct ptlrpc_request *ptlrpc_prep_req_pool(struct obd_import *imp,
                                              __u32 version, int opcode,
                                        char **bufs);
 struct ptlrpc_request *ptlrpc_prep_req_pool(struct obd_import *imp,
                                              __u32 version, int opcode,
-                                            int count, int *lengths, char **bufs,
+                                            int count, __u32 *lengths, char **bufs,
                                             struct ptlrpc_request_pool *pool);
 void ptlrpc_free_req(struct ptlrpc_request *request);
 void ptlrpc_req_finished(struct ptlrpc_request *request);
                                             struct ptlrpc_request_pool *pool);
 void ptlrpc_free_req(struct ptlrpc_request *request);
 void ptlrpc_req_finished(struct ptlrpc_request *request);
@@ -898,23 +898,23 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp);
 int ptlrpc_reconnect_import(struct obd_import *imp);
 int lustre_msg_swabbed(struct lustre_msg *msg);
 int lustre_msg_check_version(struct lustre_msg *msg, __u32 version);
 int ptlrpc_reconnect_import(struct obd_import *imp);
 int lustre_msg_swabbed(struct lustre_msg *msg);
 int lustre_msg_check_version(struct lustre_msg *msg, __u32 version);
-void lustre_init_msg_v2(struct lustre_msg_v2 *msg, int count, int *lens,
+void lustre_init_msg_v2(struct lustre_msg_v2 *msg, int count, __u32 *lens,
                         char **bufs);
 int lustre_pack_request(struct ptlrpc_request *, __u32 magic, int count,
                         char **bufs);
 int lustre_pack_request(struct ptlrpc_request *, __u32 magic, int count,
-                        int *lens, char **bufs);
-int lustre_pack_reply(struct ptlrpc_request *, int count, int *lens,
+                        __u32 *lens, char **bufs);
+int lustre_pack_reply(struct ptlrpc_request *, int count, __u32 *lens,
                       char **bufs);
 int lustre_pack_reply_v2(struct ptlrpc_request *req, int count,
                       char **bufs);
 int lustre_pack_reply_v2(struct ptlrpc_request *req, int count,
-                         int *lens, char **bufs, int flags);
+                         __u32 *lens, char **bufs, int flags);
 #define LPRFL_EARLY_REPLY 1
 #define LPRFL_EARLY_REPLY 1
-int lustre_pack_reply_flags(struct ptlrpc_request *, int count, int *lens,
+int lustre_pack_reply_flags(struct ptlrpc_request *, int count, __u32 *lens,
                             char **bufs, int flags);
 int lustre_shrink_msg(struct lustre_msg *msg, int segment,
                       unsigned int newlen, int move_data);
 void lustre_free_reply_state(struct ptlrpc_reply_state *rs);
 int lustre_msg_hdr_size(__u32 magic, int count);
                             char **bufs, int flags);
 int lustre_shrink_msg(struct lustre_msg *msg, int segment,
                       unsigned int newlen, int move_data);
 void lustre_free_reply_state(struct ptlrpc_reply_state *rs);
 int lustre_msg_hdr_size(__u32 magic, int count);
-int lustre_msg_size(__u32 magic, int count, int *lengths);
-int lustre_msg_size_v2(int count, int *lengths);
+int lustre_msg_size(__u32 magic, int count, __u32 *lengths);
+int lustre_msg_size_v2(int count, __u32 *lengths);
 int lustre_packed_msg_size(struct lustre_msg *msg);
 int lustre_msg_early_size(void);
 int lustre_unpack_msg(struct lustre_msg *m, int len);
 int lustre_packed_msg_size(struct lustre_msg *msg);
 int lustre_msg_early_size(void);
 int lustre_unpack_msg(struct lustre_msg *m, int len);
@@ -966,7 +966,7 @@ void lustre_msg_set_last_committed(struct lustre_msg *msg,__u64 last_committed);
 void lustre_msg_set_transno(struct lustre_msg *msg, __u64 transno);
 void lustre_msg_set_status(struct lustre_msg *msg, __u32 status);
 void lustre_msg_set_conn_cnt(struct lustre_msg *msg, __u32 conn_cnt);
 void lustre_msg_set_transno(struct lustre_msg *msg, __u64 transno);
 void lustre_msg_set_status(struct lustre_msg *msg, __u32 status);
 void lustre_msg_set_conn_cnt(struct lustre_msg *msg, __u32 conn_cnt);
-void ptlrpc_req_set_repsize(struct ptlrpc_request *req, int count, int *sizes);
+void ptlrpc_req_set_repsize(struct ptlrpc_request *req, int count, __u32 *sizes);
 void ptlrpc_request_set_replen(struct ptlrpc_request *req);
 void lustre_msg_set_timeout(struct lustre_msg *msg, __u32 timeout);
 void lustre_msg_set_service_time(struct lustre_msg *msg, __u32 service_time);
 void ptlrpc_request_set_replen(struct ptlrpc_request *req);
 void lustre_msg_set_timeout(struct lustre_msg *msg, __u32 timeout);
 void lustre_msg_set_service_time(struct lustre_msg *msg, __u32 service_time);
index d395309..88f3b29 100644 (file)
@@ -49,7 +49,7 @@ struct req_capsule {
         const struct req_format *rc_fmt;
         __u32                    rc_swabbed;
         enum req_location        rc_loc;
         const struct req_format *rc_fmt;
         __u32                    rc_swabbed;
         enum req_location        rc_loc;
-        int                      rc_area[RCL_NR][REQ_MAX_FIELD_NR];
+        __u32                    rc_area[RCL_NR][REQ_MAX_FIELD_NR];
 };
 
 #if !defined(__REQ_LAYOUT_USER__)
 };
 
 #if !defined(__REQ_LAYOUT_USER__)
@@ -91,7 +91,7 @@ void req_capsule_set_size(struct req_capsule *pill,
 int req_capsule_get_size(const struct req_capsule *pill,
                           const struct req_msg_field *field,
                           enum req_location loc);
 int req_capsule_get_size(const struct req_capsule *pill,
                           const struct req_msg_field *field,
                           enum req_location loc);
-int req_capsule_msg_size(const struct req_capsule *pill, enum req_location loc);
+int req_capsule_msg_size(struct req_capsule *pill, enum req_location loc);
 int req_capsule_fmt_size(__u32 magic, const struct req_format *fmt,
                          enum req_location loc);
 void req_capsule_extend(struct req_capsule *pill, const struct req_format *fmt);
 int req_capsule_fmt_size(__u32 magic, const struct req_format *fmt,
                          enum req_location loc);
 void req_capsule_extend(struct req_capsule *pill, const struct req_format *fmt);
index 2c2afb2..23c06ba 100644 (file)
@@ -1231,22 +1231,6 @@ void target_cleanup_recovery(struct obd_device *obd)
         EXIT;
 }
 
         EXIT;
 }
 
-static void target_recovery_expired(unsigned long castmeharder)
-{
-        struct obd_device *obd = (struct obd_device *)castmeharder;
-        LCONSOLE_WARN("%s: recovery timed out; %d clients never reconnected "
-                      "after %lds (%d clients did)\n",
-                      obd->obd_name, obd->obd_recoverable_clients,
-                      cfs_time_current_sec()- obd->obd_recovery_start,
-                      obd->obd_connected_clients);
-        spin_lock_bh(&obd->obd_processing_task_lock);
-        if (obd->obd_recovering)
-                obd->obd_abort_recovery = 1;
-        cfs_waitq_signal(&obd->obd_next_transno_waitq);
-        spin_unlock_bh(&obd->obd_processing_task_lock);
-}
-
-
 /* obd_processing_task_lock should be held */
 void target_cancel_recovery_timer(struct obd_device *obd)
 {
 /* obd_processing_task_lock should be held */
 void target_cancel_recovery_timer(struct obd_device *obd)
 {
@@ -1296,14 +1280,6 @@ static void reset_recovery_timer(struct obd_device *obd, int duration,
                obd->obd_name, (unsigned)left);
 }
 
                obd->obd_name, (unsigned)left);
 }
 
-static void resume_recovery_timer(struct obd_device *obd)
-{
-        LASSERT(!cfs_timer_is_armed(&obd->obd_recovery_timer));
-
-        /* to be safe, make it at least OBD_RECOVERY_FACTOR * obd_timeout */
-        reset_recovery_timer(obd, OBD_RECOVERY_FACTOR * obd_timeout, 1);
-}
-
 static void check_and_start_recovery_timer(struct obd_device *obd)
 {
         spin_lock_bh(&obd->obd_processing_task_lock);
 static void check_and_start_recovery_timer(struct obd_device *obd)
 {
         spin_lock_bh(&obd->obd_processing_task_lock);
@@ -1566,6 +1542,14 @@ static int handle_recovery_req(struct ptlrpc_thread *thread,
         RETURN(0);
 }
 
         RETURN(0);
 }
 
+static void resume_recovery_timer(struct obd_device *obd)
+{
+        LASSERT(!cfs_timer_is_armed(&obd->obd_recovery_timer));
+
+        /* to be safe, make it at least OBD_RECOVERY_FACTOR * obd_timeout */
+        reset_recovery_timer(obd, OBD_RECOVERY_FACTOR * obd_timeout, 1);
+}
+
 static int target_recovery_thread(void *arg)
 {
         struct obd_device *obd = arg;
 static int target_recovery_thread(void *arg)
 {
         struct obd_device *obd = arg;
@@ -1750,6 +1734,21 @@ void target_recovery_fini(struct obd_device *obd)
 }
 EXPORT_SYMBOL(target_recovery_fini);
 
 }
 EXPORT_SYMBOL(target_recovery_fini);
 
+static void target_recovery_expired(unsigned long castmeharder)
+{
+        struct obd_device *obd = (struct obd_device *)castmeharder;
+        LCONSOLE_WARN("%s: recovery timed out; %d clients never reconnected "
+                      "after %lds (%d clients did)\n",
+                      obd->obd_name, obd->obd_recoverable_clients,
+                      cfs_time_current_sec()- obd->obd_recovery_start,
+                      obd->obd_connected_clients);
+        spin_lock_bh(&obd->obd_processing_task_lock);
+        if (obd->obd_recovering)
+                obd->obd_abort_recovery = 1;
+        cfs_waitq_signal(&obd->obd_next_transno_waitq);
+        spin_unlock_bh(&obd->obd_processing_task_lock);
+}
+
 void target_recovery_init(struct obd_device *obd, svc_handler_t handler)
 {
         if (obd->obd_max_recoverable_clients == 0)
 void target_recovery_init(struct obd_device *obd, svc_handler_t handler)
 {
         if (obd->obd_max_recoverable_clients == 0)
index daee68a..0c204f4 100644 (file)
@@ -610,7 +610,7 @@ static int mgc_set_mgs_param(struct obd_export *exp,
         struct ptlrpc_request *req;
         struct mgs_send_param *req_msp, *rep_msp;
         int size[] = { sizeof(struct ptlrpc_body), sizeof(*req_msp) };
         struct ptlrpc_request *req;
         struct mgs_send_param *req_msp, *rep_msp;
         int size[] = { sizeof(struct ptlrpc_body), sizeof(*req_msp) };
-        int rep_size[] = { sizeof(struct ptlrpc_body), sizeof(*msp) };
+        __u32 rep_size[] = { sizeof(struct ptlrpc_body), sizeof(*msp) };
         int rc;
         ENTRY;
 
         int rc;
         ENTRY;
 
index ae88bd6..9a9a3a7 100644 (file)
@@ -1653,7 +1653,7 @@ static int filter_intent_policy(struct ldlm_namespace *ns,
         int idx, rc, tmpflags = 0, only_liblustre = 1;
         struct ldlm_interval_tree *tree;
         struct filter_intent_args arg;
         int idx, rc, tmpflags = 0, only_liblustre = 1;
         struct ldlm_interval_tree *tree;
         struct filter_intent_args arg;
-        int repsize[3] = { [MSG_PTLRPC_BODY_OFF] = sizeof(struct ptlrpc_body),
+        __u32 repsize[3] = { [MSG_PTLRPC_BODY_OFF] = sizeof(struct ptlrpc_body),
                            [DLM_LOCKREPLY_OFF]   = sizeof(*rep),
                            [DLM_REPLY_REC_OFF]   = sizeof(*reply_lvb) };
         ENTRY;
                            [DLM_LOCKREPLY_OFF]   = sizeof(*rep),
                            [DLM_REPLY_REC_OFF]   = sizeof(*reply_lvb) };
         ENTRY;
index 81eef48..892df3c 100644 (file)
@@ -128,7 +128,7 @@ static int oscc_internal_create(struct osc_creator *oscc)
 {
         struct ptlrpc_request *request;
         struct ost_body *body;
 {
         struct ptlrpc_request *request;
         struct ost_body *body;
-        int size[] = { sizeof(struct ptlrpc_body), sizeof(*body) };
+        __u32 size[] = { sizeof(struct ptlrpc_body), sizeof(*body) };
         ENTRY;
 
         LASSERT_SPIN_LOCKED(&oscc->oscc_lock);
         ENTRY;
 
         LASSERT_SPIN_LOCKED(&oscc->oscc_lock);
index 45c5102..6a0c402 100644 (file)
@@ -89,7 +89,8 @@ static int ost_destroy(struct obd_export *exp, struct ptlrpc_request *req,
                        struct obd_trans_info *oti)
 {
         struct ost_body *body, *repbody;
                        struct obd_trans_info *oti)
 {
         struct ost_body *body, *repbody;
-        int rc, size[2] = { sizeof(struct ptlrpc_body), sizeof(*body) };
+        __u32 size[2] = { sizeof(struct ptlrpc_body), sizeof(*body) };
+        int rc;
         ENTRY;
 
         body = lustre_swab_reqbuf(req, REQ_REC_OFF, sizeof(*body),
         ENTRY;
 
         body = lustre_swab_reqbuf(req, REQ_REC_OFF, sizeof(*body),
@@ -126,7 +127,8 @@ static int ost_getattr(struct obd_export *exp, struct ptlrpc_request *req)
 {
         struct ost_body *body, *repbody;
         struct obd_info oinfo = { { { 0 } } };
 {
         struct ost_body *body, *repbody;
         struct obd_info oinfo = { { { 0 } } };
-        int rc, size[2] = { sizeof(struct ptlrpc_body), sizeof(*body) };
+        __u32 size[2] = { sizeof(struct ptlrpc_body), sizeof(*body) };
+        int rc;
         ENTRY;
 
         body = lustre_swab_reqbuf(req, REQ_REC_OFF, sizeof(*body),
         ENTRY;
 
         body = lustre_swab_reqbuf(req, REQ_REC_OFF, sizeof(*body),
@@ -153,7 +155,8 @@ static int ost_getattr(struct obd_export *exp, struct ptlrpc_request *req)
 static int ost_statfs(struct ptlrpc_request *req)
 {
         struct obd_statfs *osfs;
 static int ost_statfs(struct ptlrpc_request *req)
 {
         struct obd_statfs *osfs;
-        int rc, size[2] = { sizeof(struct ptlrpc_body), sizeof(*osfs) };
+        __u32 size[2] = { sizeof(struct ptlrpc_body), sizeof(*osfs) };
+        int rc;
         ENTRY;
 
         rc = lustre_pack_reply(req, 2, size, NULL);
         ENTRY;
 
         rc = lustre_pack_reply(req, 2, size, NULL);
@@ -176,7 +179,8 @@ static int ost_create(struct obd_export *exp, struct ptlrpc_request *req,
                       struct obd_trans_info *oti)
 {
         struct ost_body *body, *repbody;
                       struct obd_trans_info *oti)
 {
         struct ost_body *body, *repbody;
-        int rc, size[2] = { sizeof(struct ptlrpc_body), sizeof(*repbody) };
+        __u32 size[2] = { sizeof(struct ptlrpc_body), sizeof(*repbody) };
+        int rc;
         ENTRY;
 
         body = lustre_swab_reqbuf(req, REQ_REC_OFF, sizeof(*body),
         ENTRY;
 
         body = lustre_swab_reqbuf(req, REQ_REC_OFF, sizeof(*body),
@@ -264,7 +268,8 @@ static int ost_punch(struct obd_export *exp, struct ptlrpc_request *req,
 {
         struct obd_info oinfo = { { { 0 } } };
         struct ost_body *body, *repbody;
 {
         struct obd_info oinfo = { { { 0 } } };
         struct ost_body *body, *repbody;
-        int rc, size[2] = { sizeof(struct ptlrpc_body), sizeof(*repbody) };
+        __u32 size[2] = { sizeof(struct ptlrpc_body), sizeof(*repbody) };
+        int rc;
         struct lustre_handle lh = {0,};
         ENTRY;
 
         struct lustre_handle lh = {0,};
         ENTRY;
 
@@ -315,7 +320,8 @@ static int ost_sync(struct obd_export *exp, struct ptlrpc_request *req)
 {
         struct ost_body *body, *repbody;
         struct lustre_capa *capa = NULL;
 {
         struct ost_body *body, *repbody;
         struct lustre_capa *capa = NULL;
-        int rc, size[2] = { sizeof(struct ptlrpc_body), sizeof(*repbody) };
+        __u32 size[2] = { sizeof(struct ptlrpc_body), sizeof(*repbody) };
+        int rc;
         ENTRY;
 
         body = lustre_swab_reqbuf(req, REQ_REC_OFF, sizeof(*body),
         ENTRY;
 
         body = lustre_swab_reqbuf(req, REQ_REC_OFF, sizeof(*body),
@@ -342,7 +348,8 @@ static int ost_setattr(struct obd_export *exp, struct ptlrpc_request *req,
                        struct obd_trans_info *oti)
 {
         struct ost_body *body, *repbody;
                        struct obd_trans_info *oti)
 {
         struct ost_body *body, *repbody;
-        int rc, size[2] = { sizeof(struct ptlrpc_body), sizeof(*repbody) };
+        __u32 size[2] = { sizeof(struct ptlrpc_body), sizeof(*repbody) };
+        int rc;
         struct obd_info oinfo = { { { 0 } } };
         ENTRY;
 
         struct obd_info oinfo = { { { 0 } } };
         ENTRY;
 
@@ -676,7 +683,7 @@ static int ost_brw_read(struct ptlrpc_request *req, struct obd_trans_info *oti)
         struct lustre_capa *capa = NULL;
         struct l_wait_info lwi;
         struct lustre_handle lockh = { 0 };
         struct lustre_capa *capa = NULL;
         struct l_wait_info lwi;
         struct lustre_handle lockh = { 0 };
-        int size[2] = { sizeof(struct ptlrpc_body), sizeof(*body) };
+        __u32  size[2] = { sizeof(struct ptlrpc_body), sizeof(*body) };
         int niocount, npages, nob = 0, rc, i;
         int no_reply = 0;
         ENTRY;
         int niocount, npages, nob = 0, rc, i;
         int no_reply = 0;
         ENTRY;
@@ -950,7 +957,7 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
         struct lustre_handle     lockh = {0};
         struct lustre_capa      *capa = NULL;
         __u32                   *rcs;
         struct lustre_handle     lockh = {0};
         struct lustre_capa      *capa = NULL;
         __u32                   *rcs;
-        int size[3] = { sizeof(struct ptlrpc_body), sizeof(*body) };
+        __u32 size[3] = { sizeof(struct ptlrpc_body), sizeof(*body) };
         int objcount, niocount, npages;
         int rc, swab, i, j;
         obd_count                client_cksum = 0, server_cksum = 0;
         int objcount, niocount, npages;
         int rc, swab, i, j;
         obd_count                client_cksum = 0, server_cksum = 0;
@@ -1353,7 +1360,8 @@ static int ost_get_info(struct obd_export *exp, struct ptlrpc_request *req)
 static int ost_handle_quotactl(struct ptlrpc_request *req)
 {
         struct obd_quotactl *oqctl, *repoqc;
 static int ost_handle_quotactl(struct ptlrpc_request *req)
 {
         struct obd_quotactl *oqctl, *repoqc;
-        int rc, size[2] = { sizeof(struct ptlrpc_body), sizeof(*repoqc) };
+        __u32 size[2] = { sizeof(struct ptlrpc_body), sizeof(*repoqc) };
+        int rc;
         ENTRY;
 
         oqctl = lustre_swab_reqbuf(req, REQ_REC_OFF, sizeof(*oqctl),
         ENTRY;
 
         oqctl = lustre_swab_reqbuf(req, REQ_REC_OFF, sizeof(*oqctl),
index d2005cd..245a8d0 100644 (file)
@@ -477,7 +477,7 @@ static void __ptlrpc_free_req_to_pool(struct ptlrpc_request *request)
 
 static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
                                       __u32 version, int opcode,
 
 static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
                                       __u32 version, int opcode,
-                                      int count, int *lengths, char **bufs,
+                                      int count, __u32 *lengths, char **bufs,
                                       struct ptlrpc_cli_ctx *ctx)
 {
         struct obd_import  *imp = request->rq_import;
                                       struct ptlrpc_cli_ctx *ctx)
 {
         struct obd_import  *imp = request->rq_import;
@@ -643,7 +643,7 @@ struct ptlrpc_request *ptlrpc_request_alloc_pack(struct obd_import *imp,
 struct ptlrpc_request *
 ptlrpc_prep_req_pool(struct obd_import *imp,
                      __u32 version, int opcode,
 struct ptlrpc_request *
 ptlrpc_prep_req_pool(struct obd_import *imp,
                      __u32 version, int opcode,
-                     int count, int *lengths, char **bufs,
+                     int count, __u32 *lengths, char **bufs,
                      struct ptlrpc_request_pool *pool)
 {
         struct ptlrpc_request *request;
                      struct ptlrpc_request_pool *pool)
 {
         struct ptlrpc_request *request;
@@ -664,7 +664,7 @@ ptlrpc_prep_req_pool(struct obd_import *imp,
 
 struct ptlrpc_request *
 ptlrpc_prep_req(struct obd_import *imp, __u32 version, int opcode, int count,
 
 struct ptlrpc_request *
 ptlrpc_prep_req(struct obd_import *imp, __u32 version, int opcode, int count,
-                int *lengths, char **bufs)
+                __u32 *lengths, char **bufs)
 {
         return ptlrpc_prep_req_pool(imp, version, opcode, count, lengths, bufs,
                                     NULL);
 {
         return ptlrpc_prep_req_pool(imp, version, opcode, count, lengths, bufs,
                                     NULL);
index a777e9b..be75811 100644 (file)
@@ -857,8 +857,8 @@ int gss_cli_ctx_seal(struct ptlrpc_cli_ctx *ctx,
         struct gss_cli_ctx      *gctx;
         rawobj_t                 hdrobj, msgobj, token;
         struct gss_header       *ghdr;
         struct gss_cli_ctx      *gctx;
         rawobj_t                 hdrobj, msgobj, token;
         struct gss_header       *ghdr;
-        int                      buflens[2], wiresize, rc;
-        __u32                    major;
+        __u32                    buflens[2], major;
+        int                      wiresize, rc;
         ENTRY;
 
         LASSERT(req->rq_clrbuf);
         ENTRY;
 
         LASSERT(req->rq_clrbuf);
@@ -1215,7 +1215,8 @@ int gss_alloc_reqbuf_intg(struct ptlrpc_sec *sec,
                           int svc, int msgsize)
 {
         int                       bufsize, txtsize;
                           int svc, int msgsize)
 {
         int                       bufsize, txtsize;
-        int                       buflens[5], bufcnt = 2;
+        int                       bufcnt = 2;
+        __u32                     buflens[5];
         ENTRY;
 
         /*
         ENTRY;
 
         /*
@@ -1295,8 +1296,8 @@ int gss_alloc_reqbuf_priv(struct ptlrpc_sec *sec,
                           struct ptlrpc_request *req,
                           int msgsize)
 {
                           struct ptlrpc_request *req,
                           int msgsize)
 {
-        int                       ibuflens[3], ibufcnt;
-        int                       wbuflens[2];
+        __u32                     ibuflens[3], wbuflens[2];
+        int                       ibufcnt;
         int                       clearsize, wiresize;
         ENTRY;
 
         int                       clearsize, wiresize;
         ENTRY;
 
@@ -1452,7 +1453,8 @@ int gss_alloc_repbuf_intg(struct ptlrpc_sec *sec,
                           int svc, int msgsize)
 {
         int             txtsize;
                           int svc, int msgsize)
 {
         int             txtsize;
-        int             buflens[4], bufcnt = 2;
+        __u32           buflens[4];
+        int             bufcnt = 2;
         int             alloc_size;
 
         /*
         int             alloc_size;
 
         /*
@@ -1504,7 +1506,8 @@ int gss_alloc_repbuf_priv(struct ptlrpc_sec *sec,
                           int msgsize)
 {
         int             txtsize;
                           int msgsize)
 {
         int             txtsize;
-        int             buflens[2], bufcnt;
+        __u32           buflens[2];
+        int             bufcnt;
         int             alloc_size;
 
         /* inner buffers */
         int             alloc_size;
 
         /* inner buffers */
@@ -1684,7 +1687,7 @@ int gss_enlarge_reqbuf_priv(struct ptlrpc_sec *sec,
 {
         struct lustre_msg      *newclrbuf;
         int                     newmsg_size, newclrbuf_size, newcipbuf_size;
 {
         struct lustre_msg      *newclrbuf;
         int                     newmsg_size, newclrbuf_size, newcipbuf_size;
-        int                     buflens[3];
+        __u32                   buflens[3];
 
         /*
          * embedded msg is at seg 0 of clear buffer;
 
         /*
          * embedded msg is at seg 0 of clear buffer;
@@ -2406,8 +2409,8 @@ int gss_svc_alloc_rs(struct ptlrpc_request *req, int msglen)
         struct gss_svc_reqctx       *grctx;
         struct ptlrpc_reply_state   *rs;
         int                          early, privacy, svc, bsd_off = 0;
         struct gss_svc_reqctx       *grctx;
         struct ptlrpc_reply_state   *rs;
         int                          early, privacy, svc, bsd_off = 0;
-        int                          ibuflens[2], ibufcnt = 0;
-        int                          buflens[4], bufcnt;
+        __u32                        ibuflens[2], buflens[4];
+        int                          ibufcnt = 0, bufcnt;
         int                          txtsize, wmsg_size, rs_size;
         ENTRY;
 
         int                          txtsize, wmsg_size, rs_size;
         ENTRY;
 
@@ -2527,9 +2530,9 @@ static int gss_svc_seal(struct ptlrpc_request *req,
         rawobj_t                 hdrobj, msgobj, token;
         struct gss_header       *ghdr;
         __u8                    *token_buf;
         rawobj_t                 hdrobj, msgobj, token;
         struct gss_header       *ghdr;
         __u8                    *token_buf;
-        int                      token_buflen, buflens[2];
+        int                      token_buflen; 
+        __u32                    buflens[2], major;
         int                      msglen, rc;
         int                      msglen, rc;
-        __u32                    major;
         ENTRY;
 
         /* get clear data length. note embedded lustre_msg might
         ENTRY;
 
         /* get clear data length. note embedded lustre_msg might
@@ -2737,7 +2740,8 @@ err_out:
 
 static void gss_init_at_reply_offset(void)
 {
 
 static void gss_init_at_reply_offset(void)
 {
-        int buflens[3], clearsize;
+        __u32 buflens[3];
+        int clearsize;
 
         buflens[0] = PTLRPC_GSS_HEADER_SIZE;
         buflens[1] = lustre_msg_early_size();
 
         buflens[0] = PTLRPC_GSS_HEADER_SIZE;
         buflens[1] = lustre_msg_early_size();
index 32f3427..cc0be2e 100644 (file)
@@ -1452,11 +1452,11 @@ int req_capsule_get_size(const struct req_capsule *pill,
 }
 EXPORT_SYMBOL(req_capsule_get_size);
 
 }
 EXPORT_SYMBOL(req_capsule_get_size);
 
-int req_capsule_msg_size(const struct req_capsule *pill, enum req_location loc)
+int req_capsule_msg_size(struct req_capsule *pill, enum req_location loc)
 {
         return lustre_msg_size(pill->rc_req->rq_import->imp_msg_magic,
                                pill->rc_fmt->rf_fields[loc].nr,
 {
         return lustre_msg_size(pill->rc_req->rq_import->imp_msg_magic,
                                pill->rc_fmt->rf_fields[loc].nr,
-                               (int *)pill->rc_area[loc]);
+                               pill->rc_area[loc]);
 }
 
 int req_capsule_fmt_size(__u32 magic, const struct req_format *fmt,
 }
 
 int req_capsule_fmt_size(__u32 magic, const struct req_format *fmt,
index 4e8a146..e1a2f67 100644 (file)
@@ -94,7 +94,7 @@ int lustre_msg_early_size() {
 }
 EXPORT_SYMBOL(lustre_msg_early_size);
 
 }
 EXPORT_SYMBOL(lustre_msg_early_size);
 
-int lustre_msg_size_v2(int count, int *lengths)
+int lustre_msg_size_v2(int count, __u32 *lengths)
 {
         int size;
         int i;
 {
         int size;
         int i;
@@ -113,9 +113,9 @@ EXPORT_SYMBOL(lustre_msg_size_v2);
  *       in the form of a v2 request.  If this is a connection to a v1
  *       target then the first buffer will be stripped because the ptlrpc
  *       data is part of the lustre_msg_v1 header. b=14043 */
  *       in the form of a v2 request.  If this is a connection to a v1
  *       target then the first buffer will be stripped because the ptlrpc
  *       data is part of the lustre_msg_v1 header. b=14043 */
-int lustre_msg_size(__u32 magic, int count, int *lens)
+int lustre_msg_size(__u32 magic, int count, __u32 *lens)
 {
 {
-        int size[] = { sizeof(struct ptlrpc_body) };
+        __u32 size[] = { sizeof(struct ptlrpc_body) };
 
         if (!lens) {
                 LASSERT(count == 1);
 
         if (!lens) {
                 LASSERT(count == 1);
@@ -147,7 +147,7 @@ int lustre_packed_msg_size(struct lustre_msg *msg)
         }
 }
 
         }
 }
 
-void lustre_init_msg_v2(struct lustre_msg_v2 *msg, int count, int *lens,
+void lustre_init_msg_v2(struct lustre_msg_v2 *msg, int count, __u32 *lens,
                         char **bufs)
 {
         char *ptr;
                         char **bufs)
 {
         char *ptr;
@@ -172,7 +172,7 @@ void lustre_init_msg_v2(struct lustre_msg_v2 *msg, int count, int *lens,
 EXPORT_SYMBOL(lustre_init_msg_v2);
 
 static int lustre_pack_request_v2(struct ptlrpc_request *req,
 EXPORT_SYMBOL(lustre_init_msg_v2);
 
 static int lustre_pack_request_v2(struct ptlrpc_request *req,
-                                  int count, int *lens, char **bufs)
+                                  int count, __u32 *lens, char **bufs)
 {
         int reqlen, rc;
 
 {
         int reqlen, rc;
 
@@ -191,9 +191,9 @@ static int lustre_pack_request_v2(struct ptlrpc_request *req,
 }
 
 int lustre_pack_request(struct ptlrpc_request *req, __u32 magic, int count,
 }
 
 int lustre_pack_request(struct ptlrpc_request *req, __u32 magic, int count,
-                        int *lens, char **bufs)
+                        __u32 *lens, char **bufs)
 {
 {
-        int size[] = { sizeof(struct ptlrpc_body) };
+        __u32 size[] = { sizeof(struct ptlrpc_body) };
 
         if (!lens) {
                 LASSERT(count == 1);
 
         if (!lens) {
                 LASSERT(count == 1);
@@ -282,7 +282,7 @@ void lustre_put_emerg_rs(struct ptlrpc_reply_state *rs)
 }
 
 int lustre_pack_reply_v2(struct ptlrpc_request *req, int count,
 }
 
 int lustre_pack_reply_v2(struct ptlrpc_request *req, int count,
-                         int *lens, char **bufs, int flags)
+                         __u32 *lens, char **bufs, int flags)
 {
         struct ptlrpc_reply_state *rs;
         int                        msg_len, rc;
 {
         struct ptlrpc_reply_state *rs;
         int                        msg_len, rc;
@@ -320,11 +320,11 @@ int lustre_pack_reply_v2(struct ptlrpc_request *req, int count,
 }
 EXPORT_SYMBOL(lustre_pack_reply_v2);
 
 }
 EXPORT_SYMBOL(lustre_pack_reply_v2);
 
-int lustre_pack_reply_flags(struct ptlrpc_request *req, int count, int *lens,
+int lustre_pack_reply_flags(struct ptlrpc_request *req, int count, __u32 *lens,
                             char **bufs, int flags)
 {
         int rc = 0;
                             char **bufs, int flags)
 {
         int rc = 0;
-        int size[] = { sizeof(struct ptlrpc_body) };
+        __u32 size[] = { sizeof(struct ptlrpc_body) };
 
         if (!lens) {
                 LASSERT(count == 1);
 
         if (!lens) {
                 LASSERT(count == 1);
@@ -350,7 +350,7 @@ int lustre_pack_reply_flags(struct ptlrpc_request *req, int count, int *lens,
         return rc;
 }
 
         return rc;
 }
 
-int lustre_pack_reply(struct ptlrpc_request *req, int count, int *lens,
+int lustre_pack_reply(struct ptlrpc_request *req, int count, __u32 *lens,
                       char **bufs)
 {
         return lustre_pack_reply_flags(req, count, lens, bufs, 0);
                       char **bufs)
 {
         return lustre_pack_reply_flags(req, count, lens, bufs, 0);
@@ -424,7 +424,7 @@ int lustre_shrink_msg_v2(struct lustre_msg_v2 *msg, int segment,
                         memcpy(newpos, tail, tail_len);
         }
 out:
                         memcpy(newpos, tail, tail_len);
         }
 out:
-        return lustre_msg_size_v2(msg->lm_bufcount, (int *)msg->lm_buflens);
+        return lustre_msg_size_v2(msg->lm_bufcount, msg->lm_buflens);
 }
 
 /*
 }
 
 /*
@@ -1278,7 +1278,7 @@ __u32 lustre_msg_calc_cksum(struct lustre_msg *msg)
                 struct ptlrpc_body *pb;
                 pb = lustre_msg_buf_v2(msg, MSG_PTLRPC_BODY_OFF, sizeof(*pb));
                 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg);
                 struct ptlrpc_body *pb;
                 pb = lustre_msg_buf_v2(msg, MSG_PTLRPC_BODY_OFF, sizeof(*pb));
                 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg);
-                return crc32_le(~(__u32)0, (char *)pb, sizeof(*pb));
+                return crc32_le(~(__u32)0, (unsigned char *)pb, sizeof(*pb));
         }
         default:
                 CERROR("incorrect message magic: %08x\n", msg->lm_magic);
         }
         default:
                 CERROR("incorrect message magic: %08x\n", msg->lm_magic);
@@ -1474,7 +1474,7 @@ void ptlrpc_request_set_replen(struct ptlrpc_request *req)
                 req->rq_reqmsg->lm_repsize = req->rq_replen;
 }
 
                 req->rq_reqmsg->lm_repsize = req->rq_replen;
 }
 
-void ptlrpc_req_set_repsize(struct ptlrpc_request *req, int count, int *lens)
+void ptlrpc_req_set_repsize(struct ptlrpc_request *req, int count, __u32 *lens)
 {
         req->rq_replen = lustre_msg_size(req->rq_reqmsg->lm_magic, count, lens);
         if (req->rq_reqmsg->lm_magic == LUSTRE_MSG_MAGIC_V2)
 {
         req->rq_replen = lustre_msg_size(req->rq_reqmsg->lm_magic, count, lens);
         if (req->rq_reqmsg->lm_magic == LUSTRE_MSG_MAGIC_V2)
index a92a5c4..fc39f50 100644 (file)
@@ -2056,7 +2056,6 @@ void pga_to_bulk_desc(int nob, obd_count pg_count, struct brw_page **pga,
                                            nob : pga[i]->count;
                 desc->bd_iov[i].kiov_offset = pga[i]->off & ~CFS_PAGE_MASK;
 #else
                                            nob : pga[i]->count;
                 desc->bd_iov[i].kiov_offset = pga[i]->off & ~CFS_PAGE_MASK;
 #else
-#warning FIXME for liblustre!
                 desc->bd_iov[i].iov_base = pga[i]->pg->addr;
                 desc->bd_iov[i].iov_len = pga[i]->count > nob ?
                                            nob : pga[i]->count;
                 desc->bd_iov[i].iov_base = pga[i]->pg->addr;
                 desc->bd_iov[i].iov_len = pga[i]->count > nob ?
                                            nob : pga[i]->count;
index 586b1f7..e364c62 100644 (file)
@@ -101,7 +101,7 @@ int null_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
                 if (req->rq_repdata->lm_magic == LUSTRE_MSG_MAGIC_V2_SWABBED)
                         __swab32s(&cksums);
 
                 if (req->rq_repdata->lm_magic == LUSTRE_MSG_MAGIC_V2_SWABBED)
                         __swab32s(&cksums);
 
-                cksumc = crc32_le(!(__u32) 0, (char *) req->rq_repdata,
+                cksumc = crc32_le(!(__u32) 0, (unsigned char *)req->rq_repdata,
                                   req->rq_repdata_len);
                 if (cksumc != cksums) {
                         CWARN("early reply checksum mismatch: %08x != %08x\n",
                                   req->rq_repdata_len);
                 if (cksumc != cksums) {
                         CWARN("early reply checksum mismatch: %08x != %08x\n",
@@ -359,7 +359,8 @@ int null_authorize(struct ptlrpc_request *req)
                 req->rq_reply_off = lustre_msg_early_size();
         } else {
                 rs->rs_repbuf->lm_cksum =
                 req->rq_reply_off = lustre_msg_early_size();
         } else {
                 rs->rs_repbuf->lm_cksum =
-                                crc32_le(!(__u32) 0, (char *) rs->rs_repbuf,
+                                crc32_le(!(__u32) 0,
+                                         (unsigned char *)rs->rs_repbuf,
                                          rs->rs_repdata_len);
                 req->rq_reply_off = 0;
         }
                                          rs->rs_repdata_len);
                 req->rq_reply_off = 0;
         }
index 6763f1d..2ce4d2c 100644 (file)
@@ -397,7 +397,7 @@ int plain_alloc_reqbuf(struct ptlrpc_sec *sec,
                        struct ptlrpc_request *req,
                        int msgsize)
 {
                        struct ptlrpc_request *req,
                        int msgsize)
 {
-        int buflens[PLAIN_PACK_SEGMENTS] = { 0, };
+        __u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
         int alloc_len;
         ENTRY;
 
         int alloc_len;
         ENTRY;
 
@@ -460,7 +460,7 @@ int plain_alloc_repbuf(struct ptlrpc_sec *sec,
                        struct ptlrpc_request *req,
                        int msgsize)
 {
                        struct ptlrpc_request *req,
                        int msgsize)
 {
-        int buflens[PLAIN_PACK_SEGMENTS] = { 0, };
+        __u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
         int alloc_len;
         ENTRY;
 
         int alloc_len;
         ENTRY;
 
@@ -619,7 +619,7 @@ int plain_alloc_rs(struct ptlrpc_request *req, int msgsize)
 {
         struct ptlrpc_reply_state   *rs;
         struct ptlrpc_bulk_sec_desc *bsd;
 {
         struct ptlrpc_reply_state   *rs;
         struct ptlrpc_bulk_sec_desc *bsd;
-        int                          buflens[PLAIN_PACK_SEGMENTS] = { 0, };
+        __u32                        buflens[PLAIN_PACK_SEGMENTS] = { 0, };
         int                          rs_size = sizeof(*rs);
         ENTRY;
 
         int                          rs_size = sizeof(*rs);
         ENTRY;
 
@@ -797,7 +797,7 @@ static struct ptlrpc_sec_policy plain_policy = {
 
 int sptlrpc_plain_init(void)
 {
 
 int sptlrpc_plain_init(void)
 {
-        int buflens[PLAIN_PACK_SEGMENTS] = { 0, };
+        __u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
         int rc;
 
         buflens[PLAIN_PACK_MSG_OFF] = lustre_msg_early_size();
         int rc;
 
         buflens[PLAIN_PACK_MSG_OFF] = lustre_msg_early_size();
index 1a5730e..d742a17 100644 (file)
@@ -643,7 +643,7 @@ static void ptlrpc_at_set_timer(struct ptlrpc_service *svc)
         else
                 cfs_timer_arm(&svc->srv_at_timer, cfs_time_shift(next));
         spin_unlock(&svc->srv_at_lock);
         else
                 cfs_timer_arm(&svc->srv_at_timer, cfs_time_shift(next));
         spin_unlock(&svc->srv_at_lock);
-        CDEBUG(D_INFO, "armed %s at %+lds\n", svc->srv_name, next);
+        CDEBUG(D_INFO, "armed %s at %+ds\n", svc->srv_name, next);
 }
 
 /* Add rpc to early reply check list */
 }
 
 /* Add rpc to early reply check list */
index 445b623..07bf269 100644 (file)
@@ -3,7 +3,9 @@
  */
 
 /* for O_DIRECT */
  */
 
 /* for O_DIRECT */
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 
 #include<stdio.h>
 #include<errno.h>
 
 #include<stdio.h>
 #include<errno.h>
index b32408c..31ac47d 100644 (file)
@@ -24,7 +24,9 @@
  */
 
 /* for O_DIRECTORY */
  */
 
 /* for O_DIRECTORY */
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 
 #include <stdlib.h>
 #include <stdio.h>
 
 #include <stdlib.h>
 #include <stdio.h>
index f1275b3..7c3bb5e 100644 (file)
@@ -22,7 +22,9 @@
  */
  /* Safely read the last_rcvd file from a device */
 
  */
  /* Safely read the last_rcvd file from a device */
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
index b6a7f26..99d03b0 100644 (file)
@@ -22,7 +22,9 @@
  */
  /* This source file is compiled into both mkfs.lustre and tunefs.lustre */
 
  */
  /* This source file is compiled into both mkfs.lustre and tunefs.lustre */
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
index 0ac707c..da37f91 100644 (file)
@@ -22,8 +22,9 @@
  *
  */
 
  *
  */
 
-
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>