* 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);
EXTRA_DIST = kp30.h libcfs.h linux-fs.h linux-lock.h linux-mem.h \
linux-prim.h linux-time.h linux-tcpip.h linux-cpu.h \
- portals_compat25.h linux-bitops.h linux-crypto.h
+ portals_compat25.h linux-crypto.h
#include <libcfs/linux/linux-lock.h>
#include <libcfs/linux/linux-fs.h>
#include <libcfs/linux/linux-tcpip.h>
-#include <libcfs/linux/linux-bitops.h>
#include <libcfs/linux/kp30.h>
#ifdef HAVE_ASM_TYPES_H
#include <asm/timex.h>
#include <linux/sched.h> /* THREAD_SIZE */
#include <linux/rbtree.h>
+#include <linux/bitops.h>
#if !defined(__x86_64__)
# ifdef __ia64__
#ifndef __LIBCFS_LINUX_PORTALS_COMPAT_H__
#define __LIBCFS_LINUX_PORTALS_COMPAT_H__
-#ifndef __user
-#define __user
-#endif
-
#define LL_PROC_PROTO(name) \
name(struct ctl_table *table, int write, \
void __user *buffer, size_t *lenp, loff_t *ppos)
libcfsposix_HEADERS = posix-types.h
endif
-EXTRA_DIST = libcfs.h posix-wordsize.h posix-types.h posix-crypto.h
+EXTRA_DIST = libcfs.h posix-wordsize.h posix-types.h posix-crypto.h
\ No newline at end of file
#include <sys/utsname.h>
#include <ctype.h>
#include <stdbool.h>
+#include <limits.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
#define __swab64s(x) do { *(x) = __swab64(*(x)); } while (0)
#endif
-#if !defined(ALIGN)
-#define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
-#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1)
-#endif
-
# ifndef THREAD_SIZE /* x86_64 linux has THREAD_SIZE in userspace */
# define THREAD_SIZE 8192
# else
# define DTTOIF(dirtype) ((dirtype) << IFSHIFT)
# endif
+#ifndef ERESTARTSYS
+#define ERESTARTSYS ERESTART
+#endif
+
#endif
#ifndef _LUSTRE_POSIX_TYPES_H
#define _LUSTRE_POSIX_TYPES_H
-#include <asm/types.h>
+#ifdef HAVE_LINUX_TYPES_H
+# include <linux/types.h>
+#endif
#include <stdbool.h> /* for bool */
#ifndef HAVE_UMODE_T
typedef unsigned short umode_t;
# define LP_POISON ((void *)(long)0x5a5a5a5a)
#endif
-#if (defined(__KERNEL__) && defined(HAVE_KERN__U64_LONG_LONG)) || \
- (!defined(__KERNEL__) && defined(HAVE_USER__U64_LONG_LONG))
-/* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */
# define LPU64 "%llu"
# define LPD64 "%lld"
# define LPX64 "%#llx"
# define LPX64i "%llx"
# define LPO64 "%#llo"
# define LPF64 "ll"
-#elif (BITS_PER_LONG == 32)
-# define LPU64 "%llu"
-# define LPD64 "%lld"
-# define LPX64 "%#llx"
-# define LPX64i "%llx"
-# define LPO64 "%#llo"
-# define LPF64 "L"
-#elif (BITS_PER_LONG == 64)
-# define LPU64 "%lu"
-# define LPD64 "%ld"
-# define LPX64i "%lx"
-# define LPX64 "%#lx"
-# define LPO64 "%#lo"
-# define LPF64 "l"
-#endif
-
-#ifndef LPU64
-# error "No word size defined"
-#endif
/*
* long_ptr_t & ulong_ptr_t, same to "long" for gcc
}
/* using binary seach */
-static __inline__ unsigned long fls(long data)
+static inline unsigned long __fls(long data)
{
int pos = 32;
return pos;
}
-static __inline__ unsigned long __cfs_ffs(long data)
+static inline unsigned long __ffs(long data)
{
int pos = 0;
return pos;
}
-#define ffz(x) ffs(~(x))
-#define flz(x) fls(~(x))
+#define __ffz(x) __ffs(~(x))
+#define __flz(x) __fls(~(x))
unsigned long find_next_bit(unsigned long *addr,
unsigned long size, unsigned long offset);
# define EXPORT_SYMBOL(s)
#endif
-#ifndef __KERNEL__
-
typedef struct proc_dir_entry cfs_proc_dir_entry_t;
/*
return 0;
}
-#define cfs_sigfillset(l) do {} while (0)
#define cfs_recalc_sigpending(l) do {} while (0)
#define DAEMON_FLAGS 0
/* !__WINNT__ */
#endif
-/* !__KERNEL__ */
-#endif
/* __LIBCFS_USER_PRIM_H__ */
#endif
return r;
}
-static inline unsigned long __cfs_ffs(unsigned long word)
+static inline unsigned long __ffs(unsigned long word)
{
int num = 0;
* Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
*/
static inline
-int fls(int x)
+int __fls(int x)
{
int r = 32;
while (x < size) {
unsigned long val = *addr++;
if (val)
- return __cfs_ffs(val) + x;
+ return __ffs(val) + x;
x += (sizeof(*addr)<<3);
}
return x;
*
* - init_mutex(x)
* - init_mutex_locked(x)
- * - mutex_up(x)
- * - mutex_down(x)
+ * - mutex_unlock(x)
+ * - mutex_lock(x)
*/
#define mutex semaphore
#endif
}
total += bd.bd_bucket->hsb_count;
- dist[min(fls(bd.bd_bucket->hsb_count/max(theta,1)),7)]++;
+ dist[min(__fls(bd.bd_bucket->hsb_count/max(theta,1)),7UL)]++;
cfs_hash_bd_unlock(hs, &bd, 0);
}
#endif
}
total += bd.bd_bucket->hsb_count;
- dist[min(fls(bd.bd_bucket->hsb_count/max(theta,1)),7)]++;
+ dist[min(__fls(bd.bd_bucket->hsb_count/max(theta,1)),7UL)]++;
cfs_hash_bd_unlock(hs, &bd, 0);
}
-EXTRA_DIST = posix-debug.c
+EXTRA_DIST = posix-debug.c posix-tracefile.h
+
gettimeofday(&tv, NULL);
fprintf(debug_file_fd, CFS_TIME_T".%06lu:%u:%s:(%s:%d:%s()): %s",
- tv.tv_sec, tv.tv_usec, source_pid, source_nid,
+ tv.tv_sec, (unsigned long)tv.tv_usec, source_pid, source_nid,
msgdata->msg_file, msgdata->msg_line, msgdata->msg_fn, buf);
return 0;
*
* You should have received a copy of the GNU General Public License
* 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
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.htm
*
* GPL HEADER END
*/
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
+ * libcfs/libcfs/posix/posix-tracefile.h
*
- * libcfs/include/libcfs/linux/linux-bitops.h
+ * Userspace debugging-tracing
*/
-#include <linux/bitops.h>
+#ifndef __LIBCFS_POSIX_TRACEFILE_H__
+#define __LIBCFS_POSIX_TRACEFILE_H__
+
+/**
+ * three types of trace_data in linux
+ * posix need to max of available types to have
+ * type checking happy.
+ */
+typedef enum {
+ CFS_TCD_TYPE_PROC = 0,
+ CFS_TCD_TYPE_SOFTIRQ,
+ CFS_TCD_TYPE_IRQ,
+ CFS_TCD_TYPE_MAX
+} cfs_trace_buf_type_t;
+#endif
#include <libcfs/libcfs.h>
+#ifdef __KERNEL__
#if defined(__linux__)
#include "linux/linux-tracefile.h"
#elif defined(__WINNT__)
#else
#error Unsupported operating system.
#endif
-
+#else
+#include "posix/posix-tracefile.h"
+#endif
/* trace file lock routines */
#define TRACEFILE_NAME_SIZE 1024
return size;
if (first_bit != 0) {
int tmp = (*word++) & (~0UL << first_bit);
- bit = __cfs_ffs(tmp);
+ bit = __ffs(tmp);
if (bit < BITS_PER_LONG)
goto found;
word++;
}
while (word <= last) {
if (*word != 0UL) {
- bit = __cfs_ffs(*word);
+ bit = __ffs(*word);
goto found;
}
word++;
return size;
if (first_bit != 0) {
int tmp = (*word++) & (~0UL << first_bit);
- bit = ffz(tmp);
+ bit = __ffz(tmp);
if (bit < BITS_PER_LONG)
goto found;
word++;
}
while (word <= last) {
if (*word != ~0UL) {
- bit = ffz(*word);
+ bit = __ffz(*word);
goto found;
}
word++;
int rc;
int option = nagle ? 0 : 1;
-#if defined(__sun__) || defined(__sun)
rc = setsockopt(sock->s_fd,
IPPROTO_TCP, TCP_NODELAY, &option, sizeof(option));
-#else
- rc = setsockopt(sock->s_fd,
- SOL_TCP, TCP_NODELAY, &option, sizeof(option));
-#endif
-
if (rc != 0) {
rc = -errno;
CERROR ("Cannot set NODELAY socket option\n");
struct mutex proc_fs_lock;
#define INIT_PROCFS_LOCK() cfs_init_mutex(&proc_fs_lock)
-#define LOCK_PROCFS() cfs_mutex_down(&proc_fs_lock)
-#define UNLOCK_PROCFS() cfs_mutex_up(&proc_fs_lock)
+#define LOCK_PROCFS() mutex_lock(&proc_fs_lock)
+#define UNLOCK_PROCFS() mutex_unlock(&proc_fs_lock)
#endif
cd $(TESTDIR); rm -rf Makefile Makefile.in .deps
tests: $(lib_LIBRARIES) FORCE
- cd $(TESTDIR); make
+ cd $(TESTDIR); ${MAKE}
testsclean: FORCE
- cd $(TESTDIR); make clean
+ cd $(TESTDIR); ${MAKE} clean
clean: testsclean clean-am
FORCE:
SUBDIRS = lnet klnds ulnds selftest doc utils include \
autoconf
+
+DIST_SUBDIRS = lnet klnds ulnds selftest doc utils include \
+ autoconf
ALL_OBJS=
build_obj_list() {
- _objs=`$AR -t $1/$2`
+ _objs=`$AR -t $1/$2 | grep -v SYMDEF | grep -v SORTED`
for _lib in $_objs; do
ALL_OBJS=$ALL_OBJS"$1/$_lib ";
done;
#ifdef __KERNEL__
# include <libcfs/libcfs.h>
# include <linux/module.h>
-# include <asm/div64.h>
+# include <linux/math64.h>
#else /* __KERNEL__ */
# include <liblustre.h>
# include <libcfs/list.h>
#ifdef __KERNEL__
# include <libcfs/libcfs.h>
# include <linux/module.h>
-# include <asm/div64.h>
+# include <linux/math64.h>
#else /* __KERNEL__ */
# include <liblustre.h>
# include <libcfs/list.h>
/*
* super-class definitions.
*/
+#include <libcfs/libcfs.h>
#include <lu_object.h>
+
#ifdef __KERNEL__
# include <linux/mutex.h>
# include <linux/radix-tree.h>
CLM_PHANTOM,
CLM_READ,
CLM_WRITE,
- CLM_GROUP
+ CLM_GROUP,
+ CLM_MAX,
};
/**
*/
#ifndef __DARWIN_LUSTRE_HANDLES_H_
-#define __DARWIN_LUSTR_HANDLES_H_
+#define __DARWIN_LUSTRE_HANDLES_H_
#ifndef __LUSTRE_HANDLES_H_
#error Do not #include this file directly. #include <lustre_handles.h> instead
#ifndef __KERNEL__
/* for llmount */
-# define _GNU_SOURCE
# include <getopt.h>
# include <sys/utsname.h>
# include <sys/stat.h>
({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
#endif
-/* registering symbols */
-#ifndef ERESTARTSYS
-#define ERESTARTSYS ERESTART
-#endif
+#define simple_strtol strtol
#ifdef HZ
#undef HZ
#define __LVFS_H__
#include <libcfs/libcfs.h>
+
+struct lvfs_callback_ops {
+ struct dentry *(*l_fid2dentry)(__u64 id_ino, __u32 gen, __u64 gr,
+ void *data);
+};
+
#if defined(__linux__)
#include <linux/lvfs.h>
#elif defined(__APPLE__)
/* ptlrpc_sec_ctx.c */
void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx);
void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx);
+
#endif
EXPORT_SYMBOL(target_send_reply);
ldlm_mode_t lck_compat_array[] = {
- [LCK_EX] LCK_COMPAT_EX,
- [LCK_PW] LCK_COMPAT_PW,
- [LCK_PR] LCK_COMPAT_PR,
- [LCK_CW] LCK_COMPAT_CW,
- [LCK_CR] LCK_COMPAT_CR,
- [LCK_NL] LCK_COMPAT_NL,
- [LCK_GROUP] LCK_COMPAT_GROUP,
- [LCK_COS] LCK_COMPAT_COS,
+ [LCK_EX] = LCK_COMPAT_EX,
+ [LCK_PW] = LCK_COMPAT_PW,
+ [LCK_PR] = LCK_COMPAT_PR,
+ [LCK_CW] = LCK_COMPAT_CW,
+ [LCK_CR] = LCK_COMPAT_CR,
+ [LCK_NL] = LCK_COMPAT_NL,
+ [LCK_GROUP] = LCK_COMPAT_GROUP,
+ [LCK_COS] = LCK_COMPAT_COS,
};
/**
/* lock types */
char *ldlm_lockname[] = {
- [0] "--",
- [LCK_EX] "EX",
- [LCK_PW] "PW",
- [LCK_PR] "PR",
- [LCK_CW] "CW",
- [LCK_CR] "CR",
- [LCK_NL] "NL",
- [LCK_GROUP] "GROUP",
- [LCK_COS] "COS"
+ [0] = "--",
+ [LCK_EX] = "EX",
+ [LCK_PW] = "PW",
+ [LCK_PR] = "PR",
+ [LCK_CW] = "CW",
+ [LCK_CR] = "CR",
+ [LCK_NL] = "NL",
+ [LCK_GROUP] = "GROUP",
+ [LCK_COS] = "COS"
};
EXPORT_SYMBOL(ldlm_lockname);
char *ldlm_typename[] = {
- [LDLM_PLAIN] "PLN",
- [LDLM_EXTENT] "EXT",
- [LDLM_FLOCK] "FLK",
- [LDLM_IBITS] "IBT",
+ [LDLM_PLAIN] = "PLN",
+ [LDLM_EXTENT] = "EXT",
+ [LDLM_FLOCK] = "FLK",
+ [LDLM_IBITS] = "IBT",
};
EXPORT_SYMBOL(ldlm_typename);
static ldlm_policy_wire_to_local_t ldlm_policy_wire18_to_local[] = {
- [LDLM_PLAIN - LDLM_MIN_TYPE] ldlm_plain_policy_wire_to_local,
- [LDLM_EXTENT - LDLM_MIN_TYPE] ldlm_extent_policy_wire_to_local,
- [LDLM_FLOCK - LDLM_MIN_TYPE] ldlm_flock_policy_wire18_to_local,
- [LDLM_IBITS - LDLM_MIN_TYPE] ldlm_ibits_policy_wire_to_local,
+ [LDLM_PLAIN - LDLM_MIN_TYPE] = ldlm_plain_policy_wire_to_local,
+ [LDLM_EXTENT - LDLM_MIN_TYPE] = ldlm_extent_policy_wire_to_local,
+ [LDLM_FLOCK - LDLM_MIN_TYPE] = ldlm_flock_policy_wire18_to_local,
+ [LDLM_IBITS - LDLM_MIN_TYPE] = ldlm_ibits_policy_wire_to_local,
};
static ldlm_policy_wire_to_local_t ldlm_policy_wire21_to_local[] = {
- [LDLM_PLAIN - LDLM_MIN_TYPE] ldlm_plain_policy_wire_to_local,
- [LDLM_EXTENT - LDLM_MIN_TYPE] ldlm_extent_policy_wire_to_local,
- [LDLM_FLOCK - LDLM_MIN_TYPE] ldlm_flock_policy_wire21_to_local,
- [LDLM_IBITS - LDLM_MIN_TYPE] ldlm_ibits_policy_wire_to_local,
+ [LDLM_PLAIN - LDLM_MIN_TYPE] = ldlm_plain_policy_wire_to_local,
+ [LDLM_EXTENT - LDLM_MIN_TYPE] = ldlm_extent_policy_wire_to_local,
+ [LDLM_FLOCK - LDLM_MIN_TYPE] = ldlm_flock_policy_wire21_to_local,
+ [LDLM_IBITS - LDLM_MIN_TYPE] = ldlm_ibits_policy_wire_to_local,
};
static ldlm_policy_local_to_wire_t ldlm_policy_local_to_wire[] = {
- [LDLM_PLAIN - LDLM_MIN_TYPE] ldlm_plain_policy_local_to_wire,
- [LDLM_EXTENT - LDLM_MIN_TYPE] ldlm_extent_policy_local_to_wire,
- [LDLM_FLOCK - LDLM_MIN_TYPE] ldlm_flock_policy_local_to_wire,
- [LDLM_IBITS - LDLM_MIN_TYPE] ldlm_ibits_policy_local_to_wire,
+ [LDLM_PLAIN - LDLM_MIN_TYPE] = ldlm_plain_policy_local_to_wire,
+ [LDLM_EXTENT - LDLM_MIN_TYPE] = ldlm_extent_policy_local_to_wire,
+ [LDLM_FLOCK - LDLM_MIN_TYPE] = ldlm_flock_policy_local_to_wire,
+ [LDLM_IBITS - LDLM_MIN_TYPE] = ldlm_ibits_policy_local_to_wire,
};
/**
#ifdef HAVE_SERVER_SUPPORT
static ldlm_processing_policy ldlm_processing_policy_table[] = {
- [LDLM_PLAIN] ldlm_process_plain_lock,
- [LDLM_EXTENT] ldlm_process_extent_lock,
+ [LDLM_PLAIN] = ldlm_process_plain_lock,
+ [LDLM_EXTENT] = ldlm_process_extent_lock,
# ifdef __KERNEL__
- [LDLM_FLOCK] ldlm_process_flock_lock,
+ [LDLM_FLOCK] = ldlm_process_flock_lock,
# endif
- [LDLM_IBITS] ldlm_process_inodebits_lock,
+ [LDLM_IBITS] = ldlm_process_inodebits_lock,
};
ldlm_processing_policy ldlm_get_processing_policy(struct ldlm_resource *res)
ldlm_iterator_t iter, void *closure)
{
- struct iter_helper_data helper = { iter: iter, closure: closure };
+ struct iter_helper_data helper = { .iter = iter, .closure = closure };
cfs_hash_for_each_nolock(ns->ns_rs_hash,
ldlm_res_iter_helper, &helper);
## Liblustre excecutables & libraries Makefile
SUBDIRS = . tests
-AM_CPPFLAGS = $(HAVE_EFENCE) -I$(SYSIO)/include -D_LARGEFILE64_SOURCE=1 \
+AM_CPPFLAGS = $(HAVE_EFENCE) -I$(SYSIO)/include \
$(LLCPPFLAGS) -I$(top_srcdir)/lnet/ulnds
AM_CFLAGS = $(LLCFLAGS)
static int filldir(char *buf, int buflen, const char *name, int namelen,
loff_t offset, ino_t ino, unsigned int d_type, int *filled)
{
- struct dirent64 *dirent = (struct dirent64 *)(buf + *filled);
- struct dirent64 holder;
+ struct intnl_dirent *dirent = (struct intnl_dirent *)(buf + *filled);
+ struct intnl_dirent holder;
int reclen = ROUND_UP64(NAME_OFFSET(dirent) + namelen + 1);
/*
ALL_OBJS=
build_obj_list() {
- _objs=`$AR -t $1/$2`
+ _objs=`$AR -t $1/$2 | grep -v SYMDEF | grep -v SORTED`
for _lib in $_objs; do
ALL_OBJS=$ALL_OBJS"$1/$_lib ";
done;
sysio_tmp=$CWD/sysio_tmp_`date +%s`
rm -rf $sysio_tmp
build_sysio_obj_list() {
- _objs=`$AR -t $1`
+ _objs=`$AR -t $1 | grep -v SYMDEF | grep -v SORTED`
mkdir -p $sysio_tmp
cd $sysio_tmp
$AR -x $1
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/pagemap.h>
-#include <asm/div64.h>
+#include <linux/math64.h>
#include <linux/seq_file.h>
#else
#include <liblustre.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/pagemap.h>
-#include <asm/div64.h>
+#include <linux/math64.h>
#include <linux/seq_file.h>
#include <linux/namei.h>
#include <linux/lustre_intent.h>
#include <linux/slab.h>
#include <linux/pagemap.h>
#include <linux/mm.h>
-#include <asm/div64.h>
+#include <linux/math64.h>
#include <linux/seq_file.h>
#include <linux/namei.h>
#else
#define DEBUG_SUBSYSTEM S_LOV
#ifdef __KERNEL__
-#include <asm/div64.h>
+#include <linux/math64.h>
#include <libcfs/libcfs.h>
#else
#include <liblustre.h>
if (!tgt->ltd_active || tgt->ltd_reap) {
if (oqctl->qc_cmd == Q_GETOQUOTA &&
lov->lov_tgts[i]->ltd_activate) {
- rc = -EREMOTEIO;
+ rc = -ENETDOWN;
CERROR("ost %d is inactive\n", i);
} else {
CDEBUG(D_HA, "ost %d is inactive\n", i);
LASSERT(it);
CDEBUG(D_DLMTRACE, "(name: %.*s,"DFID") in obj "DFID
- ", intent: %s flags %#Lo\n", op_data->op_namelen,
+ ", intent: %s flags %#"LPF64"o\n", op_data->op_namelen,
op_data->op_name, PFID(&op_data->op_fid2),
PFID(&op_data->op_fid1), ldlm_it2str(it->it_op),
it->it_flags);
__u64 flags = LDLM_FL_HAS_INTENT;
ENTRY;
- CDEBUG(D_DLMTRACE,"name: %.*s in inode "DFID", intent: %s flags %#Lo\n",
+ CDEBUG(D_DLMTRACE, "name: %.*s in inode "DFID", intent: %s flags %#"
+ LPF64"o\n",
op_data->op_namelen, op_data->op_name, PFID(&op_data->op_fid1),
ldlm_it2str(it->it_op), it->it_flags);
}
struct ldlm_valblock_ops inode_lvbo = {
- lvbo_free: mdc_resource_inode_free
+ .lvbo_free = mdc_resource_inode_free
};
static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
#define DEBUG_SUBSYSTEM S_CLASS
+#include <libcfs/libcfs.h>
#include <obd_class.h>
#include <obd_support.h>
#include <lustre_fid.h>
[CLM_WRITE] = "W",
[CLM_GROUP] = "G"
};
- if (0 <= mode && mode < ARRAY_SIZE(names))
- return names[mode];
- else
- return "U";
+ CLASSERT(CLM_MAX == ARRAY_SIZE(names));
+ return names[mode];
}
EXPORT_SYMBOL(cl_lock_mode_name);
unsigned int val = 0;
if (likely(value != 0))
- val = min(fls(value - 1), OBD_HIST_MAX);
+ val = min_t(unsigned int, __fls(value - 1), OBD_HIST_MAX);
lprocfs_oh_tally(oh, val);
}
obd->obd_name, osfs->os_bsize);
GOTO(err_fini_stack, rc = -EPROTO);
}
- m->ofd_blockbits = fls(osfs->os_bsize) - 1;
+ m->ofd_blockbits = __fls(osfs->os_bsize) - 1;
m->ofd_precreate_batch = OFD_PRECREATE_BATCH_DEFAULT;
if (osfs->os_bsize * osfs->os_blocks < OFD_PRECREATE_SMALL_FS)
# different one than the default value here.
add fs2ost $(mkfs_opts ost1 ${fs2ostdev}) --mgsnode=$MGSNID \
--fsname=${FSNAME2} --reformat $fs2ostdev $fs2ostvdev || exit 10
- add fs3ost $(mkfs_opts ost1 ${fs3ostdev}) --mgsnode=$MGSNID \
+ add fs3ost $(mkfs_opts ost2 ${fs3ostdev}) --mgsnode=$MGSNID \
--fsname=${FSNAME2} --reformat $fs3ostdev $fs3ostvdev || exit 10
start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS
sbin_scripts = lrun
bin_scripts = llstat llobdstat plot-llstat llbackup
+EXTRA_PROGRAMS = wirecheck
+
if UTILS
noinst_PROGRAMS = obdio obdbarrier
-EXTRA_PROGRAMS = wirecheck
# mount only finds helpers in /sbin
rootsbin_PROGRAMS = mount.lustre
lib_LIBRARIES += libiam.a
endif
noinst_LIBRARIES = liblustreapitmp.a
+endif # UTILS
lctl_SOURCES = lustre_lfsck.c obd.c lustre_cfg.c lctl.c obdctl.h
lctl_LDADD := liblustreapi.a $(LIBPTLCTL) $(PTHREAD_LIBS) $(LIBREADLINE)
l_getidentity_DEPENDENCIES := $(LIBPTLCTL)
ltrack_stats_SOURCES = ltrack_stats.c
-endif # UTILS
+
+lhsmtool_posix_SOURCES = lhsmtool_posix.c
+lhsmtool_posix_LDADD := liblustreapi.a $(PTHREAD_LIBS)
+lhsmtool_posix_DEPENDENCIES := liblustreapi.a
wirecheck_SOURCES = wirecheck.c
wirecheck_CPPFLAGS = -DCC="\"$(CC)\""
wiretest_SOURCES = wiretest.c
-lhsmtool_posix_SOURCES = lhsmtool_posix.c
-lhsmtool_posix_LDADD := liblustreapi.a $(PTHREAD_LIBS)
-lhsmtool_posix_DEPENDENCIES := liblustreapi.a
-
EXTRA_DIST = $(sbin_scripts) $(bin_scripts)
# NOTE: this should only be run on i386.