Whamcloud - gitweb
Branch HEAD
authoryangsheng <yangsheng>
Tue, 16 Oct 2007 10:03:11 +0000 (10:03 +0000)
committeryangsheng <yangsheng>
Tue, 16 Oct 2007 10:03:11 +0000 (10:03 +0000)
b=13568
i=adilger
i=ericm

Remove 2.4 kernel check from mds subsystem.

lustre/ChangeLog
lustre/mds/handler.c
lustre/mds/lproc_mds.c
lustre/mds/mds_fs.c
lustre/mds/mds_internal.h
lustre/mds/mds_lib.c
lustre/mds/mds_open.c
lustre/mds/mds_reint.c
lustre/mds/mds_xattr.c

index 7bcffb1..9764ee8 100644 (file)
@@ -436,6 +436,9 @@ Description: Remove 2.4 kernel checks lustre 1.8
 Details    : Remove 2.5.0 check from dcache.c dir.c file.c llite_internal.h
              llite_lib.c llite_mmap.c lproc_llite.c namei.c rw.c symlink.c
              llite subsystem.
+            Remove 2.5.0 check from handler.c lproc_mds.c mds_fs.c
+            mds_internal.h mds_lib.c mds_open.c mds_reint.c mds_xattr.c
+            in mds subsystem.
 
 --------------------------------------------------------------------------------
 
index 9ab8f63..1472f48 100644 (file)
 #include <linux/random.h>
 #include <linux/fs.h>
 #include <linux/jbd.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
-# include <linux/smp_lock.h>
-# include <linux/buffer_head.h>
-# include <linux/workqueue.h>
-# include <linux/mount.h>
-#else
-# include <linux/locks.h>
-#endif
+#include <linux/smp_lock.h>
+#include <linux/buffer_head.h>
+#include <linux/workqueue.h>
+#include <linux/mount.h>
 
 #include <linux/lustre_acl.h>
 #include <obd_class.h>
@@ -635,11 +631,9 @@ int mds_pack_posix_acl(struct inode *inode, struct lustre_msg *repmsg,
         if (!inode->i_op || !inode->i_op->getxattr)
                 GOTO(out, 0);
 
-        lock_24kernel();
         rc = inode->i_op->getxattr(&de, MDS_XATTR_NAME_ACL_ACCESS,
                                    lustre_msg_buf(repmsg, repoff, buflen),
                                    buflen);
-        unlock_24kernel();
 
         if (rc >= 0)
                 repbody->aclsize = rc;
@@ -814,10 +808,8 @@ static int mds_getattr_pack_msg(struct ptlrpc_request *req, struct inode *inode,
 
                 size[bufcount] = 0;
                 if (inode->i_op && inode->i_op->getxattr) {
-                        lock_24kernel();
                         rc = inode->i_op->getxattr(&de, MDS_XATTR_NAME_ACL_ACCESS,
                                                    NULL, 0);
-                        unlock_24kernel();
 
                         if (rc < 0) {
                                 if (rc != -ENODATA) {
index 05ae719..f8c7f83 100644 (file)
@@ -25,9 +25,7 @@
 #define DEBUG_SUBSYSTEM S_CLASS
 
 #include <linux/version.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
 #include <asm/statfs.h>
-#endif
 #include <obd.h>
 #include <obd_class.h>
 #include <lprocfs_status.h>
index 1ef9533..f4083dd 100644 (file)
@@ -36,9 +36,7 @@
 #include <linux/version.h>
 #include <linux/sched.h>
 #include <lustre_quota.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
 #include <linux/mount.h>
-#endif
 #include <lustre_mds.h>
 #include <obd_class.h>
 #include <obd_support.h>
index 35e312d..cdcc0f0 100644 (file)
@@ -43,11 +43,7 @@ static inline struct mds_obd *mds_req2mds(struct ptlrpc_request *req)
 
 #ifdef __KERNEL__
 /* Open counts for files.  No longer atomic, must hold inode->i_sem */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
 # define mds_inode_oatomic(inode)    ((inode)->i_cindex)
-#else
-# define mds_inode_oatomic(inode)    ((inode)->i_attr_flags)
-#endif
 
 #ifdef HAVE_I_ALLOC_SEM
 #define MDS_UP_READ_ORPHAN_SEM(i)          UP_READ_I_ALLOC_SEM(i)
index 83203de..b423941 100644 (file)
 #include <linux/stat.h>
 #include <linux/errno.h>
 #include <linux/version.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-# include <linux/locks.h>   // for wait_on_buffer
-#else
-# include <linux/buffer_head.h>   // for wait_on_buffer
-#endif
+#include <linux/buffer_head.h>   // for wait_on_buffer
 #include <linux/unistd.h>
 
 #include <asm/system.h>
index 5136883..041fdc5 100644 (file)
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/version.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
-# include <linux/buffer_head.h>
-# include <linux/workqueue.h>
-#else
-# include <linux/locks.h>
-#endif
+#include <linux/buffer_head.h>
+#include <linux/workqueue.h>
 
 #include <obd_class.h>
 #include <obd_lov.h>
index 6e2688b..c548061 100644 (file)
@@ -2244,12 +2244,10 @@ no_unlink:
         OBD_FAIL_WRITE(OBD_FAIL_MDS_REINT_RENAME_WRITE,
                        de_srcdir->d_inode->i_sb);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
         /* Check if we are moving old entry into its child. 2.6 does not
            check for this in vfs_rename() anymore */
         if (is_subdir(de_new, de_old))
                 GOTO(cleanup, rc = -EINVAL);
-#endif
 
         lmm = lustre_msg_buf(req->rq_repmsg, offset + 1, 0);
         handle = fsfilt_start_log(obd, de_tgtdir->d_inode, FSFILT_OP_RENAME,
index 52e9a5f..ce3199d 100644 (file)
@@ -132,10 +132,8 @@ static int mds_getxattr_internal(struct obd_device *obd,
                 DEBUG_REQ(D_INODE, req, "getxattr %s", xattr_name);
 
                 if (inode->i_op && inode->i_op->getxattr) {
-                        lock_24kernel();
                         rc = inode->i_op->getxattr(dentry, xattr_name,
                                                    buf, buflen);
-                        unlock_24kernel();
                 }
 
                 if (rc < 0 && rc != -ENODATA && rc != -EOPNOTSUPP &&
@@ -145,9 +143,7 @@ static int mds_getxattr_internal(struct obd_device *obd,
                 DEBUG_REQ(D_INODE, req, "listxattr");
 
                 if (inode->i_op && inode->i_op->listxattr) {
-                        lock_24kernel();
                         rc = inode->i_op->listxattr(dentry, buf, buflen);
-                        unlock_24kernel();
                 }
                 if (rc < 0)
                         CDEBUG(D_OTHER, "listxattr failed: %d\n", rc);
@@ -289,18 +285,14 @@ int mds_setxattr_internal(struct ptlrpc_request *req, struct mds_body *body)
                                                        REQ_REC_OFF+2, xattrlen);
 
                         LOCK_INODE_MUTEX(inode);
-                        lock_24kernel();
                         rc = inode->i_op->setxattr(de, xattr_name, xattr,
                                                    xattrlen, body->flags);
-                        unlock_24kernel();
                         UNLOCK_INODE_MUTEX(inode);
                 }
         } else if (body->valid & OBD_MD_FLXATTRRM) {
                 if (inode->i_op && inode->i_op->removexattr) {
                         LOCK_INODE_MUTEX(inode);
-                        lock_24kernel();
                         rc = inode->i_op->removexattr(de, xattr_name);
-                        unlock_24kernel();
                         UNLOCK_INODE_MUTEX(inode);
                 }
         } else {