Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / include / liblustre.h
index ac40f53..5d357c7 100644 (file)
@@ -16,8 +16,8 @@
  * in the LICENSE file that accompanied this code).
  *
  * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
  *
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
@@ -71,7 +71,7 @@ typedef unsigned short umode_t;
 /*
  * The inter_module_get implementation is specific to liblustre, so this needs
  * to stay here for now.
- */ 
+ */
 static inline void inter_module_put(void *a)
 {
         return;
@@ -86,17 +86,30 @@ void *inter_module_get(char *arg);
 
 static __inline__ int ext2_set_bit(int nr, void *addr)
 {
+#ifdef __BIG_ENDIAN
+        return set_bit((nr ^ ((BITS_PER_LONG-1) & ~0x7)), addr);
+#else
         return set_bit(nr, addr);
+#endif
 }
 
 static __inline__ int ext2_clear_bit(int nr, void *addr)
 {
+#ifdef __BIG_ENDIAN
+        return clear_bit((nr ^ ((BITS_PER_LONG-1) & ~0x7)), addr);
+#else
         return clear_bit(nr, addr);
+#endif
 }
 
 static __inline__ int ext2_test_bit(int nr, void *addr)
 {
+#ifdef __BIG_ENDIAN
+        __const__ unsigned char *tmp = (__const__ unsigned char *) addr;
+        return (tmp[nr >> 3] >> (nr & 7)) & 1;
+#else
         return test_bit(nr, addr);
+#endif
 }
 
 
@@ -251,6 +264,7 @@ struct task_struct {
         int ngroups;
         gid_t *groups;
         __u32 cap_effective;
+        void *journal_info;
 };
 
 
@@ -261,13 +275,6 @@ typedef struct task_struct cfs_task_t;
 
 extern struct task_struct *current;
 int in_group_p(gid_t gid);
-static inline int capable(int cap)
-{
-        if (current->cap_effective & (1 << cap))
-                return 1;
-        else
-                return 0;
-}
 
 #define set_current_state(foo) do { current->state = foo; } while (0)
 
@@ -348,6 +355,10 @@ int test_and_clear_bit(int nr, unsigned long *addr)
         return oldbit;
 }
 
+#define libcfs_memory_pressure_get() (0) 
+#define libcfs_memory_pressure_put() do {} while (0) 
+#define libcfs_memory_pressure_clr() do {} while (0)
+
 /* FIXME sys/capability will finally included linux/fs.h thus
  * cause numerous trouble on x86-64. as temporary solution for
  * build broken at Cray, we copy definition we need from capability.h
@@ -366,12 +377,6 @@ typedef enum {
     CAP_SET=1
 } cap_flag_value_t;
 
-#define CAP_DAC_OVERRIDE        1
-#define CAP_DAC_READ_SEARCH     2
-#define CAP_FOWNER              3
-#define CAP_FSETID              4
-#define CAP_SYS_ADMIN          21
-
 cap_t   cap_get_proc(void);
 int     cap_get_flag(cap_t, cap_value_t, cap_flag_t, cap_flag_value_t *);
 
@@ -391,7 +396,7 @@ void *liblustre_register_wait_callback(const char *name,
 void liblustre_deregister_wait_callback(void *notifier);
 int liblustre_wait_event(int timeout);
 
-void *liblustre_register_idle_callback(const char *name, 
+void *liblustre_register_idle_callback(const char *name,
                                        int (*fn)(void *arg), void *arg);
 void liblustre_deregister_idle_callback(void *notifier);
 void liblustre_wait_idle(void);
@@ -497,10 +502,10 @@ void posix_acl_release(struct posix_acl *acl)
 }
 
 #ifdef LIBLUSTRE_POSIX_ACL
-# ifndef posix_acl_xattr_entry 
+# ifndef posix_acl_xattr_entry
 #  define posix_acl_xattr_entry xattr_acl_entry
 # endif
-# ifndef posix_acl_xattr_header 
+# ifndef posix_acl_xattr_header
 #  define posix_acl_xattr_header xattr_acl_header
 # endif
 # ifndef posix_acl_xattr_size