Whamcloud - gitweb
liblustre: define ARRAY_SIZE() if not already defined.
authornikita <nikita>
Thu, 18 May 2006 20:57:51 +0000 (20:57 +0000)
committernikita <nikita>
Thu, 18 May 2006 20:57:51 +0000 (20:57 +0000)
lustre/include/liblustre.h

index 9b8d4aa..b0f21cb 100644 (file)
@@ -85,6 +85,10 @@ typedef unsigned short umode_t;
 # define CURRENT_SECONDS time(0)
 #endif
 
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) ((sizeof (a))/(sizeof ((a)[0])))
+#endif
+
 /* This is because lprocfs_status.h gets included here indirectly.  It would
  * be much better to just avoid lprocfs being included into liblustre entirely
  * but that requires more header surgery than I can handle right now.
@@ -799,7 +803,7 @@ struct file_lock {
         unsigned long fl_break_time;    /* for nonblocking lease breaks */
 
         union {
-                struct nfs_lock_info    nfs_fl;       
+                struct nfs_lock_info    nfs_fl;
         } fl_u;
 };