Whamcloud - gitweb
Make patchless lustre client to compile and load on vanilla 2.6.17
authorgreen <green>
Wed, 21 Jun 2006 21:48:09 +0000 (21:48 +0000)
committergreen <green>
Wed, 21 Jun 2006 21:48:09 +0000 (21:48 +0000)
lustre/include/linux/lustre_compat25.h
lustre/include/linux/lustre_dlm.h
lustre/ldlm/ldlm_resource.c
lustre/llite/llite_lib.c
lustre/obdclass/linux/linux-module.c
lustre/quota/quota_context.c

index 3e93680..1214b17 100644 (file)
@@ -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)))
index a96c161..26a3847 100644 (file)
@@ -12,6 +12,7 @@
 
 #ifdef __KERNEL__
 # include <linux/proc_fs.h>
+# include <linux/bit_spinlock.h>
 #endif
 
 #endif
index 318201e..70d385d 100644 (file)
@@ -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)
 {
index fa33fce..2644908 100644 (file)
@@ -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;
 
index 46a2207..ee68551 100644 (file)
@@ -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 <linux/lustre_version.h>
+#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
index c807e26..486e1ca 100644 (file)
@@ -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);