]> git.proxmox.com Git - mirror_spl.git/commitdiff
Remove i_mutex() configure check
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 1 Oct 2014 21:07:46 +0000 (17:07 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 17 Oct 2014 22:11:51 +0000 (15:11 -0700)
The inode structure has used i_mutex as its internal locking
primitive since 2.6.16.  The compatibility code to check for
the previous semaphore primitive has been removed.  However,
the wrapper function itself is being kept because it's entirely
possible this primitive will change again to allow finer grained
locking.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
config/spl-build.m4
include/linux/file_compat.h
module/spl/spl-vnode.c

index b1e8d930eef5e422420065df0147f27aef9d4978..b7ce61fc820864dce7a616d181e321beb72468a8 100644 (file)
@@ -27,7 +27,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        SPL_AC_CTL_NAME
        SPL_AC_VMALLOC_INFO
        SPL_AC_PDE_DATA
-       SPL_AC_INODE_I_MUTEX
        SPL_AC_MUTEX_OWNER
        SPL_AC_MUTEX_OWNER_TASK_STRUCT
        SPL_AC_MUTEX_LOCK_NESTED
@@ -926,26 +925,6 @@ AC_DEFUN([SPL_AC_CTL_NAME], [
        ])
 ])
 
-dnl #
-dnl # 2.6.16 API change,
-dnl # check whether 'struct inode' has i_mutex
-dnl #
-AC_DEFUN([SPL_AC_INODE_I_MUTEX], [
-       AC_MSG_CHECKING([whether struct inode has i_mutex])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-               #include <linux/mutex.h>
-       ],[
-               struct inode i;
-               mutex_init(&i.i_mutex);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INODE_I_MUTEX, 1, [struct inode has i_mutex])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
 dnl #
 dnl # 2.6.29 API change,
 dnl # Adaptive mutexs were introduced which track the mutex owner.  The
index 949d844e76b1cd3471aaa2eb271652af0cabf8c5..09d0e825011f2e402c3b8f2c88543e7ee8c6a2de 100644 (file)
@@ -81,15 +81,8 @@ spl_filp_fallocate(struct file *fp, int mode, loff_t offset, loff_t len)
 # define spl_filp_fsync(fp, sync)      file_fsync(fp, (fp)->f_dentry, sync)
 #endif /* HAVE_VFS_FSYNC */
 
-#ifdef HAVE_INODE_I_MUTEX
-#define spl_inode_lock(ip)             (mutex_lock(&(ip)->i_mutex))
-#define spl_inode_lock_nested(ip, type)        (mutex_lock_nested((&(ip)->i_mutex),  \
-                                       (type)))
-#define spl_inode_unlock(ip)           (mutex_unlock(&(ip)->i_mutex))
-#else
-#define spl_inode_lock(ip)             (down(&(ip)->i_sem))
-#define spl_inode_unlock(ip)           (up(&(ip)->i_sem))
-#endif /* HAVE_INODE_I_MUTEX */
+#define        spl_inode_lock(ip)              mutex_lock(&(ip)->i_mutex)
+#define        spl_inode_unlock(ip)            mutex_unlock(&(ip)->i_mutex)
 
 #endif /* SPL_FILE_COMPAT_H */
 
index e4eac22eb7b5c00c06284562f4d02212a18a78c5..a8c5f974df2a68fadb78d8681b5cd5c377514cc7 100644 (file)
@@ -381,7 +381,7 @@ spl_kern_path_locked(const char *name, struct path *path)
        if (rc)
                return (ERR_PTR(rc));
 
-       spl_inode_lock_nested(parent.dentry->d_inode, I_MUTEX_PARENT);
+       spl_inode_lock(parent.dentry->d_inode);
 
        dentry = lookup_one_len(basename, parent.dentry, len);
        if (IS_ERR(dentry)) {