From 46cd5b6f7c2e1c3731fe36176e01622d0e7c6608 Mon Sep 17 00:00:00 2001 From: wangdi Date: Thu, 15 Sep 2005 17:53:50 +0000 Subject: [PATCH] Branch: HEAD add flock fix patch of Donm fix about build warning in lustre_dlm.h --- lustre/include/linux/lustre_dlm.h | 4 +-- .../patches/linux-2.6.10-flock.patch | 35 ++++++++++++++++++++++ lustre/kernel_patches/series/2.6-fc3-uml.series | 2 +- lustre/kernel_patches/series/2.6-fc3.series | 1 + 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 lustre/kernel_patches/patches/linux-2.6.10-flock.patch diff --git a/lustre/include/linux/lustre_dlm.h b/lustre/include/linux/lustre_dlm.h index 5894b24..3d089e4 100644 --- a/lustre/include/linux/lustre_dlm.h +++ b/lustre/include/linux/lustre_dlm.h @@ -687,7 +687,7 @@ static inline void check_res_locked(struct ldlm_resource *res) { LASSERT_SPIN_LOCKED(&res->lr_lock); } - +#ifdef __KERNEL__ static inline void lock_bitlock(struct ldlm_lock *lock) { bit_spin_lock(LDLM_FL_LOCK_PROTECT_BIT, (void *) &lock->l_flags); @@ -701,7 +701,7 @@ static inline void unlock_bitlock(struct ldlm_lock *lock) lock->l_pidb = 0; bit_spin_unlock(LDLM_FL_LOCK_PROTECT_BIT, (void *) &lock->l_flags); } - +#endif struct ldlm_resource * lock_res_and_lock(struct ldlm_lock *lock); void unlock_res_and_lock(struct ldlm_lock *lock); diff --git a/lustre/kernel_patches/patches/linux-2.6.10-flock.patch b/lustre/kernel_patches/patches/linux-2.6.10-flock.patch new file mode 100644 index 0000000..da92880 --- /dev/null +++ b/lustre/kernel_patches/patches/linux-2.6.10-flock.patch @@ -0,0 +1,35 @@ +Index: linux-2.6.10-base/fs/locks.c +=================================================================== +--- linux-2.6.10-base.orig/fs/locks.c 2005-09-16 01:45:22.000000000 +0800 ++++ linux-2.6.10-base/fs/locks.c 2005-09-16 01:45:48.000000000 +0800 +@@ -1819,14 +1819,6 @@ + { + struct file_lock lock, **before; + +- /* +- * If there are no locks held on this file, we don't need to call +- * posix_lock_file(). Another process could be setting a lock on this +- * file at the same time, but we wouldn't remove that lock anyway. +- */ +- before = &filp->f_dentry->d_inode->i_flock; +- if (*before == NULL) +- return; + + lock.fl_type = F_UNLCK; + lock.fl_flags = FL_POSIX; +@@ -1843,6 +1835,15 @@ + goto out; + } + ++ /* ++ * If there are no locks held on this file, we don't need to call ++ * posix_lock_file(). Another process could be setting a lock on this ++ * file at the same time, but we wouldn't remove that lock anyway. ++ */ ++ before = &filp->f_dentry->d_inode->i_flock; ++ if (*before == NULL) ++ return; ++ + /* Can't use posix_lock_file here; we need to remove it no matter + * which pid we have. + */ diff --git a/lustre/kernel_patches/series/2.6-fc3-uml.series b/lustre/kernel_patches/series/2.6-fc3-uml.series index 6dde515..4252ded 100644 --- a/lustre/kernel_patches/series/2.6-fc3-uml.series +++ b/lustre/kernel_patches/series/2.6-fc3-uml.series @@ -27,4 +27,4 @@ vfs-intent_release_umount-vanilla-2.6.10-fc3.patch vfs-umount_lustre-vanilla-2.6.10-fc3.patch nid-2.6-fc3.patch pag-basic-2.6.10-fc3.patch - +linux-2.6.10-flock.patch diff --git a/lustre/kernel_patches/series/2.6-fc3.series b/lustre/kernel_patches/series/2.6-fc3.series index 7757288..3959ebd 100644 --- a/lustre/kernel_patches/series/2.6-fc3.series +++ b/lustre/kernel_patches/series/2.6-fc3.series @@ -33,3 +33,4 @@ highmem-split-2.6.10-fc3.patch pag-basic-2.6.10-fc3.patch sd_iostats-2.6-rhel4.patch scsi-max-phys-segments-256.patch +linux-2.6.10-flock.patch -- 1.8.3.1