From 7ff719091d8c2df4dc4d76350832c6a469fd247f Mon Sep 17 00:00:00 2001 From: liangzhen Date: Tue, 28 Feb 2006 08:02:59 +0000 Subject: [PATCH] Portability fix for updated b1_5. --- lustre/include/linux/lustre_lib.h | 14 ++++ lustre/include/lustre_dlm.h | 2 +- lustre/include/lustre_lib.h | 142 +++++++++++++++------------------ lustre/include/lustre_ucache.h | 8 +- lustre/lov/lov_obd.c | 13 ++- lustre/obdclass/autoMakefile.am | 8 +- lustre/obdclass/darwin/darwin-sysctl.c | 6 +- lustre/obdclass/prng.c | 5 +- lustre/obdfilter/filter.c | 6 +- lustre/osc/osc_create.c | 7 +- lustre/osc/osc_request.c | 8 +- lustre/ptlrpc/pers.c | 6 +- lustre/quota/quota_master.c | 6 +- 13 files changed, 113 insertions(+), 118 deletions(-) diff --git a/lustre/include/linux/lustre_lib.h b/lustre/include/linux/lustre_lib.h index 8aea18b..e5be7d6 100644 --- a/lustre/include/linux/lustre_lib.h +++ b/lustre/include/linux/lustre_lib.h @@ -75,5 +75,19 @@ static inline sigset_t l_w_e_set_sigs(int sigs) } #endif +#ifdef __KERNEL__ +/* initialize ost_lvb according to inode */ +static inline void inode_init_lvb(struct inode *inode, struct ost_lvb *lvb) +{ + lvb->lvb_size = inode->i_size; + lvb->lvb_blocks = inode->i_blocks; + lvb->lvb_mtime = LTIME_S(inode->i_mtime); + lvb->lvb_atime = LTIME_S(inode->i_atime); + lvb->lvb_ctime = LTIME_S(inode->i_ctime); +} +#else +/* defined in liblustre/llite_lib.h */ +#endif + #endif /* _LUSTRE_LIB_H */ diff --git a/lustre/include/lustre_dlm.h b/lustre/include/lustre_dlm.h index d38e4a5..7a656db 100644 --- a/lustre/include/lustre_dlm.h +++ b/lustre/include/lustre_dlm.h @@ -244,7 +244,7 @@ struct ldlm_lock { cfs_waitq_t l_waitq; struct timeval l_enqueued_time; - unsigned long l_last_used; /* jiffies */ + cfs_time_t l_last_used; /* jiffies */ struct ldlm_extent l_req_extent; /* Client-side-only members */ diff --git a/lustre/include/lustre_lib.h b/lustre/include/lustre_lib.h index bf2093c..a9e94c4 100644 --- a/lustre/include/lustre_lib.h +++ b/lustre/include/lustre_lib.h @@ -70,7 +70,7 @@ int target_handle_dqacq_callback(struct ptlrpc_request *req); void target_cancel_recovery_timer(struct obd_device *obd); -#define OBD_RECOVERY_TIMEOUT (obd_timeout * 5 * HZ / 2) /* *waves hands* */ +#define OBD_RECOVERY_TIMEOUT (obd_timeout * 5 / 2) /* *waves hands* */ void target_start_recovery_timer(struct obd_device *obd, svc_handler_t handler); void target_abort_recovery(void *data); void target_cleanup_recovery(struct obd_device *obd); @@ -398,76 +398,76 @@ static inline void obd_ioctl_freedata(char *buf, int len) return; } -#define OBD_IOC_CREATE _IOR ('f', 101, long) -#define OBD_IOC_DESTROY _IOW ('f', 104, long) -#define OBD_IOC_PREALLOCATE _IOWR('f', 105, long) +#define OBD_IOC_CREATE _IOR ('f', 101, OBD_IOC_DATA_TYPE) +#define OBD_IOC_DESTROY _IOW ('f', 104, OBD_IOC_DATA_TYPE) +#define OBD_IOC_PREALLOCATE _IOWR('f', 105, OBD_IOC_DATA_TYPE) -#define OBD_IOC_SETATTR _IOW ('f', 107, long) -#define OBD_IOC_GETATTR _IOR ('f', 108, long) -#define OBD_IOC_READ _IOWR('f', 109, long) -#define OBD_IOC_WRITE _IOWR('f', 110, long) +#define OBD_IOC_SETATTR _IOW ('f', 107, OBD_IOC_DATA_TYPE) +#define OBD_IOC_GETATTR _IOR ('f', 108, OBD_IOC_DATA_TYPE) +#define OBD_IOC_READ _IOWR('f', 109, OBD_IOC_DATA_TYPE) +#define OBD_IOC_WRITE _IOWR('f', 110, OBD_IOC_DATA_TYPE) -#define OBD_IOC_STATFS _IOWR('f', 113, long) -#define OBD_IOC_SYNC _IOW ('f', 114, long) -#define OBD_IOC_READ2 _IOWR('f', 115, long) -#define OBD_IOC_FORMAT _IOWR('f', 116, long) -#define OBD_IOC_PARTITION _IOWR('f', 117, long) -#define OBD_IOC_COPY _IOWR('f', 120, long) -#define OBD_IOC_MIGR _IOWR('f', 121, long) -#define OBD_IOC_PUNCH _IOWR('f', 122, long) +#define OBD_IOC_STATFS _IOWR('f', 113, OBD_IOC_DATA_TYPE) +#define OBD_IOC_SYNC _IOW ('f', 114, OBD_IOC_DATA_TYPE) +#define OBD_IOC_READ2 _IOWR('f', 115, OBD_IOC_DATA_TYPE) +#define OBD_IOC_FORMAT _IOWR('f', 116, OBD_IOC_DATA_TYPE) +#define OBD_IOC_PARTITION _IOWR('f', 117, OBD_IOC_DATA_TYPE) +#define OBD_IOC_COPY _IOWR('f', 120, OBD_IOC_DATA_TYPE) +#define OBD_IOC_MIGR _IOWR('f', 121, OBD_IOC_DATA_TYPE) +#define OBD_IOC_PUNCH _IOWR('f', 122, OBD_IOC_DATA_TYPE) -#define OBD_IOC_MODULE_DEBUG _IOWR('f', 124, long) -#define OBD_IOC_BRW_READ _IOWR('f', 125, long) -#define OBD_IOC_BRW_WRITE _IOWR('f', 126, long) -#define OBD_IOC_NAME2DEV _IOWR('f', 127, long) -#define OBD_IOC_UUID2DEV _IOWR('f', 130, long) -#define OBD_IOC_GETNAME _IOR ('f', 131, long) +#define OBD_IOC_MODULE_DEBUG _IOWR('f', 124, OBD_IOC_DATA_TYPE) +#define OBD_IOC_BRW_READ _IOWR('f', 125, OBD_IOC_DATA_TYPE) +#define OBD_IOC_BRW_WRITE _IOWR('f', 126, OBD_IOC_DATA_TYPE) +#define OBD_IOC_NAME2DEV _IOWR('f', 127, OBD_IOC_DATA_TYPE) +#define OBD_IOC_UUID2DEV _IOWR('f', 130, OBD_IOC_DATA_TYPE) +#define OBD_IOC_GETNAME _IOR ('f', 131, OBD_IOC_DATA_TYPE) -#define OBD_IOC_LOV_GET_CONFIG _IOWR('f', 132, long) -#define OBD_IOC_CLIENT_RECOVER _IOW ('f', 133, long) +#define OBD_IOC_LOV_GET_CONFIG _IOWR('f', 132, OBD_IOC_DATA_TYPE) +#define OBD_IOC_CLIENT_RECOVER _IOW ('f', 133, OBD_IOC_DATA_TYPE) #define OBD_IOC_DEC_FS_USE_COUNT _IO ('f', 139 ) -#define OBD_IOC_NO_TRANSNO _IOW ('f', 140, long) -#define OBD_IOC_SET_READONLY _IOW ('f', 141, long) -#define OBD_IOC_ABORT_RECOVERY _IOR ('f', 142, long) +#define OBD_IOC_NO_TRANSNO _IOW ('f', 140, OBD_IOC_DATA_TYPE) +#define OBD_IOC_SET_READONLY _IOW ('f', 141, OBD_IOC_DATA_TYPE) +#define OBD_IOC_ABORT_RECOVERY _IOR ('f', 142, OBD_IOC_DATA_TYPE) -#define OBD_GET_VERSION _IOWR ('f', 144, long) +#define OBD_GET_VERSION _IOWR ('f', 144, OBD_IOC_DATA_TYPE) -#define OBD_IOC_CLOSE_UUID _IOWR ('f', 147, long) +#define OBD_IOC_CLOSE_UUID _IOWR ('f', 147, OBD_IOC_DATA_TYPE) -#define OBD_IOC_GETDEVICE _IOWR ('f', 149, long) +#define OBD_IOC_GETDEVICE _IOWR ('f', 149, OBD_IOC_DATA_TYPE) -#define OBD_IOC_LOV_SETSTRIPE _IOW ('f', 154, long) -#define OBD_IOC_LOV_GETSTRIPE _IOW ('f', 155, long) -#define OBD_IOC_LOV_SETEA _IOW ('f', 156, long) +#define OBD_IOC_LOV_SETSTRIPE _IOW ('f', 154, OBD_IOC_DATA_TYPE) +#define OBD_IOC_LOV_GETSTRIPE _IOW ('f', 155, OBD_IOC_DATA_TYPE) +#define OBD_IOC_LOV_SETEA _IOW ('f', 156, OBD_IOC_DATA_TYPE) #define OBD_IOC_QUOTACHECK _IOW ('f', 160, int) #define OBD_IOC_POLL_QUOTACHECK _IOR ('f', 161, struct if_quotacheck *) #define OBD_IOC_QUOTACTL _IOWR('f', 162, struct if_quotactl *) -#define OBD_IOC_MOUNTOPT _IOWR('f', 170, long) - -#define OBD_IOC_RECORD _IOWR('f', 180, long) -#define OBD_IOC_ENDRECORD _IOWR('f', 181, long) -#define OBD_IOC_PARSE _IOWR('f', 182, long) -#define OBD_IOC_DORECORD _IOWR('f', 183, long) -#define OBD_IOC_PROCESS_CFG _IOWR('f', 184, long) -#define OBD_IOC_DUMP_LOG _IOWR('f', 185, long) -#define OBD_IOC_CLEAR_LOG _IOWR('f', 186, long) - -#define OBD_IOC_CATLOGLIST _IOWR('f', 190, long) -#define OBD_IOC_LLOG_INFO _IOWR('f', 191, long) -#define OBD_IOC_LLOG_PRINT _IOWR('f', 192, long) -#define OBD_IOC_LLOG_CANCEL _IOWR('f', 193, long) -#define OBD_IOC_LLOG_REMOVE _IOWR('f', 194, long) -#define OBD_IOC_LLOG_CHECK _IOWR('f', 195, long) -#define OBD_IOC_LLOG_CATINFO _IOWR('f', 196, long) - -#define ECHO_IOC_GET_STRIPE _IOWR('f', 200, long) -#define ECHO_IOC_SET_STRIPE _IOWR('f', 201, long) -#define ECHO_IOC_ENQUEUE _IOWR('f', 202, long) -#define ECHO_IOC_CANCEL _IOWR('f', 203, long) +#define OBD_IOC_MOUNTOPT _IOWR('f', 170, OBD_IOC_DATA_TYPE) + +#define OBD_IOC_RECORD _IOWR('f', 180, OBD_IOC_DATA_TYPE) +#define OBD_IOC_ENDRECORD _IOWR('f', 181, OBD_IOC_DATA_TYPE) +#define OBD_IOC_PARSE _IOWR('f', 182, OBD_IOC_DATA_TYPE) +#define OBD_IOC_DORECORD _IOWR('f', 183, OBD_IOC_DATA_TYPE) +#define OBD_IOC_PROCESS_CFG _IOWR('f', 184, OBD_IOC_DATA_TYPE) +#define OBD_IOC_DUMP_LOG _IOWR('f', 185, OBD_IOC_DATA_TYPE) +#define OBD_IOC_CLEAR_LOG _IOWR('f', 186, OBD_IOC_DATA_TYPE) + +#define OBD_IOC_CATLOGLIST _IOWR('f', 190, OBD_IOC_DATA_TYPE) +#define OBD_IOC_LLOG_INFO _IOWR('f', 191, OBD_IOC_DATA_TYPE) +#define OBD_IOC_LLOG_PRINT _IOWR('f', 192, OBD_IOC_DATA_TYPE) +#define OBD_IOC_LLOG_CANCEL _IOWR('f', 193, OBD_IOC_DATA_TYPE) +#define OBD_IOC_LLOG_REMOVE _IOWR('f', 194, OBD_IOC_DATA_TYPE) +#define OBD_IOC_LLOG_CHECK _IOWR('f', 195, OBD_IOC_DATA_TYPE) +#define OBD_IOC_LLOG_CATINFO _IOWR('f', 196, OBD_IOC_DATA_TYPE) + +#define ECHO_IOC_GET_STRIPE _IOWR('f', 200, OBD_IOC_DATA_TYPE) +#define ECHO_IOC_SET_STRIPE _IOWR('f', 201, OBD_IOC_DATA_TYPE) +#define ECHO_IOC_ENQUEUE _IOWR('f', 202, OBD_IOC_DATA_TYPE) +#define ECHO_IOC_CANCEL _IOWR('f', 203, OBD_IOC_DATA_TYPE) /* XXX _IOWR('f', 250, long) has been defined in * lnet/include/libcfs/kp30.h for debug, don't use it @@ -596,7 +596,6 @@ struct l_wait_info { do { \ cfs_waitlink_t __wait; \ cfs_duration_t __timeout = info->lwi_timeout; \ - unsigned long __irqflags; \ cfs_sigset_t __blocked; \ \ ret = 0; \ @@ -622,13 +621,17 @@ do { \ break; \ \ if (__timeout == 0) { \ - schedule(); \ + cfs_waitq_wait(&__wait, CFS_TASK_INTERRUPTIBLE); \ } else { \ - unsigned long interval = info->lwi_interval? \ - min_t(unsigned long, \ + cfs_duration_t interval = info->lwi_interval? \ + min_t(cfs_duration_t, \ info->lwi_interval,__timeout):\ __timeout; \ - __timeout -= interval - schedule_timeout(interval); \ + cfs_duration_t remaining = cfs_waitq_timedwait(&__wait,\ + CFS_TASK_INTERRUPTIBLE, \ + interval); \ + __timeout = cfs_time_sub(__timeout, \ + cfs_time_sub(interval, remaining));\ if (__timeout == 0) { \ if (info->lwi_on_timeout == NULL || \ info->lwi_on_timeout(info->lwi_cb_data)) { \ @@ -657,16 +660,11 @@ do { \ /* -EINTR when the RPC actually succeeded. */ \ /* the RECALC_SIGPENDING below will deliver the */ \ /* signal properly. */ \ - cfs_sigmask_lock(__irqflags); \ cfs_clear_sigpending(); \ - cfs_sigmask_unlock(__irqflags); \ } \ } \ \ - cfs_sigmask_lock(__irqflags); \ cfs_block_sigs(__blocked); \ - RECALC_SIGPENDING; /*XXX cfs_recalc_sigpending();*/ \ - cfs_sigmask_unlock(__irqflags); \ \ set_current_state(TASK_RUNNING); \ cfs_waitq_del(&wq, &__wait); \ @@ -734,20 +732,6 @@ do { \ }) #ifdef __KERNEL__ -/* initialize ost_lvb according to inode */ -static inline void inode_init_lvb(struct inode *inode, struct ost_lvb *lvb) -{ - lvb->lvb_size = inode->i_size; - lvb->lvb_blocks = inode->i_blocks; - lvb->lvb_mtime = LTIME_S(inode->i_mtime); - lvb->lvb_atime = LTIME_S(inode->i_atime); - lvb->lvb_ctime = LTIME_S(inode->i_ctime); -} -#else -/* defined in liblustre/llite_lib.h */ -#endif - -#ifdef __KERNEL__ #define LIBLUSTRE_CLIENT (0) #else #define LIBLUSTRE_CLIENT (1) diff --git a/lustre/include/lustre_ucache.h b/lustre/include/lustre_ucache.h index 611c022..16b5c1a 100644 --- a/lustre/include/lustre_ucache.h +++ b/lustre/include/lustre_ucache.h @@ -35,8 +35,8 @@ struct upcall_cache_entry { atomic_t ue_refcount; int ue_flags; cfs_waitq_t ue_waitq; - unsigned long ue_acquire_expire; - unsigned long ue_expire; + cfs_time_t ue_acquire_expire; + cfs_time_t ue_expire; }; #define UC_CACHE_HASH_SIZE (128) @@ -49,8 +49,8 @@ struct upcall_cache { char uc_name[40]; /* for upcall */ char uc_upcall[UC_CACHE_UPCALL_MAXPATH]; - unsigned long uc_acquire_expire; /* jiffies */ - unsigned long uc_entry_expire; /* jiffies */ + cfs_time_t uc_acquire_expire; /* jiffies */ + cfs_time_t uc_entry_expire; /* jiffies */ }; struct upcall_cache_entry *upcall_cache_get_entry(struct upcall_cache *hash, diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 452c9e7..d0cec17 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -58,9 +58,9 @@ static void lov_getref(struct obd_device *obd) struct lov_obd *lov = &obd->u.lov; /* nobody gets through here until lov_putref is done */ - down(&lov->lov_lock); + mutex_down(&lov->lov_lock); atomic_inc(&lov->refcount); - up(&lov->lov_lock); + mutex_up(&lov->lov_lock); return; } @@ -69,7 +69,7 @@ static void __lov_del_obd(struct obd_device *obd, struct lov_tgt_desc *tgt); static void lov_putref(struct obd_device *obd) { struct lov_obd *lov = &obd->u.lov; - down(&lov->lov_lock); + mutex_down(&lov->lov_lock); /* ok to dec to 0 more than once -- ltd_exp's will be null */ if (atomic_dec_and_test(&lov->refcount) && lov->death_row) { struct lov_tgt_desc *tgt; @@ -84,7 +84,7 @@ static void lov_putref(struct obd_device *obd) lov->death_row--; } } - up(&lov->lov_lock); + mutex_up(&lov->lov_lock); } #define MAX_STRING_SIZE 128 @@ -1456,7 +1456,7 @@ static struct obd_async_page_ops lov_async_page_ops = { }; int lov_prep_async_page(struct obd_export *exp, struct lov_stripe_md *lsm, - struct lov_oinfo *loi, struct page *page, + struct lov_oinfo *loi, cfs_page_t *page, obd_off offset, struct obd_async_page_ops *ops, void *data, void **res) { @@ -2423,6 +2423,5 @@ MODULE_AUTHOR("Cluster File Systems, Inc. "); MODULE_DESCRIPTION("Lustre Logical Object Volume OBD driver"); MODULE_LICENSE("GPL"); -module_init(lov_init); -module_exit(lov_exit); +cfs_module(lov, "1.0.0", lov_init, lov_exit); #endif diff --git a/lustre/obdclass/autoMakefile.am b/lustre/obdclass/autoMakefile.am index f9850f9..e0982ca 100644 --- a/lustre/obdclass/autoMakefile.am +++ b/lustre/obdclass/autoMakefile.am @@ -29,10 +29,10 @@ if DARWIN macos_PROGRAMS := obdclass obdclass_SOURCES := \ - darwin/darwin-module.c darwin/darwin-sysctl.c \ - class_obd.c genops.c lprocfs_status.c \ - lustre_handles.c lustre_peer.c obd_config.c \ - obdo.c debug.c llog_ioctl.c uuid.c \ + darwin/darwin-module.c darwin/darwin-sysctl.c \ + class_obd.c genops.c lprocfs_status.c \ + lustre_handles.c lustre_peer.c obd_config.c \ + obdo.c debug.c llog_ioctl.c uuid.c prng.c \ llog_swab.c llog_obd.c llog.c llog_cat.c llog_lvfs.c obdclass_CFLAGS := $(EXTRA_KCFLAGS) diff --git a/lustre/obdclass/darwin/darwin-sysctl.c b/lustre/obdclass/darwin/darwin-sysctl.c index d2ce8c1..0a58cb5 100644 --- a/lustre/obdclass/darwin/darwin-sysctl.c +++ b/lustre/obdclass/darwin/darwin-sysctl.c @@ -100,10 +100,10 @@ int proc_obd_timeout SYSCTL_HANDLER_ARGS int error = 0; error = sysctl_handle_long(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (!error && req->newptr != NULL) { + if (!error && req->newptr != USER_ADDR_NULL) { if (ldlm_timeout >= obd_timeout) ldlm_timeout = max(obd_timeout / 3, 1U); - } else if (req->newptr != NULL) { + } else if (req->newptr != USER_ADDR_NULL) { printf ("sysctl fail obd_timeout: %d.\n", error); } else { /* Read request */ @@ -117,7 +117,7 @@ int read_build_version SYSCTL_HANDLER_ARGS int error = 0; error = sysctl_handle_long(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if ( req->newptr != NULL) { + if ( req->newptr != USER_ADDR_NULL) { printf("sysctl read_build_version is read-only!\n"); } else { error = SYSCTL_OUT(req, BUILD_VERSION, strlen(BUILD_VERSION)); diff --git a/lustre/obdclass/prng.c b/lustre/obdclass/prng.c index 909e311..b3c2a75 100644 --- a/lustre/obdclass/prng.c +++ b/lustre/obdclass/prng.c @@ -13,11 +13,10 @@ # define EXPORT_SYMTAB #endif -#ifdef __KERNEL__ -#include -#else +#ifndef __KERNEL__ #include #endif +#include /* From: George Marsaglia diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 2f3c315..e803411 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -529,7 +529,7 @@ static int filter_init_server_data(struct obd_device *obd, struct file * filp) obd->obd_recovery_start = CURRENT_SECONDS; /* Only used for lprocfs_status */ obd->obd_recovery_end = obd->obd_recovery_start + - OBD_RECOVERY_TIMEOUT / HZ; + OBD_RECOVERY_TIMEOUT; } out: @@ -1506,8 +1506,8 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf, obd->obd_recoverable_clients, (obd->obd_recoverable_clients == 1) ? "client" : "clients", - (int)(OBD_RECOVERY_TIMEOUT / HZ) / 60, - (int)(OBD_RECOVERY_TIMEOUT / HZ) % 60, + (int)(OBD_RECOVERY_TIMEOUT) / 60, + (int)(OBD_RECOVERY_TIMEOUT) % 60, obd->obd_name); } else { LCONSOLE_INFO("OST %s now serving %s (%s%s%s) with recovery " diff --git a/lustre/osc/osc_create.c b/lustre/osc/osc_create.c index a823d98..491f2d9 100644 --- a/lustre/osc/osc_create.c +++ b/lustre/osc/osc_create.c @@ -98,7 +98,7 @@ static int osc_interpret_create(struct ptlrpc_request *req, void *data, int rc) CDEBUG(D_HA, "preallocated through id "LPU64" (last used "LPU64")\n", oscc->oscc_last_id, oscc->oscc_next_id); - wake_up(&oscc->oscc_waitq); + cfs_waitq_signal(&oscc->oscc_waitq); RETURN(rc); } @@ -364,8 +364,8 @@ void oscc_init(struct obd_device *obd) oscc = &obd->u.cli.cl_oscc; memset(oscc, 0, sizeof(*oscc)); - INIT_LIST_HEAD(&oscc->oscc_list); - init_waitqueue_head(&oscc->oscc_waitq); + CFS_INIT_LIST_HEAD(&oscc->oscc_list); + cfs_waitq_init(&oscc->oscc_waitq); spin_lock_init(&oscc->oscc_lock); oscc->oscc_obd = obd; oscc->oscc_grow_count = OST_MIN_PRECREATE; @@ -373,7 +373,6 @@ void oscc_init(struct obd_device *obd) oscc->oscc_next_id = 2; oscc->oscc_last_id = 1; oscc->oscc_flags |= OSCC_FLAG_RECOVERING; - cfs_waitq_init(&oscc->oscc_waitq); /* XXX the export handle should give the oscc the last object */ /* oed->oed_oscc.oscc_last_id = exph->....; */ } diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index cc33a71..60cc4be 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -620,9 +620,9 @@ void osc_wake_cache_waiters(struct client_obd *cli) static void osc_init_grant(struct client_obd *cli, struct obd_connect_data *ocd) { - spin_lock(&cli->cl_loi_list_lock); + client_obd_list_lock(&cli->cl_loi_list_lock); cli->cl_avail_grant = ocd->ocd_grant; - spin_unlock(&cli->cl_loi_list_lock); + client_obd_list_unlock(&cli->cl_loi_list_lock); CDEBUG(D_CACHE, "setting cl_avail_grant: %ld cl_lost_grant: %ld\n", cli->cl_avail_grant, cli->cl_lost_grant); @@ -3200,12 +3200,12 @@ static int osc_reconnect(struct obd_export *exp, struct obd_device *obd, if (data != NULL && (data->ocd_connect_flags & OBD_CONNECT_GRANT)) { long lost_grant; - spin_lock(&cli->cl_loi_list_lock); + client_obd_list_lock(&cli->cl_loi_list_lock); data->ocd_grant = cli->cl_avail_grant ?: 2 * cli->cl_max_pages_per_rpc << PAGE_SHIFT; lost_grant = cli->cl_lost_grant; cli->cl_lost_grant = 0; - spin_unlock(&cli->cl_loi_list_lock); + client_obd_list_unlock(&cli->cl_loi_list_lock); CDEBUG(D_CACHE, "request ocd_grant: %d cl_avail_grant: %ld " "cl_lost_grant: %ld\n", data->ocd_grant, diff --git a/lustre/ptlrpc/pers.c b/lustre/ptlrpc/pers.c index 29913ff..865dcf0 100644 --- a/lustre/ptlrpc/pers.c +++ b/lustre/ptlrpc/pers.c @@ -67,9 +67,9 @@ void ptl_rpc_wipe_bulk_pages(struct ptlrpc_bulk_desc *desc) for (i = 0; i < desc->bd_iov_count ; i++) { lnet_kiov_t *kiov = &desc->bd_iov[i]; - memset(kmap(kiov->kiov_page)+kiov->kiov_offset, 0xab, - kiov->kiov_len); - kunmap(kiov->kiov_page); + memset(cfs_kmap(kiov->kiov_page)+kiov->kiov_offset, 0xab, + kiov->kiov_len); + cfs_kunmap(kiov->kiov_page); } } diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index 2efa215..dd52407 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -1070,13 +1070,13 @@ int mds_quota_recovery(struct obd_device *obd) int rc = 0; ENTRY; - down(&lov->lov_lock); + mutex_down(&lov->lov_lock); if (lov->desc.ld_tgt_count != lov->desc.ld_active_tgt_count) { CWARN("Not all osts are active, abort quota recovery\n"); - up(&lov->lov_lock); + mutex_up(&lov->lov_lock); RETURN(rc); } - up(&lov->lov_lock); + mutex_up(&lov->lov_lock); data.obd = obd; init_completion(&data.comp); -- 1.8.3.1