From: green Date: Wed, 21 Jun 2006 21:48:09 +0000 (+0000) Subject: Make patchless lustre client to compile and load on vanilla 2.6.17 X-Git-Tag: v1_7_100~1^90~8^2~81 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=6f9961f101b4d319527a02835c65ffa2c3c97fee;p=fs%2Flustre-release.git Make patchless lustre client to compile and load on vanilla 2.6.17 --- diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 3e93680..1214b17 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -77,6 +77,15 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt, #define TRYLOCK_INODE_MUTEX(inode) (!down_trylock(&(inode)->i_sem)) #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) +#define UNLOCK_DQONOFF_MUTEX(dqopt) do {mutex_unlock(&(dqopt)->dqonoff_mutex); } while(0) +#define LOCK_DQONOFF_MUTEX(dqopt) do {mutex_lock(&(dqopt)->dqonoff_mutex); } while(0) +#else +#define UNLOCK_DQONOFF_MUTEX(dqopt) do {up(&(dqopt)->dqonoff_sem); } while(0) +#define LOCK_DQONOFF_MUTEX(dqopt) do {down(&(dqopt)->dqonoff_sem); } while(0) +#endif + + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4) #define NGROUPS_SMALL NGROUPS #define NGROUPS_PER_BLOCK ((int)(EXEC_PAGESIZE / sizeof(gid_t))) diff --git a/lustre/include/linux/lustre_dlm.h b/lustre/include/linux/lustre_dlm.h index a96c161..26a3847 100644 --- a/lustre/include/linux/lustre_dlm.h +++ b/lustre/include/linux/lustre_dlm.h @@ -12,6 +12,7 @@ #ifdef __KERNEL__ # include +# include #endif #endif diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 318201e..70d385d 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -757,7 +757,6 @@ void ldlm_resource_unlink_lock(struct ldlm_lock *lock) check_res_locked(lock->l_resource); list_del_init(&lock->l_res_link); } -EXPORT_SYMBOL(ldlm_resource_unlink_lock); void ldlm_res2desc(struct ldlm_resource *res, struct ldlm_resource_desc *desc) { diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index fa33fce..2644908 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1673,7 +1673,7 @@ int ll_iocontrol(struct inode *inode, struct file *file, } case EXT3_IOC_SETFLAGS: { struct mdc_op_data op_data; - struct ll_iattr_struct attr = { 0 }; + struct ll_iattr_struct attr = { { 0 } }; struct obd_info oinfo = { { { 0 } } }; struct lov_stripe_md *lsm = ll_i2info(inode)->lli_smd; diff --git a/lustre/obdclass/linux/linux-module.c b/lustre/obdclass/linux/linux-module.c index 46a2207..ee68551 100644 --- a/lustre/obdclass/linux/linux-module.c +++ b/lustre/obdclass/linux/linux-module.c @@ -225,7 +225,11 @@ int obd_proc_read_kernel_version(char *page, char **start, off_t off, int count, int *eof, void *data) { *eof = 1; +#ifdef LUSTRE_KERNEL_VERSION return snprintf(page, count, "%u\n", LUSTRE_KERNEL_VERSION); +#else + return snprintf(page, count, "%u\n", "patchless"); +#endif } int obd_proc_read_pinger(char *page, char **start, off_t off, int count, @@ -431,6 +435,7 @@ int class_procfs_clean(void) /* Check that we're building against the appropriate version of the Lustre * kernel patch */ #include +#ifdef LUSTRE_KERNEL_VERSION #define LUSTRE_MIN_VERSION 37 #define LUSTRE_MAX_VERSION 47 #if (LUSTRE_KERNEL_VERSION < LUSTRE_MIN_VERSION) @@ -439,3 +444,4 @@ int class_procfs_clean(void) # error Cannot continue: Your Lustre sources are older than the kernel patch #endif #endif +#endif diff --git a/lustre/quota/quota_context.c b/lustre/quota/quota_context.c index c807e26..486e1ca 100644 --- a/lustre/quota/quota_context.c +++ b/lustre/quota/quota_context.c @@ -707,9 +707,9 @@ static int qslave_recovery_main(void *arg) struct dquot_id *dqid, *tmp; int ret; - down(&dqopt->dqonoff_sem); + LOCK_DQONOFF_MUTEX(dqopt); if (!sb_has_quota_enabled(qctxt->lqc_sb, type)) { - up(&dqopt->dqonoff_sem); + UNLOCK_DQONOFF_MUTEX(dqopt); break; } @@ -720,7 +720,7 @@ static int qslave_recovery_main(void *arg) #else rc = fsfilt_qids(obd, NULL, dqopt->files[type], type, &id_list); #endif - up(&dqopt->dqonoff_sem); + UNLOCK_DQONOFF_MUTEX(dqopt); if (rc) CERROR("Get ids from quota file failed. (rc:%d)\n", rc);