#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)))
#ifdef __KERNEL__
# include <linux/proc_fs.h>
+# include <linux/bit_spinlock.h>
#endif
#endif
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)
{
}
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;
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,
/* 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)
# error Cannot continue: Your Lustre sources are older than the kernel patch
#endif
#endif
+#endif
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;
}
#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);