Whamcloud - gitweb
LU-4993 libcfs: convert nodemask_t to linux bitmask
[fs/lustre-release.git] / libcfs / include / libcfs / libcfs_private.h
index 42f1bc5..4afb764 100644 (file)
@@ -194,7 +194,7 @@ do {                                                                            \
  * default allocator
  */
 #define LIBCFS_ALLOC(ptr, size) \
-       LIBCFS_ALLOC_GFP(ptr, size, __GFP_IO)
+       LIBCFS_ALLOC_GFP(ptr, size, GFP_NOFS)
 
 /**
  * non-sleeping allocator
@@ -218,7 +218,7 @@ do {                                                                            \
 
 /** default numa allocator */
 #define LIBCFS_CPT_ALLOC(ptr, cptab, cpt, size)                                    \
-       LIBCFS_CPT_ALLOC_GFP(ptr, cptab, cpt, size, __GFP_IO)
+       LIBCFS_CPT_ALLOC_GFP(ptr, cptab, cpt, size, GFP_NOFS)
 
 #define LIBCFS_FREE(ptr, size)                                         \
 do {                                                                   \
@@ -320,6 +320,8 @@ int libcfs_debug_cleanup(void);
 /* !__KERNEL__ */
 #endif
 
+struct cfs_cpt_table;
+
 /*
  * allocate per-cpu-partition data, returned value is an array of pointers,
  * variable can be indexed by CPU ID.
@@ -474,11 +476,7 @@ struct cfs_percpt_lock {
 };
 
 /* return number of private locks */
-static inline int
-cfs_percpt_lock_num(struct cfs_percpt_lock *pcl)
-{
-       return cfs_cpt_number(pcl->pcl_cptab);
-}
+#define cfs_percpt_lock_num(pcl)       cfs_cpt_number(pcl->pcl_cptab)
 
 #else /* !__KERNEL__ */
 
@@ -534,22 +532,28 @@ int cfs_percpt_atomic_summary(atomic_t **refs);
  *       value  after  conversion...
  *
  */
-#define CLASSERT(cond) do {switch(42) {case (cond): case 0: break;}} while (0)
+#define CLASSERT(cond) do {switch (1) {case (cond): case 0: break; } } while (0)
 
 /* support decl needed both by kernel and liblustre */
-int         libcfs_isknown_lnd(int type);
-char       *libcfs_lnd2modname(int type);
-char       *libcfs_lnd2str(int type);
-int         libcfs_str2lnd(const char *str);
-char       *libcfs_net2str(__u32 net);
-char       *libcfs_nid2str(lnet_nid_t nid);
-__u32       libcfs_str2net(const char *str);
-lnet_nid_t  libcfs_str2nid(const char *str);
-int         libcfs_str2anynid(lnet_nid_t *nid, const char *str);
-char       *libcfs_id2str(lnet_process_id_t id);
-void        cfs_free_nidlist(cfs_list_t *list);
-int         cfs_parse_nidlist(char *str, int len, cfs_list_t *list);
-int         cfs_match_nid(lnet_nid_t nid, cfs_list_t *list);
+int             libcfs_isknown_lnd(int type);
+char           *libcfs_lnd2modname(int type);
+char           *libcfs_lnd2str(int type);
+int             libcfs_str2lnd(const char *str);
+char           *libcfs_net2str(__u32 net);
+char           *libcfs_nid2str(lnet_nid_t nid);
+__u32           libcfs_str2net(const char *str);
+lnet_nid_t      libcfs_str2nid(const char *str);
+int             libcfs_str2anynid(lnet_nid_t *nid, const char *str);
+char           *libcfs_id2str(lnet_process_id_t id);
+void            cfs_free_nidlist(struct list_head *list);
+int             cfs_parse_nidlist(char *str, int len, struct list_head *list);
+int             cfs_print_nidlist(char *buffer, int count,
+                                  struct list_head *list);
+int             cfs_match_nid(lnet_nid_t nid, struct list_head *list);
+bool            cfs_nidrange_is_contiguous(struct list_head *nidlist);
+void            cfs_nidrange_find_min_max(struct list_head *nidlist,
+                                          char *min_nid, char *max_nid,
+                                          int nidstr_length);
 
 /** \addtogroup lnet_addr
  * @{ */
@@ -578,12 +582,6 @@ int         cfs_match_nid(lnet_nid_t nid, cfs_list_t *list);
 # define CFS_CURRENT_TIME time(0)
 #endif
 
-/* --------------------------------------------------------------------
- * Light-weight trace
- * Support for temporary event tracing with minimal Heisenberg effect.
- * All stuff about lwt are put in arch/kp30.h
- * -------------------------------------------------------------------- */
-
 struct libcfs_device_userstate
 {
        int             ldu_memhog_pages;
@@ -662,15 +660,6 @@ do {                                                            \
         ptr += cfs_size_round(len);                             \
 } while (0)
 
-#define LOGL0(var,len,ptr)                              \
-do {                                                    \
-        if (!len)                                       \
-                break;                                  \
-        memcpy((char *)ptr, (const char *)var, len);    \
-        *((char *)(ptr) + len) = 0;                     \
-        ptr += cfs_size_round(len + 1);                 \
-} while (0)
-
 /**
  *  Lustre Network Driver types.
  */
@@ -690,6 +679,7 @@ enum {
         VIBLND    = 11,
         MXLND     = 12,
         GNILND    = 13,
+       GNIIPLND  = 14,
 };
 
 #endif