if (ktx->ktx_nmappedpages == 0)
return;
-
+
CDEBUG(D_NET, "%p unloading %d frags starting at %d\n",
ktx, ktx->ktx_nfrag, ktx->ktx_firsttmpfrag);
}
int
-kqswnal_map_tx_kiov (kqswnal_tx_t *ktx, int offset, int nob,
+kqswnal_map_tx_kiov (kqswnal_tx_t *ktx, int offset, int nob,
unsigned int niov, lnet_kiov_t *kiov)
{
int nfrags = ktx->ktx_nfrag;
])
])
+AC_DEFUN([LC_ATOMIC_CMPXCHG],
+[AC_MSG_CHECKING([if kernel has atomic_cmpxchg])
+LB_LINUX_TRY_COMPILE([
+ #include <asm/atomic.h>
+],[
+ #ifndef atomic_cmpxchg
+ #error missing atomic_cmpxchg
+ #endif
+],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_ATOMIC_CMPXCHG, 1, [kernel has atomic_cmpxchg])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+AC_DEFUN([LC_ATOMIC_INC_NOT_ZERO],
+[AC_MSG_CHECKING([if kernel has atomic_inc_not_zero])
+LB_LINUX_TRY_COMPILE([
+ #include <asm/atomic.h>
+],[
+ #ifndef atomic_inc_not_zero
+ #error missing atomic_inc_not_zero
+ #endif
+],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_ATOMIC_INC_NOT_ZERO, 1, [kernel has atomic_inc_not_zero])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
#
# LC_PROG_LINUX
#
# 2.6.15
LC_INODE_I_MUTEX
+ LC_ATOMIC_CMPXCHG
+ LC_ATOMIC_INC_NOT_ZERO
# 2.6.16
LC_SECURITY_PLUG # for SLES10 SP2
#else
#define ll_update_time(file) inode_update_time(file->f_mapping->host, 1)
#endif
+
+/* Needed for sles9 */
+#ifndef HAVE_ATOMIC_CMPXCHG
+#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new))
+#endif
+
+/* Needed for rhel4 and sles9 */
+#ifndef HAVE_ATOMIC_INC_NOT_ZERO
+/**
+ * atomic_add_unless - add unless the number is a given value
+ * @v: pointer of type atomic_t
+ * @a: the amount to add to v...
+ * @u: ...unless v is equal to u.
+ *
+ * Atomically adds @a to @v, so long as it was not @u.
+ * Returns non-zero if @v was not @u, and zero otherwise.
+ */
+#define atomic_add_unless(v, a, u) \
+({ \
+ int c, old; \
+ c = atomic_read(v); \
+ while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
+ c = old; \
+ c != (u); \
+})
+#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
+#endif /* !atomic_inc_not_zero */
+
#endif /* __KERNEL__ */
#endif /* _COMPAT25_H */
#include <linux/highmem.h>
#include <linux/gfp.h>
#include <linux/swap.h>
-#include <linux/pagevec.h>
#include <asm/uaccess.h>
#include <sys/types.h>
#include <sys/xattr.h>
#include <lustre/lustre_user.h>
+#include <liblustre.h>
int main(int argc, char *argv[])
{
"(%d bytes), recompile?\n",
argv[i], size);
} else {
- printf("%s: objid=%llu group=%llu inode=%llu generation=%u stripe=%u\n",
+ printf("%s: objid="LPU64" group="LPU64" inode="LPU64" generation=%u stripe=%u\n",
argv[i], ff->ff_objid, ff->ff_group,
ff->ff_fid.id, ff->ff_fid.generation,
ff->ff_fid.f_type);