From c1f6b32958c799412c830f35f8d16ed7275407ea Mon Sep 17 00:00:00 2001 From: shadow Date: Wed, 14 May 2008 18:50:20 +0000 Subject: [PATCH 1/1] use special macro for print time_t, cleanup in includes. b=14929 i=zam i=nikita --- lnet/include/libcfs/libcfs.h | 2 +- lnet/include/libcfs/linux/libcfs.h | 2 +- lnet/include/libcfs/linux/linux-fs.h | 1 + lnet/include/libcfs/linux/linux-time.h | 4 ++++ lnet/include/libcfs/user-prim.h | 33 +++++++++++---------------------- lnet/include/libcfs/user-time.h | 5 ++++- lnet/libcfs/debug.c | 9 +++++---- lnet/libcfs/user-prim.c | 8 +++++--- lnet/libcfs/user-tcpip.c | 20 +++++++++++--------- lnet/selftest/selftest.h | 4 ++++ lnet/utils/debug.c | 4 ++-- lustre/ChangeLog | 4 ++++ lustre/cmm/cmm_device.c | 2 +- lustre/include/liblustre.h | 26 +++++--------------------- lustre/include/linux/lvfs.h | 4 ---- lustre/include/lustre/lustre_idl.h | 10 +--------- lustre/include/obd_support.h | 4 ++++ lustre/ldlm/ldlm_extent.c | 2 +- lustre/ldlm/ldlm_flock.c | 5 ++--- lustre/ldlm/ldlm_inodebits.c | 2 +- lustre/ldlm/ldlm_lib.c | 4 ++-- lustre/ldlm/ldlm_lockd.c | 2 +- lustre/ldlm/ldlm_plain.c | 2 +- lustre/ldlm/ldlm_request.c | 19 ++++++++++--------- lustre/ldlm/ldlm_resource.c | 6 ++---- lustre/liblustre/dir.c | 6 ++++-- lustre/liblustre/file.c | 3 ++- lustre/liblustre/super.c | 10 ++++++---- lustre/liblustre/tests/sanity.c | 10 +++++----- lustre/liblustre/tests/test_common.c | 6 ++++-- lustre/lov/lov_ea.c | 8 ++++---- lustre/lvfs/fsfilt.c | 2 +- lustre/mdc/mdc_reint.c | 3 ++- lustre/mdd/mdd_device.c | 2 +- lustre/mds/handler.c | 2 +- lustre/mds/mds_open.c | 6 +++--- lustre/mds/mds_unlink_open.c | 2 +- lustre/mdt/mdt_handler.c | 2 +- lustre/mdt/mdt_open.c | 4 ++-- lustre/mdt/mdt_recovery.c | 2 +- lustre/mgs/mgs_llog.c | 4 ++-- lustre/obdclass/class_obd.c | 4 ++-- lustre/obdclass/idmap.c | 8 ++++---- lustre/obdclass/lu_object.c | 8 ++++---- lustre/obdclass/lustre_peer.c | 4 +--- lustre/obdfilter/filter.c | 4 ++-- lustre/obdfilter/filter_capa.c | 2 +- lustre/ptlrpc/client.c | 2 +- lustre/ptlrpc/pinger.c | 2 +- lustre/ptlrpc/sec.c | 4 ++-- lustre/ptlrpc/service.c | 6 +++--- lustre/utils/libiam.c | 2 +- lustre/utils/liblustreapi.c | 14 +++++++------- snmp/lustre-snmp-trap.c | 2 ++ snmp/lustre-snmp-util.c | 6 ++++-- 55 files changed, 159 insertions(+), 165 deletions(-) diff --git a/lnet/include/libcfs/libcfs.h b/lnet/include/libcfs/libcfs.h index 82d293b..80518b1 100644 --- a/lnet/include/libcfs/libcfs.h +++ b/lnet/include/libcfs/libcfs.h @@ -514,7 +514,7 @@ static inline void cfs_slow_warning(cfs_time_t now, int seconds, char *msg) { if (cfs_time_after(cfs_time_current(), cfs_time_add(now, cfs_time_seconds(15)))) - CERROR("slow %s %lu sec\n", msg, + CERROR("slow %s "CFS_TIME_T" sec\n", msg, cfs_duration_sec(cfs_time_sub(cfs_time_current(),now))); } diff --git a/lnet/include/libcfs/linux/libcfs.h b/lnet/include/libcfs/linux/libcfs.h index a313389..c873c2f 100644 --- a/lnet/include/libcfs/linux/libcfs.h +++ b/lnet/include/libcfs/linux/libcfs.h @@ -15,8 +15,8 @@ #endif #include -#include #include +#include #include #include #include diff --git a/lnet/include/libcfs/linux/linux-fs.h b/lnet/include/libcfs/linux/linux-fs.h index fa162c0..7573322 100644 --- a/lnet/include/libcfs/linux/linux-fs.h +++ b/lnet/include/libcfs/linux/linux-fs.h @@ -46,6 +46,7 @@ typedef struct file cfs_file_t; typedef struct dentry cfs_dentry_t; +typedef struct dirent64 cfs_dirent_t; #ifdef __KERNEL__ #define cfs_filp_size(f) (i_size_read((f)->f_dentry->d_inode)) diff --git a/lnet/include/libcfs/linux/linux-time.h b/lnet/include/libcfs/linux/linux-time.h index 626defd..3d4cdf5 100644 --- a/lnet/include/libcfs/linux/linux-time.h +++ b/lnet/include/libcfs/linux/linux-time.h @@ -307,7 +307,11 @@ static inline int cfs_time_beforeq_64(__u64 t1, __u64 t2) /* * Liblustre. time(2) based implementation. */ + +#define CFS_TIME_T "%lu" + #include + #endif /* __KERNEL__ */ /* __LIBCFS_LINUX_LINUX_TIME_H__ */ diff --git a/lnet/include/libcfs/user-prim.h b/lnet/include/libcfs/user-prim.h index 1939640..43c1aeb 100644 --- a/lnet/include/libcfs/user-prim.h +++ b/lnet/include/libcfs/user-prim.h @@ -52,28 +52,6 @@ #include #endif -#ifndef PAGE_SIZE - -#define PAGE_SIZE (getpagesize()) -static __inline__ int getpageshift() -{ - int pagesize = getpagesize(); -#if (__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)) - /* unsigned int is 32 bits on all our architectures */ - return (__builtin_clz(pagesize) ^ 31); -#else - register int pageshift = -1; - while (pagesize) { pagesize >>= 1; pageshift++; } - return pageshift; -#endif -} - -#undef PAGE_MASK -#define PAGE_MASK (~(PAGE_SIZE-1)) -#undef PAGE_SHIFT -#define PAGE_SHIFT (getpageshift()) - -#endif /* * Wait Queue. No-op implementation. @@ -134,10 +112,21 @@ struct page { typedef struct page cfs_page_t; +#ifndef PAGE_SIZE + +/* 4K */ +#define CFS_PAGE_SHIFT 12 +#define CFS_PAGE_SIZE (1UL << CFS_PAGE_SHIFT) +#define CFS_PAGE_MASK (~((__u64)CFS_PAGE_SIZE-1)) + +#else + #define CFS_PAGE_SIZE PAGE_SIZE #define CFS_PAGE_SHIFT PAGE_SHIFT #define CFS_PAGE_MASK (~((__u64)CFS_PAGE_SIZE-1)) +#endif + cfs_page_t *cfs_alloc_page(unsigned int flags); void cfs_free_page(cfs_page_t *pg); void *cfs_page_address(cfs_page_t *pg); diff --git a/lnet/include/libcfs/user-time.h b/lnet/include/libcfs/user-time.h index 3fb801d..874b7da 100644 --- a/lnet/include/libcfs/user-time.h +++ b/lnet/include/libcfs/user-time.h @@ -183,7 +183,10 @@ static inline cfs_duration_t cfs_time_sub(cfs_time_t t1, cfs_time_t t2) #define cfs_time_before_64 cfs_time_before #define cfs_time_beforeq_64 cfs_time_beforeq -#define CFS_TIME_T "%lu" +#ifndef CFS_TIME_T +#define CFS_TIME_T "%u" +#endif + #define CFS_DURATION_T "%ld" /* !__KERNEL__ */ diff --git a/lnet/libcfs/debug.c b/lnet/libcfs/debug.c index 76447e5..4b275e6 100644 --- a/lnet/libcfs/debug.c +++ b/lnet/libcfs/debug.c @@ -657,7 +657,7 @@ int libcfs_debug_init(unsigned long bufsize) if (debug_file_name[0] == '\0' && debug_file_path[0] != '\0') snprintf(debug_file_name, sizeof(debug_file_name) - 1, - "%s-%s-%lu.log", debug_file_path, source_nid, time(0)); + "%s-%s-"CFS_TIME_T".log", debug_file_path, source_nid, time(0)); if (strcmp(debug_file_name, "stdout") == 0 || strcmp(debug_file_name, "-") == 0) { @@ -725,8 +725,9 @@ libcfs_debug_vmsg2(cfs_debug_limit_state_t *cdls, int nob; int remain; va_list ap; - char buf[PAGE_SIZE]; /* size 4096 used for compatimble with linux, - * where message can`t be exceed PAGE_SIZE */ + char buf[CFS_PAGE_SIZE]; /* size 4096 used for compatimble + * with linux, where message can`t + * be exceed PAGE_SIZE */ int console = 0; char *prefix = "Lustre"; @@ -819,7 +820,7 @@ out_file: gettimeofday(&tv, NULL); - fprintf(debug_file_fd, "%lu.%06lu:%u:%s:(%s:%d:%s()): %s", + fprintf(debug_file_fd, CFS_TIME_T".%06lu:%u:%s:(%s:%d:%s()): %s", tv.tv_sec, tv.tv_usec, source_pid, source_nid, file, line, fn, buf); diff --git a/lnet/libcfs/user-prim.c b/lnet/libcfs/user-prim.c index 58f6b37..5193745 100644 --- a/lnet/libcfs/user-prim.c +++ b/lnet/libcfs/user-prim.c @@ -31,6 +31,9 @@ #ifndef __KERNEL__ +#include +#include + #include #ifndef __CYGWIN__ #include @@ -48,10 +51,9 @@ #include #include #include +#ifdef HAVE_SYS_VFS_H #include - -#include -#include +#endif /* * Sleep channel. No-op implementation. diff --git a/lnet/libcfs/user-tcpip.c b/lnet/libcfs/user-tcpip.c index a7b51e9..e0cedb9 100644 --- a/lnet/libcfs/user-tcpip.c +++ b/lnet/libcfs/user-tcpip.c @@ -19,9 +19,15 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef __KERNEL__ -#ifndef REDSTORM +#if !defined(__KERNEL__) || !defined(REDSTORM) + +#include +#include + #include +#ifdef HAVE_NETINET_IN_H +#include +#endif #include #include #include @@ -38,9 +44,6 @@ #include #endif -#include -#include - /* * Functions to get network interfaces info */ @@ -49,8 +52,8 @@ int libcfs_sock_ioctl(int cmd, unsigned long arg) { int fd, rc; - - fd = socket(AF_INET, SOCK_STREAM, 0); + + fd = socket(AF_INET, SOCK_STREAM, 0); if (fd < 0) { rc = -errno; @@ -600,5 +603,4 @@ int libcfs_sock_readv(int fd, const struct iovec *vector, int count) return rc; } -#endif /* !defined(REDSTORM) */ -#endif /* !__KERNEL__ */ +#endif /* !__KERNEL__ || !defined(REDSTORM) */ diff --git a/lnet/selftest/selftest.h b/lnet/selftest/selftest.h index dd97726..485570b 100644 --- a/lnet/selftest/selftest.h +++ b/lnet/selftest/selftest.h @@ -11,6 +11,10 @@ #define LNET_ONLY #ifndef __KERNEL__ +/* XXX workaround XXX */ +#ifdef HAVE_SYS_TYPES_H +#include +#endif #include /* userland spinlock_t and atomic_t */ #endif #include diff --git a/lnet/utils/debug.c b/lnet/utils/debug.c index 2a868dd..39af760 100644 --- a/lnet/utils/debug.c +++ b/lnet/utils/debug.c @@ -45,7 +45,6 @@ #include #include -#include #include #include #include @@ -483,7 +482,8 @@ int jt_dbg_debug_kernel(int argc, char **argv) if (argc > 1 && raw) strcpy(filename, argv[1]); else - sprintf(filename, "/tmp/lustre-log.%lu.%u",time(NULL),getpid()); + sprintf(filename, "/tmp/lustre-log."CFS_TIME_T".%u", + time(NULL),getpid()); if (stat(filename, &st) == 0 && S_ISREG(st.st_mode)) unlink(filename); diff --git a/lustre/ChangeLog b/lustre/ChangeLog index b19dddd..8132526 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -12,6 +12,10 @@ tbd Sun Microsystems, Inc. * RHEL 4 and RHEL 5/SLES 10 clients behaves differently on 'cd' to a removed cwd "./" (refer to Bugzilla 14399). +Severity : enhancement +Bugzilla : 14929 +Description: using special macro for print time and cleanup in includes. + Severity : normal Bugzilla : 12888 Description: mds_mfd_close() ASSERTION(rc == 0) diff --git a/lustre/cmm/cmm_device.c b/lustre/cmm/cmm_device.c index 886dfbc..066eeca 100644 --- a/lustre/cmm/cmm_device.c +++ b/lustre/cmm/cmm_device.c @@ -413,7 +413,7 @@ static int cmm_device_init(const struct lu_env *env, struct lu_device *d, ENTRY; spin_lock_init(&m->cmm_tgt_guard); - INIT_LIST_HEAD(&m->cmm_targets); + CFS_INIT_LIST_HEAD(&m->cmm_targets); m->cmm_tgt_count = 0; m->cmm_child = lu2md_dev(next); diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index b64ae31..388de36 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -34,6 +34,11 @@ #define __LINUX_SPINLOCK_H #endif +#include +#include +#include +#include + #include #ifdef HAVE_STDINT_H # include @@ -74,9 +79,6 @@ #ifdef __CYGWIN__ -#define CFS_PAGE_SHIFT 12 -#define CFS_PAGE_SIZE (1UL << CFS_PAGE_SHIFT) -#define CFS_PAGE_MASK (~((__u64)CFS_PAGE_SIZE-1)) #define loff_t long long #define ERESTART 2001 typedef unsigned short umode_t; @@ -163,24 +165,6 @@ struct file; /* forward ref */ typedef int (write_proc_t)(struct file *file, const char *buffer, unsigned long count, void *data); -#define NIPQUAD(addr) \ - ((unsigned char *)&addr)[0], \ - ((unsigned char *)&addr)[1], \ - ((unsigned char *)&addr)[2], \ - ((unsigned char *)&addr)[3] - -#if defined(__LITTLE_ENDIAN) -#define HIPQUAD(addr) \ - ((unsigned char *)&addr)[3], \ - ((unsigned char *)&addr)[2], \ - ((unsigned char *)&addr)[1], \ - ((unsigned char *)&addr)[0] -#elif defined(__BIG_ENDIAN) -#define HIPQUAD NIPQUAD -#else -#error "Undefined byteorder??" -#endif /* __LITTLE_ENDIAN */ - /* bits ops */ /* a long can be more than 32 bits, so use BITS_PER_LONG diff --git a/lustre/include/linux/lvfs.h b/lustre/include/linux/lvfs.h index e66a3a2..fffb4bd 100644 --- a/lustre/include/linux/lvfs.h +++ b/lustre/include/linux/lvfs.h @@ -38,10 +38,6 @@ struct group_info { /* unused */ }; #define LLOG_LVFS -/* lvfs.c */ -int obd_alloc_fail(const void *ptr, const char *name, const char *type, - size_t size, const char *file, int line); - /* simple.c */ struct lvfs_ucred { diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 72c1999..9ad76d4 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -54,15 +54,7 @@ #include -#if defined(__linux__) -#include -#elif defined(__APPLE__) -#include -#elif defined(__WINNT__) -#include -#else -#error Unsupported operating system. -#endif +#include /* Defn's shared with user-space. */ #include diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index a1f0b10..71c5046 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -70,6 +70,10 @@ extern unsigned int obd_alloc_fail_rate; int __obd_fail_check_set(__u32 id, __u32 value, int set); +/* lvfs.c */ +int obd_alloc_fail(const void *ptr, const char *name, const char *type, + size_t size, const char *file, int line); + /* Timeout definitions */ #define LDLM_TIMEOUT_DEFAULT 20 #define OBD_TIMEOUT_DEFAULT 100 diff --git a/lustre/ldlm/ldlm_extent.c b/lustre/ldlm/ldlm_extent.c index 2e6aa1a..8e84b5c 100644 --- a/lustre/ldlm/ldlm_extent.c +++ b/lustre/ldlm/ldlm_extent.c @@ -622,7 +622,7 @@ int ldlm_process_extent_lock(struct ldlm_lock *lock, int *flags, int first_enq, ldlm_error_t *err, struct list_head *work_list) { struct ldlm_resource *res = lock->l_resource; - struct list_head rpc_list = CFS_LIST_HEAD_INIT(rpc_list); + CFS_LIST_HEAD(rpc_list); int rc, rc2; int contended_locks = 0; ENTRY; diff --git a/lustre/ldlm/ldlm_flock.c b/lustre/ldlm/ldlm_flock.c index 3abad6f..477819e 100644 --- a/lustre/ldlm/ldlm_flock.c +++ b/lustre/ldlm/ldlm_flock.c @@ -41,7 +41,7 @@ #define l_flock_waitq l_lru -static struct list_head ldlm_flock_waitq = CFS_LIST_HEAD_INIT(ldlm_flock_waitq); +static CFS_LIST_HEAD(ldlm_flock_waitq); int ldlm_flock_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, void *data, int flag); @@ -391,8 +391,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, int *flags, int first_enq, * but only once because first_enq will be false from * ldlm_reprocess_queue. */ if ((mode == LCK_NL) && overlaps) { - struct list_head rpc_list - = CFS_LIST_HEAD_INIT(rpc_list); + CFS_LIST_HEAD(rpc_list); int rc; restart: ldlm_reprocess_queue(res, &res->lr_waiting, diff --git a/lustre/ldlm/ldlm_inodebits.c b/lustre/ldlm/ldlm_inodebits.c index 34c6295..9755425 100644 --- a/lustre/ldlm/ldlm_inodebits.c +++ b/lustre/ldlm/ldlm_inodebits.c @@ -122,7 +122,7 @@ int ldlm_process_inodebits_lock(struct ldlm_lock *lock, int *flags, struct list_head *work_list) { struct ldlm_resource *res = lock->l_resource; - struct list_head rpc_list = CFS_LIST_HEAD_INIT(rpc_list); + CFS_LIST_HEAD(rpc_list); int rc; ENTRY; diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index ba1b24f..3a93ff9 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -800,7 +800,7 @@ int target_handle_connect(struct ptlrpc_request *req) t = cfs_timer_deadline(&target->obd_recovery_timer); t = cfs_time_sub(t, cfs_time_current()); CERROR("%s: denying connection for new client %s (%s): " - "%d clients in recovery for %lds\n", + "%d clients in recovery for "CFS_TIME_T"s\n", target->obd_name, libcfs_nid2str(req->rq_peer.nid), cluuid.uuid, target->obd_recoverable_clients, @@ -826,7 +826,7 @@ dont_check_exports: //data->ocd_connect_flags &= OBD_CONNECT_SUPPORTED; *tmpdata = *data; } - + /* If all else goes well, this is our RPC return code. */ req->rq_status = 0; diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 36a1c80..f345503 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -679,7 +679,7 @@ int ldlm_server_completion_ast(struct ldlm_lock *lock, int flags, void *data) &lock->l_enqueued_time, NULL); if (total_enqueue_wait / 1000000 > obd_timeout) - LDLM_ERROR(lock, "enqueue wait took %luus from %lu", + LDLM_ERROR(lock, "enqueue wait took %luus from "CFS_TIME_T, total_enqueue_wait, lock->l_enqueued_time.tv_sec); req = ptlrpc_request_alloc(lock->l_export->exp_imp_reverse, diff --git a/lustre/ldlm/ldlm_plain.c b/lustre/ldlm/ldlm_plain.c index 6ced357..bfa086b 100644 --- a/lustre/ldlm/ldlm_plain.c +++ b/lustre/ldlm/ldlm_plain.c @@ -97,7 +97,7 @@ int ldlm_process_plain_lock(struct ldlm_lock *lock, int *flags, int first_enq, ldlm_error_t *err, struct list_head *work_list) { struct ldlm_resource *res = lock->l_resource; - struct list_head rpc_list = CFS_LIST_HEAD_INIT(rpc_list); + CFS_LIST_HEAD(rpc_list); int rc; ENTRY; diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index b0f9ced..56c48ff 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -61,9 +61,10 @@ int ldlm_expired_completion_wait(void *data) if (ptlrpc_check_suspend()) RETURN(0); - LDLM_ERROR(lock, "lock timed out (enqueued at %lu, %lus ago); " - "not entering recovery in server code, just going " - "back to sleep", lock->l_enqueued_time.tv_sec, + LDLM_ERROR(lock, "lock timed out (enqueued at "CFS_TIME_T", " + CFS_DURATION_T"s ago); not entering recovery in " + "server code, just going back to sleep", + lock->l_enqueued_time.tv_sec, cfs_time_current_sec() - lock->l_enqueued_time.tv_sec); if (cfs_time_after(cfs_time_current(), next_dump)) { last_dump = next_dump; @@ -79,10 +80,11 @@ int ldlm_expired_completion_wait(void *data) obd = lock->l_conn_export->exp_obd; imp = obd->u.cli.cl_import; ptlrpc_fail_import(imp, lwd->lwd_conn_cnt); - LDLM_ERROR(lock, "lock timed out (enqueued at %lu, %lus ago), entering " - "recovery for %s@%s", lock->l_enqueued_time.tv_sec, - cfs_time_current_sec() - lock->l_enqueued_time.tv_sec, - obd2cli_tgt(obd), imp->imp_connection->c_remote_uuid.uuid); + LDLM_ERROR(lock, "lock timed out (enqueued at "CFS_TIME_T", " + CFS_DURATION_T"s ago), entering recovery for %s@%s", + lock->l_enqueued_time.tv_sec, + cfs_time_current_sec() - lock->l_enqueued_time.tv_sec, + obd2cli_tgt(obd), imp->imp_connection->c_remote_uuid.uuid); RETURN(0); } @@ -1984,12 +1986,11 @@ static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock) int ldlm_replay_locks(struct obd_import *imp) { struct ldlm_namespace *ns = imp->imp_obd->obd_namespace; - struct list_head list; + CFS_LIST_HEAD(list); struct ldlm_lock *lock, *next; int rc = 0; ENTRY; - CFS_INIT_LIST_HEAD(&list); LASSERT(atomic_read(&imp->imp_replay_inflight) == 0); diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 151c513..aebfe5a 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -40,12 +40,10 @@ atomic_t ldlm_srv_namespace_nr = ATOMIC_INIT(0); atomic_t ldlm_cli_namespace_nr = ATOMIC_INIT(0); struct semaphore ldlm_srv_namespace_lock; -struct list_head ldlm_srv_namespace_list = - CFS_LIST_HEAD_INIT(ldlm_srv_namespace_list); +CFS_LIST_HEAD(ldlm_srv_namespace_list); struct semaphore ldlm_cli_namespace_lock; -struct list_head ldlm_cli_namespace_list = - CFS_LIST_HEAD_INIT(ldlm_cli_namespace_list); +CFS_LIST_HEAD(ldlm_cli_namespace_list); cfs_proc_dir_entry_t *ldlm_type_proc_dir = NULL; cfs_proc_dir_entry_t *ldlm_ns_proc_dir = NULL; diff --git a/lustre/liblustre/dir.c b/lustre/liblustre/dir.c index 72b5157..ced5d95 100644 --- a/lustre/liblustre/dir.c +++ b/lustre/liblustre/dir.c @@ -170,7 +170,7 @@ 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); + cfs_dirent_t *dirent = (cfs_dirent_t *) (buf + *filled); int reclen = ROUND_UP64(NAME_OFFSET(dirent) + namelen + 1); /* check overflow */ @@ -178,9 +178,11 @@ static int filldir(char *buf, int buflen, return 1; dirent->d_ino = ino; +#ifdef _DIRENT_HAVE_D_OFF dirent->d_off = offset; +#endif dirent->d_reclen = reclen; -#ifndef _AIX +#ifdef _DIRENT_HAVE_D_TYPE dirent->d_type = (unsigned short) d_type; #endif memcpy(dirent->d_name, name, namelen); diff --git a/lustre/liblustre/file.c b/lustre/liblustre/file.c index d341dd0..34706f3 100644 --- a/lustre/liblustre/file.c +++ b/lustre/liblustre/file.c @@ -112,7 +112,8 @@ void obdo_refresh_inode(struct inode *dst, valid &= src->o_valid; if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME)) - CDEBUG(D_INODE,"valid "LPX64", cur time %lu/%lu, new %lu/%lu\n", + CDEBUG(D_INODE,"valid "LPX64", cur time "CFS_TIME_T"/"CFS_TIME_T + ", new %lu/%lu\n", src->o_valid, LTIME_S(st->st_mtime), LTIME_S(st->st_ctime), (long)src->o_mtime, (long)src->o_ctime); diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index dc574f7..81dedf8 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -218,7 +218,8 @@ void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid) valid &= src->o_valid; if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME)) - CDEBUG(D_INODE,"valid "LPX64", cur time %lu/%lu, new %lu/%lu\n", + CDEBUG(D_INODE,"valid "LPX64", cur time "CFS_TIME_T"/"CFS_TIME_T + ", new %lu/%lu\n", src->o_valid, LTIME_S(st->st_mtime), LTIME_S(st->st_ctime), (long)src->o_mtime, (long)src->o_ctime); @@ -257,7 +258,7 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid) obd_flag newvalid = 0; if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME)) - CDEBUG(D_INODE, "valid %x, new time %lu/%lu\n", + CDEBUG(D_INODE, "valid %x, new time "CFS_TIME_T"/"CFS_TIME_T"\n", valid, LTIME_S(st->st_mtime), LTIME_S(st->st_ctime)); @@ -755,7 +756,8 @@ int llu_setattr_raw(struct inode *inode, struct iattr *attr) } if (attr->ia_valid & (ATTR_MTIME | ATTR_CTIME)) - CDEBUG(D_INODE, "setting mtime %lu, ctime %lu, now = %lu\n", + CDEBUG(D_INODE, "setting mtime "CFS_TIME_T", ctime "CFS_TIME_T + ", now = "CFS_TIME_T"\n", LTIME_S(attr->ia_mtime), LTIME_S(attr->ia_ctime), LTIME_S(CURRENT_TIME)); @@ -862,7 +864,7 @@ int llu_setattr_raw(struct inode *inode, struct iattr *attr) struct obd_info oinfo = { { { 0 } } }; struct obdo oa; - CDEBUG(D_INODE, "set mtime on OST inode %llu to %lu\n", + CDEBUG(D_INODE, "set mtime on OST inode %llu to "CFS_TIME_T"\n", (long long)st->st_ino, LTIME_S(attr->ia_mtime)); oa.o_id = lsm->lsm_object_id; oa.o_gr = lsm->lsm_object_gr; diff --git a/lustre/liblustre/tests/sanity.c b/lustre/liblustre/tests/sanity.c index 39e45c0..aafc5e6 100644 --- a/lustre/liblustre/tests/sanity.c +++ b/lustre/liblustre/tests/sanity.c @@ -377,7 +377,7 @@ int t14(char *name) char buf[1024]; const int nfiles = 256; char *prefix = "test14_filename_long_prefix_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA___"; - struct dirent64 *ent; + cfs_dirent_t *ent; int fd, i, rc, pos, index; loff_t base = 0; ENTER(">1 block(4k) directory readdir"); @@ -401,7 +401,7 @@ int t14(char *name) while (pos < rc) { char *item; - ent = (struct dirent64 *) ((char*) buf + pos); + ent = (void *) buf + pos; item = (char *) ent->d_name; if (!strcmp(item, ".") || !strcmp(item, "..")) goto iter; @@ -772,8 +772,8 @@ int t23(char *name) { char path[MAX_PATH_LENGTH]; int fd; - long long ret; - long long off; + off_t ret; + off_t off; ENTER("handle seek > 2GB"); snprintf(path, MAX_PATH_LENGTH, "%s/f%s", lustre_path, name); @@ -1341,7 +1341,7 @@ int t56(char *name) size_t nbytes; off_t basep = 0; ssize_t rc = 0; - struct dirent dir; + cfs_dirent_t dir; ENTER("getdirentries should fail if nbytes is too small"); diff --git a/lustre/liblustre/tests/test_common.c b/lustre/liblustre/tests/test_common.c index 29377b1..8b7ba3b 100644 --- a/lustre/liblustre/tests/test_common.c +++ b/lustre/liblustre/tests/test_common.c @@ -14,6 +14,8 @@ #include #include +#include + #include "test_common.h" int exit_on_err = 1; @@ -327,7 +329,7 @@ void t_grep_v(const char *path, char *str) void t_ls(int fd, char *buf, int size) { - struct dirent64 *ent; + cfs_dirent_t *ent; int rc, pos; loff_t base = 0; @@ -335,7 +337,7 @@ void t_ls(int fd, char *buf, int size) while ((rc = getdirentries64(fd, buf, size, &base)) > 0) { pos = 0; while (pos < rc) { - ent = (struct dirent64 *) ((char*) buf + pos); + ent = (cfs_dirent_t *) ((char*) buf + pos); printf("%s\n", ent->d_name); pos += ent->d_reclen; } diff --git a/lustre/lov/lov_ea.c b/lustre/lov/lov_ea.c index b417ae0..174e1fc 100755 --- a/lustre/lov/lov_ea.c +++ b/lustre/lov/lov_ea.c @@ -138,7 +138,7 @@ lsm_stripe_by_index_plain(struct lov_stripe_md *lsm, int *stripeno, obd_off *lov_off, unsigned long *swidth) { if (swidth) - *swidth = (ulong)lsm->lsm_stripe_size * lsm->lsm_stripe_count; + *swidth = (unsigned long)lsm->lsm_stripe_size * lsm->lsm_stripe_count; } static void @@ -146,7 +146,7 @@ lsm_stripe_by_offset_plain(struct lov_stripe_md *lsm, int *stripeno, obd_off *lov_off, unsigned long *swidth) { if (swidth) - *swidth = (ulong)lsm->lsm_stripe_size * lsm->lsm_stripe_count; + *swidth = (unsigned long)lsm->lsm_stripe_size * lsm->lsm_stripe_count; } static obd_off @@ -329,7 +329,7 @@ lsm_stripe_by_index_join(struct lov_stripe_md *lsm, int *stripeno, *stripeno -= le->le_loi_idx; if (swidth) - *swidth = (ulong)lsm->lsm_stripe_size * le->le_stripe_count; + *swidth = (unsigned long)lsm->lsm_stripe_size * le->le_stripe_count; if (lov_off) { struct lov_extent *lov_le = lovea_off2le(lsm, *lov_off); @@ -362,7 +362,7 @@ lsm_stripe_by_offset_join(struct lov_stripe_md *lsm, int *stripeno, *stripeno -= le->le_loi_idx; if (swidth) - *swidth = (ulong)lsm->lsm_stripe_size * le->le_stripe_count; + *swidth = (unsigned long)lsm->lsm_stripe_size * le->le_stripe_count; } static obd_off diff --git a/lustre/lvfs/fsfilt.c b/lustre/lvfs/fsfilt.c index 6f88917..f063fd4 100644 --- a/lustre/lvfs/fsfilt.c +++ b/lustre/lvfs/fsfilt.c @@ -11,7 +11,7 @@ #include #include -LIST_HEAD(fsfilt_types); +CFS_LIST_HEAD(fsfilt_types); static struct fsfilt_operations *fsfilt_search_type(const char *type) { diff --git a/lustre/mdc/mdc_reint.c b/lustre/mdc/mdc_reint.c index 8a49a72..5307cb11 100644 --- a/lustre/mdc/mdc_reint.c +++ b/lustre/mdc/mdc_reint.c @@ -150,7 +150,8 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data, } if (op_data->op_attr.ia_valid & (ATTR_MTIME | ATTR_CTIME)) - CDEBUG(D_INODE, "setting mtime %lu, ctime %lu\n", + CDEBUG(D_INODE, "setting mtime "CFS_TIME_T + ", ctime "CFS_TIME_T"\n", LTIME_S(op_data->op_attr.ia_mtime), LTIME_S(op_data->op_attr.ia_ctime)); mdc_setattr_pack(req, op_data, ea, ealen, ea2, ea2len); diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index a1a69f5..f9dc257 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -61,7 +61,7 @@ static int mdd_device_init(const struct lu_env *env, struct lu_device *d, mdd->mdd_txn_cb.dtc_txn_stop = mdd_txn_stop_cb; mdd->mdd_txn_cb.dtc_txn_commit = mdd_txn_commit_cb; mdd->mdd_txn_cb.dtc_cookie = mdd; - INIT_LIST_HEAD(&mdd->mdd_txn_cb.dtc_linkage); + CFS_INIT_LIST_HEAD(&mdd->mdd_txn_cb.dtc_linkage); mdd->mdd_atime_diff = MAX_ATIME_DIFF; rc = mdd_procfs_init(mdd, name); diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index bc1ac9f..9c33a98 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -376,7 +376,7 @@ int mds_init_export(struct obd_export *exp) { struct mds_export_data *med = &exp->exp_mds_data; - INIT_LIST_HEAD(&med->med_open_head); + CFS_INIT_LIST_HEAD(&med->med_open_head); spin_lock_init(&med->med_open_lock); spin_lock(&exp->exp_lock); diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 9b613a1..61dc455 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -82,8 +82,8 @@ struct mds_file_data *mds_mfd_new(void) atomic_set(&mfd->mfd_refcount, 2); - INIT_LIST_HEAD(&mfd->mfd_handle.h_link); - INIT_LIST_HEAD(&mfd->mfd_list); + CFS_INIT_LIST_HEAD(&mfd->mfd_handle.h_link); + CFS_INIT_LIST_HEAD(&mfd->mfd_list); class_handle_hash(&mfd->mfd_handle, mds_mfd_addref); return mfd; @@ -663,7 +663,7 @@ static int mds_finish_open(struct ptlrpc_request *req, struct dentry *dchild, struct mds_obd *mds = mds_req2mds(req); struct obd_device *obd = req->rq_export->exp_obd; struct mds_file_data *mfd = NULL; - struct lov_mds_md *lmm; /* object IDs created */ + struct lov_mds_md *lmm = NULL; /* object IDs created */ int rc = 0; ENTRY; diff --git a/lustre/mds/mds_unlink_open.c b/lustre/mds/mds_unlink_open.c index c9f155c..3c2f4fe 100644 --- a/lustre/mds/mds_unlink_open.c +++ b/lustre/mds/mds_unlink_open.c @@ -205,7 +205,7 @@ int mds_cleanup_pending(struct obd_device *obd) if (IS_ERR(file)) GOTO(err_pop, rc = PTR_ERR(file)); - INIT_LIST_HEAD(&dentry_list); + CFS_INIT_LIST_HEAD(&dentry_list); rc = l_readdir(file, &dentry_list); filp_close(file, 0); if (rc < 0) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index ce2e274..ebf3ddf 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -4341,7 +4341,7 @@ static int mdt_init_export(struct obd_export *exp) struct mdt_export_data *med = &exp->exp_mdt_data; ENTRY; - INIT_LIST_HEAD(&med->med_open_head); + CFS_INIT_LIST_HEAD(&med->med_open_head); spin_lock_init(&med->med_open_lock); sema_init(&med->med_idmap_sem, 1); med->med_idmap = NULL; diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index 49626c7..6099b61 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -49,8 +49,8 @@ struct mdt_file_data *mdt_mfd_new(void) OBD_ALLOC_PTR(mfd); if (mfd != NULL) { - INIT_LIST_HEAD(&mfd->mfd_handle.h_link); - INIT_LIST_HEAD(&mfd->mfd_list); + CFS_INIT_LIST_HEAD(&mfd->mfd_handle.h_link); + CFS_INIT_LIST_HEAD(&mfd->mfd_list); class_handle_hash(&mfd->mfd_handle, mdt_mfd_get); } RETURN(mfd); diff --git a/lustre/mdt/mdt_recovery.c b/lustre/mdt/mdt_recovery.c index ec934aa..04376af 100644 --- a/lustre/mdt/mdt_recovery.c +++ b/lustre/mdt/mdt_recovery.c @@ -945,7 +945,7 @@ int mdt_fs_setup(const struct lu_env *env, struct mdt_device *mdt, mdt->mdt_txn_cb.dtc_txn_stop = mdt_txn_stop_cb; mdt->mdt_txn_cb.dtc_txn_commit = mdt_txn_commit_cb; mdt->mdt_txn_cb.dtc_cookie = mdt; - INIT_LIST_HEAD(&mdt->mdt_txn_cb.dtc_linkage); + CFS_INIT_LIST_HEAD(&mdt->mdt_txn_cb.dtc_linkage); dt_txn_callback_add(mdt->mdt_bottom, &mdt->mdt_txn_cb); diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 51a3ca7..49c7aac 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -84,7 +84,7 @@ int class_dentry_readdir(struct obd_device *obd, struct dentry *dir, /* dentry_open_it() drops the dentry, mnt refs */ GOTO(out_pop, rc = PTR_ERR(file)); - INIT_LIST_HEAD(dentry_list); + CFS_INIT_LIST_HEAD(dentry_list); rc = l_readdir(file, dentry_list); filp_close(file, 0); /* filp_close->fput() drops the dentry, mnt refs */ @@ -376,7 +376,7 @@ static void mgs_free_fsdb(struct obd_device *obd, struct fs_db *fsdb) int mgs_init_fsdb_list(struct obd_device *obd) { struct mgs_obd *mgs = &obd->u.mgs; - INIT_LIST_HEAD(&mgs->mgs_fs_db_list); + CFS_INIT_LIST_HEAD(&mgs->mgs_fs_db_list); return 0; } diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 1e680ba..1c16400 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -506,8 +506,8 @@ int obd_init_checks(void) ret = -EINVAL; } if ((u64val & ~CFS_PAGE_MASK) >= CFS_PAGE_SIZE) { - CWARN("mask failed: u64val "LPU64" >= %lu\n", u64val, - CFS_PAGE_SIZE); + CWARN("mask failed: u64val "LPU64" >= "LPU64"\n", u64val, + (__u64)CFS_PAGE_SIZE); ret = -EINVAL; } diff --git a/lustre/obdclass/idmap.c b/lustre/obdclass/idmap.c index 9f85b98..5e75e56 100644 --- a/lustre/obdclass/idmap.c +++ b/lustre/obdclass/idmap.c @@ -173,10 +173,10 @@ struct lustre_idmap_entry *idmap_entry_alloc(uid_t rmt_uid, uid_t lcl_uid, if (e == NULL) return NULL; - INIT_LIST_HEAD(&e->lie_rmt_uid_hash); - INIT_LIST_HEAD(&e->lie_lcl_uid_hash); - INIT_LIST_HEAD(&e->lie_rmt_gid_hash); - INIT_LIST_HEAD(&e->lie_lcl_gid_hash); + CFS_INIT_LIST_HEAD(&e->lie_rmt_uid_hash); + CFS_INIT_LIST_HEAD(&e->lie_lcl_uid_hash); + CFS_INIT_LIST_HEAD(&e->lie_rmt_gid_hash); + CFS_INIT_LIST_HEAD(&e->lie_lcl_gid_hash); e->lie_rmt_uid = rmt_uid; e->lie_lcl_uid = lcl_uid; e->lie_rmt_gid = rmt_gid; diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index 9850941..21dad60 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -195,7 +195,7 @@ static void lu_object_free(const struct lu_env *env, struct lu_object *o) * necessary, because lu_object_header is freed together with the * top-level slice. */ - INIT_LIST_HEAD(&splice); + CFS_INIT_LIST_HEAD(&splice); list_splice_init(&o->lo_header->loh_layers, &splice); while (!list_empty(&splice)) { o = container_of0(splice.next, struct lu_object, lo_linkage); @@ -214,7 +214,7 @@ int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr) struct lu_object_header *h; struct lu_object_header *temp; - INIT_LIST_HEAD(&dispose); + CFS_INIT_LIST_HEAD(&dispose); /* * Under LRU list lock, scan LRU list and move unreferenced objects to * the dispose list, removing them from LRU and hash table. @@ -498,7 +498,7 @@ EXPORT_SYMBOL(lu_object_find); /* * Global list of all sites on this node */ -static LIST_HEAD(lu_sites); +static CFS_LIST_HEAD(lu_sites); static DECLARE_MUTEX(lu_sites_guard); /* @@ -1084,7 +1084,7 @@ static int lu_cache_shrink(int nr, unsigned int gfp_mask) struct lu_site *tmp; int cached = 0; int remain = nr; - LIST_HEAD(splice); + CFS_LIST_HEAD(splice); if (nr != 0 && !(gfp_mask & __GFP_FS)) return -1; diff --git a/lustre/obdclass/lustre_peer.c b/lustre/obdclass/lustre_peer.c index 54c9de6..fdeef96 100644 --- a/lustre/obdclass/lustre_peer.c +++ b/lustre/obdclass/lustre_peer.c @@ -137,12 +137,10 @@ int class_add_uuid(const char *uuid, __u64 nid) /* Delete the nids for one uuid if specified, otherwise delete all */ int class_del_uuid(const char *uuid) { - struct list_head deathrow; + CFS_LIST_HEAD(deathrow); struct uuid_nid_data *data; int found = 0; - CFS_INIT_LIST_HEAD (&deathrow); - spin_lock (&g_uuid_lock); if (uuid == NULL) { list_splice_init(&g_uuid_list, &deathrow); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 44addac..f00b738 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -575,7 +575,7 @@ static int filter_init_export(struct obd_export *exp) { spin_lock_init(&exp->exp_filter_data.fed_lock); CFS_INIT_LIST_HEAD(&exp->exp_filter_data.fed_mod_list); - + spin_lock(&exp->exp_lock); exp->exp_connecting = 1; spin_unlock(&exp->exp_lock); @@ -1643,7 +1643,7 @@ static int filter_intent_policy(struct ldlm_namespace *ns, struct ldlm_lock **lockp, void *req_cookie, ldlm_mode_t mode, int flags, void *data) { - struct list_head rpc_list = CFS_LIST_HEAD_INIT(rpc_list); + CFS_LIST_HEAD(rpc_list); struct ptlrpc_request *req = req_cookie; struct ldlm_lock *lock = *lockp, *l = NULL; struct ldlm_resource *res = lock->l_resource; diff --git a/lustre/obdfilter/filter_capa.c b/lustre/obdfilter/filter_capa.c index c7d3ea2..27dad80 100644 --- a/lustre/obdfilter/filter_capa.c +++ b/lustre/obdfilter/filter_capa.c @@ -82,7 +82,7 @@ int filter_update_capa_key(struct obd_device *obd, struct lustre_capa_key *new) OBD_ALLOC_PTR(k); if (!k) RETURN(-ENOMEM); - INIT_LIST_HEAD(&k->k_list); + CFS_INIT_LIST_HEAD(&k->k_list); } spin_lock(&capa_lock); diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 5124f28..b536445 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -1191,7 +1191,7 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req) int rc = 0; ENTRY; - DEBUG_REQ(D_ERROR|D_NETERROR, req, "%s (sent at %lu, %lus ago)", + DEBUG_REQ(D_ERROR|D_NETERROR, req, "%s (sent at %lu, "CFS_DURATION_T"s ago)", req->rq_net_err ? "network error" : "timeout", (long)req->rq_sent, cfs_time_current_sec() - req->rq_sent); diff --git a/lustre/ptlrpc/pinger.c b/lustre/ptlrpc/pinger.c index 819cad6..274e8e9 100644 --- a/lustre/ptlrpc/pinger.c +++ b/lustre/ptlrpc/pinger.c @@ -37,7 +37,7 @@ #include "ptlrpc_internal.h" struct semaphore pinger_sem; -static struct list_head pinger_imports = CFS_LIST_HEAD_INIT(pinger_imports); +static CFS_LIST_HEAD(pinger_imports); int ptlrpc_ping(struct obd_import *imp) { diff --git a/lustre/ptlrpc/sec.c b/lustre/ptlrpc/sec.c index 7f49fd1..f3247e4 100644 --- a/lustre/ptlrpc/sec.c +++ b/lustre/ptlrpc/sec.c @@ -1588,7 +1588,7 @@ int sptlrpc_target_export_check(struct obd_export *exp, if (exp->exp_flvr_expire[0] >= cfs_time_current_sec()) { if (flavor_allowed(&exp->exp_flvr_old[0], req)) { CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the " - "middle one (%lu)\n", exp, + "middle one ("CFS_DURATION_T")\n", exp, exp->exp_flvr.sf_rpc, exp->exp_flvr_old[0].sf_rpc, exp->exp_flvr_old[1].sf_rpc, @@ -1613,7 +1613,7 @@ int sptlrpc_target_export_check(struct obd_export *exp, if (exp->exp_flvr_expire[1] >= cfs_time_current_sec()) { if (flavor_allowed(&exp->exp_flvr_old[1], req)) { CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the " - "oldest one (%lu)\n", exp, + "oldest one ("CFS_DURATION_T")\n", exp, exp->exp_flvr.sf_rpc, exp->exp_flvr_old[0].sf_rpc, exp->exp_flvr_old[1].sf_rpc, diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index cca0fd0..4cda095 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -42,7 +42,7 @@ CFS_MODULE_PARM(test_req_buffer_pressure, "i", int, 0444, /* forward ref */ static int ptlrpc_server_post_idle_rqbds (struct ptlrpc_service *svc); -static CFS_LIST_HEAD (ptlrpc_all_services); +static CFS_LIST_HEAD(ptlrpc_all_services); spinlock_t ptlrpc_all_services_lock; static char * @@ -467,7 +467,7 @@ static void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay) exp->exp_last_request_time = max(exp->exp_last_request_time, cfs_time_current_sec() + extra_delay); - CDEBUG(D_HA, "updating export %s at %ld exp %p\n", + CDEBUG(D_HA, "updating export %s at "CFS_TIME_T" exp %p\n", exp->exp_client_uuid.uuid, exp->exp_last_request_time, exp); @@ -508,7 +508,7 @@ static void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay) * we better wait for 3. */ exp->exp_obd->obd_eviction_timer = cfs_time_current_sec() + 3 * PING_INTERVAL; - CDEBUG(D_HA, "%s: Think about evicting %s from %ld\n", + CDEBUG(D_HA, "%s: Think about evicting %s from "CFS_TIME_T"\n", exp->exp_obd->obd_name, obd_export_nid2str(exp), oldest_time); } diff --git a/lustre/utils/libiam.c b/lustre/utils/libiam.c index 072d10e..36a7765 100644 --- a/lustre/utils/libiam.c +++ b/lustre/utils/libiam.c @@ -43,7 +43,7 @@ #endif #include - +#include #include typedef __u32 lvar_hash_t; diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 47d46e5..b9328e5 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -292,7 +292,7 @@ int llapi_file_create(const char *name, unsigned long stripe_size, } typedef int (semantic_func_t)(char *path, DIR *parent, DIR *d, - void *data, struct dirent64 *de); + void *data, cfs_dirent_t *de); #define MAX_LOV_UUID_COUNT max(LOV_MAX_STRIPE_COUNT, 1000) #define OBD_NOT_FOUND (-1) @@ -793,9 +793,9 @@ static DIR *opendir_parent(char *path) static int llapi_semantic_traverse(char *path, int size, DIR *parent, semantic_func_t sem_init, semantic_func_t sem_fini, void *data, - struct dirent64 *de) + cfs_dirent_t *de) { - struct dirent64 *dent; + cfs_dirent_t *dent; int len, ret; DIR *d, *p = NULL; @@ -980,7 +980,7 @@ static int find_time_check(lstat_t *st, struct find_param *param, int mds) } static int cb_find_init(char *path, DIR *parent, DIR *dir, - void *data, struct dirent64 *de) + void *data, cfs_dirent_t *de) { struct find_param *param = (struct find_param *)data; int decision = 1; /* 1 is accepted; -1 is rejected. */ @@ -1219,7 +1219,7 @@ decided: } static int cb_common_fini(char *path, DIR *parent, DIR *d, void *data, - struct dirent64 *de) + cfs_dirent_t *de) { struct find_param *param = (struct find_param *)data; param->depth--; @@ -1259,7 +1259,7 @@ int llapi_find(char *path, struct find_param *param) } static int cb_getstripe(char *path, DIR *parent, DIR *d, void *data, - struct dirent64 *de) + cfs_dirent_t *de) { struct find_param *param = (struct find_param *)data; int ret = 0; @@ -1605,7 +1605,7 @@ int llapi_quotactl(char *mnt, struct if_quotactl *qctl) } static int cb_quotachown(char *path, DIR *parent, DIR *d, void *data, - struct dirent64 *de) + cfs_dirent_t *de) { struct find_param *param = (struct find_param *)data; lstat_t *st; diff --git a/snmp/lustre-snmp-trap.c b/snmp/lustre-snmp-trap.c index 7caf5ce..6fa62fa 100644 --- a/snmp/lustre-snmp-trap.c +++ b/snmp/lustre-snmp-trap.c @@ -33,7 +33,9 @@ */ #include +#if defined (__linux__) #include +#endif #include #include #include diff --git a/snmp/lustre-snmp-util.c b/snmp/lustre-snmp-util.c index 9969272..c498426 100644 --- a/snmp/lustre-snmp-util.c +++ b/snmp/lustre-snmp-util.c @@ -33,7 +33,9 @@ */ #include +#if defined (__linux__) #include +#endif #include #include #include @@ -342,9 +344,9 @@ int read_counter64(const char *file_path, counter64 *c64,int factor) if ((ret_val = read_string(file_path, file_data,sizeof(file_data))) == SUCCESS) { tmp = atoll(file_data) * factor; - c64->low = (ulong) (0x0FFFFFFFF & tmp); + c64->low = (unsigned long) (0x0FFFFFFFF & tmp); tmp >>= 32; /* Shift right by 4 bytes */ - c64->high = (ulong) (0x0FFFFFFFF & tmp); + c64->high = (unsigned long) (0x0FFFFFFFF & tmp); } return ret_val; } -- 1.8.3.1