Whamcloud - gitweb
LU-2675 cleanup: make bitfield (un)signedness explicit
authorJohn L. Hammond <john.hammond@intel.com>
Mon, 11 Feb 2013 18:23:33 +0000 (12:23 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 20 Feb 2013 03:05:30 +0000 (22:05 -0500)
Fix this common sparse warning (dubious one-bit signed bitfield) in
case ones-complement machines come back or something.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I24ea468efedd8a1269ea92022d13e802f4838ba1
Reviewed-on: http://review.whamcloud.com/5166
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Sebastien Buisson <sebastien.buisson@bull.net>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
16 files changed:
lnet/klnds/o2iblnd/o2iblnd.h
lnet/klnds/socklnd/socklnd.h
lnet/selftest/conrpc.h
lnet/selftest/selftest.h
lustre/fld/fld_internal.h
lustre/fld/lproc_fld.c
lustre/include/dt_object.h
lustre/include/lclient.h
lustre/include/md_object.h
lustre/include/obd.h
lustre/lod/lod_internal.h
lustre/lov/lov_cl_internal.h
lustre/mdd/mdd_device.c
lustre/mdt/mdt_internal.h
lustre/mgs/mgs_internal.h
lustre/osp/osp_internal.h

index 47b9cfa..2c8f637 100644 (file)
@@ -606,9 +606,9 @@ typedef struct kib_conn
         int                  ibc_outstanding_credits; /* # credits to return */
         int                  ibc_reserved_credits;/* # ACK/DONE msg credits */
         int                  ibc_comms_error;   /* set on comms error */
-        int                  ibc_nrx:16;        /* receive buffers owned */
-        int                  ibc_scheduled:1;   /* scheduled for attention */
-        int                  ibc_ready:1;       /* CQ callback fired */
+       unsigned int         ibc_nrx:16;        /* receive buffers owned */
+       unsigned int         ibc_scheduled:1;   /* scheduled for attention */
+       unsigned int         ibc_ready:1;       /* CQ callback fired */
         /* time of last send */
         unsigned long        ibc_last_send;
         /** link chain for kiblnd_check_conns only */
index 982a8d3..abdf25a 100644 (file)
@@ -296,10 +296,11 @@ typedef struct ksock_conn
         __u32               ksnc_myipaddr;   /* my IP */
         __u32               ksnc_ipaddr;     /* peer's IP */
         int                 ksnc_port;       /* peer's port */
-        int                 ksnc_type:3;     /* type of connection, should be signed value */
-        int                 ksnc_closing:1;  /* being shut down */
-        int                 ksnc_flip:1;     /* flip or not, only for V2.x */
-        int                 ksnc_zc_capable:1; /* enable to ZC */
+       signed int          ksnc_type:3;     /* type of connection,
+                                             * should be signed value */
+       unsigned int        ksnc_closing:1;  /* being shut down */
+       unsigned int        ksnc_flip:1;     /* flip or not, only for V2.x */
+       unsigned int        ksnc_zc_capable:1; /* enable to ZC */
         struct ksock_proto *ksnc_proto;      /* protocol for the connection */
 
         /* reader */
index 27ac86b..981b249 100644 (file)
@@ -70,11 +70,11 @@ typedef struct lstcon_rpc {
         struct lstcon_node      *crp_node;       /* destination node */
         struct lstcon_rpc_trans *crp_trans;     /* conrpc transaction */
 
-        int                      crp_posted:1;   /* rpc is posted */
-        int                      crp_finished:1; /* rpc is finished */
-        int                      crp_unpacked:1; /* reply is unpacked */
+       unsigned int             crp_posted:1;   /* rpc is posted */
+       unsigned int             crp_finished:1; /* rpc is finished */
+       unsigned int             crp_unpacked:1; /* reply is unpacked */
        /** RPC is embedded in other structure and can't free it */
-       int                      crp_embedded:1;
+       unsigned int             crp_embedded:1;
         int                      crp_status;     /* console rpc errors */
         cfs_time_t               crp_stamp;      /* replied time stamp */
 } lstcon_rpc_t;
index 3540b44..2b7f250 100644 (file)
@@ -378,15 +378,15 @@ typedef struct sfw_test_instance {
         sfw_batch_t            *tsi_batch;        /* batch */
         sfw_test_client_ops_t  *tsi_ops;          /* test client operations */
 
-        /* public parameter for all test units */
-        int                     tsi_is_client:1;     /* is test client */
-        int                     tsi_stoptsu_onerr:1; /* stop tsu on error */
+       /* public parameter for all test units */
+       unsigned int            tsi_is_client:1;     /* is test client */
+       unsigned int            tsi_stoptsu_onerr:1; /* stop tsu on error */
         int                     tsi_concur;          /* concurrency */
         int                     tsi_loop;            /* loop count */
 
        /* status of test instance */
        spinlock_t              tsi_lock;         /* serialize */
-        int                     tsi_stopping:1;   /* test is stopping */
+       unsigned int            tsi_stopping:1;   /* test is stopping */
         cfs_atomic_t            tsi_nactive;      /* # of active test unit */
         cfs_list_t              tsi_units;        /* test units */
         cfs_list_t              tsi_free_rpcs;    /* free rpcs */
index db6dad6..fbb050a 100644 (file)
@@ -112,7 +112,7 @@ struct fld_cache {
         /**
          * Cache name used for debug and messages. */
         char                     fci_name[80];
-       int                     fci_no_shrink:1;
+       unsigned int             fci_no_shrink:1;
 };
 
 enum fld_op {
index 52d517f..c68f3c4 100644 (file)
@@ -158,7 +158,7 @@ struct fld_seq_param {
        struct lu_env           fsp_env;
        struct dt_it            *fsp_it;
        struct lu_server_fld    *fsp_fld;
-       int                     fsp_stop:1;
+       unsigned int            fsp_stop:1;
 };
 
 static void *fldb_seq_start(struct seq_file *p, loff_t *pos)
index 4207f1c..fdd45bd 100644 (file)
@@ -752,10 +752,10 @@ struct thandle {
        __s32             th_result;
 
        /** whether we need sync commit */
-       int               th_sync:1;
+       unsigned int            th_sync:1;
 
        /* local transation, no need to inform other layers */
-       int               th_local:1;
+       unsigned int            th_local:1;
 
        /* In DNE, one transaction can be disassemblied into
         * updates on several different MDTs, and these updates
index 4a2631b..93169c7 100644 (file)
@@ -214,7 +214,7 @@ struct ccc_object {
         *
         * \see ll_dirty_page_discard_warn.
         */
-       int                     cob_discard_page_warned:1;
+       unsigned int            cob_discard_page_warned:1;
 };
 
 /**
index d1554ea..80722a5 100644 (file)
@@ -174,7 +174,6 @@ struct md_attr {
         struct lustre_capa     *ma_capa;
         struct md_som_data     *ma_som;
         int                     ma_lmm_size;
-        int                     ma_big_lmm_used:1;
         int                     ma_lmv_size;
         int                     ma_acl_size;
         int                     ma_cookie_size;
index 404fc4b..723d68b 100644 (file)
@@ -837,7 +837,7 @@ struct obd_trans_info {
         struct llog_cookie      *oti_logcookies;
         int                      oti_numcookies;
        /** synchronous write is needed */
-       long                     oti_sync_write:1;
+       unsigned long            oti_sync_write:1;
 
         /* initial thread handling transaction */
         struct ptlrpc_thread *   oti_thread;
index a83479d..dcf7d6e 100644 (file)
@@ -157,7 +157,7 @@ struct lod_object {
        int                ldo_stripes_allocated;
        /* default striping for directory represented by this object
         * is cached in stripenr/stripe_size */
-       int                ldo_striping_cached:1,
+       unsigned int       ldo_striping_cached:1,
                           ldo_def_striping_set:1;
        __u32              ldo_def_stripe_size;
        __u16              ldo_def_stripenr;
index d0bb9ae..5c43cbb 100644 (file)
@@ -303,7 +303,7 @@ struct lov_lock {
          * Set when sub-lock was canceled, while top-lock was being
          * used, or unused.
          */
-        int                    lls_cancel_race:1;
+       unsigned int           lls_cancel_race:1;
         /**
          * An array of sub-locks
          *
index 007b999..639b688 100644 (file)
@@ -1503,7 +1503,7 @@ struct mdd_changelog_user_data {
         __u32 mcud_id;
         __u32 mcud_minid;  /**< user id with lowest rec reference */
         __u32 mcud_usercount;
-        int   mcud_found:1;
+       unsigned int mcud_found:1;
 };
 #define MCUD_UNREGISTER -1LL
 
index 3473c94..2b65a37 100644 (file)
@@ -119,17 +119,17 @@ struct mdt_device {
        struct obd_export         *mdt_bottom_exp;
         /** target device */
         struct lu_target           mdt_lut;
-        /*
-         * Options bit-fields.
-         */
-        struct {
-                signed int         mo_user_xattr :1,
-                                   mo_acl        :1,
-                                   mo_compat_resname:1,
-                                   mo_mds_capa   :1,
-                                   mo_oss_capa   :1,
-                                   mo_cos        :1;
-        } mdt_opts;
+       /*
+        * Options bit-fields.
+        */
+       struct {
+               unsigned int       mo_user_xattr:1,
+                                  mo_acl:1,
+                                  mo_compat_resname:1,
+                                  mo_mds_capa:1,
+                                  mo_oss_capa:1,
+                                  mo_cos:1;
+       } mdt_opts;
         /* mdt state flags */
         unsigned long              mdt_state;
         /* lock to protect IOepoch */
index 00aae38..df1217c 100644 (file)
@@ -148,7 +148,7 @@ struct fs_db {
        struct completion       fsdb_notify_comp;
         cfs_time_t           fsdb_notify_start;
         cfs_atomic_t         fsdb_notify_phase;
-        volatile int         fsdb_notify_async:1,
+       volatile unsigned int fsdb_notify_async:1,
                              fsdb_notify_stop:1;
         /* statistic data */
         unsigned int         fsdb_notify_total;
index ed3057f..c32356b 100644 (file)
@@ -97,7 +97,7 @@ struct osp_device {
        int                              opd_got_disconnected;
        int                              opd_imp_connected;
        int                              opd_imp_active;
-       int                              opd_imp_seen_connected:1,
+       unsigned int                     opd_imp_seen_connected:1,
                                         opd_connect_mdt:1;
 
        /* whether local recovery is completed:
@@ -186,7 +186,7 @@ extern cfs_mem_cache_t *osp_object_kmem;
 struct osp_object {
        struct lu_object_header opo_header;
        struct dt_object        opo_obj;
-       int                     opo_reserved:1,
+       unsigned int            opo_reserved:1,
                                opo_new:1,
                                opo_empty:1;