Whamcloud - gitweb
Brach HEAD
authorwangdi <wangdi>
Tue, 31 May 2005 14:52:12 +0000 (14:52 +0000)
committerwangdi <wangdi>
Tue, 31 May 2005 14:52:12 +0000 (14:52 +0000)
r:alex
add lookup-raw patches for raw lookup acceptance tests

ldiskfs/kernel_patches/series/ldiskfs-2.6-fc3.series
lustre/autoconf/lustre-core.m4
lustre/kernel_patches/patches/ext3-raw-lookup-2.6.10.patch [new file with mode: 0644]
lustre/kernel_patches/patches/vfs-raw_ops-vanilla-2.6.10-fc3.patch
lustre/kernel_patches/series/ldiskfs-2.6-fc3.series
lustre/mds/handler.c
lustre/smfs/dir.c

index fc31bfb..cf724c8 100644 (file)
@@ -14,3 +14,4 @@ ext3-extents-in-ea-ioctl-2.6.10-fc3.patch
 ext3-extents-in-ea-exports-symbol-2.6.7.patch
 ext3-mds-num-2.6.10-fc3.patch
 ext3-fid-2.6.7.patch
 ext3-extents-in-ea-exports-symbol-2.6.7.patch
 ext3-mds-num-2.6.10-fc3.patch
 ext3-fid-2.6.7.patch
+ext3-raw-lookup-2.6.10.patch
index bf57b64..cb91310 100644 (file)
@@ -317,6 +317,20 @@ case $BACKINGFS in
 esac # $BACKINGFS
 ])
 
 esac # $BACKINGFS
 ])
 
+# check lookup_raw
+AC_DEFUN([LC_CONFIG_LOOKUP_RAW],
+[AC_MSG_CHECKING([whether to have raw lookup patch])
+HAVE_LOOKUP_RAW="`grep -c -s 'raw-lookup' $LUSTRE/kernel_patches/series/ldiskfs-$LDISKFS_SERIES`"
+
+if test x$HAVE_LOOKUP_RAW = "x1" ; then
+        AC_DEFINE(HAVE_LOOKUP_RAW, 1,
+                [kernel have lookup raw patch])
+        AC_MSG_RESULT(yes)
+else
+        AC_MSG_RESULT(no)
+fi
+])
+
 #
 # LC_CONFIG_PINGER
 #
 #
 # LC_CONFIG_PINGER
 #
@@ -407,6 +421,7 @@ AC_MSG_RESULT([$enable_smfs])
 AC_DEFUN([LC_PROG_LINUX],
 [if test x$enable_server = xyes ; then
        LC_CONFIG_BACKINGFS
 AC_DEFUN([LC_PROG_LINUX],
 [if test x$enable_server = xyes ; then
        LC_CONFIG_BACKINGFS
+       LC_CONFIG_LOOKUP_RAW
 fi
 LC_CONFIG_PINGER
 LC_CONFIG_GSS
 fi
 LC_CONFIG_PINGER
 LC_CONFIG_GSS
diff --git a/lustre/kernel_patches/patches/ext3-raw-lookup-2.6.10.patch b/lustre/kernel_patches/patches/ext3-raw-lookup-2.6.10.patch
new file mode 100644 (file)
index 0000000..7143a3c
--- /dev/null
@@ -0,0 +1,49 @@
+Index: linux-2.6.10/fs/ext3/namei.c
+===================================================================
+--- linux-2.6.10.orig/fs/ext3/namei.c  2005-05-31 22:20:10.000000000 +0800
++++ linux-2.6.10/fs/ext3/namei.c       2005-05-31 22:20:10.000000000 +0800
+@@ -1178,6 +1178,36 @@
+       return iopen_connect_dentry(dentry, inode, 1);
+ }
++static int ext3_lookup_raw(struct inode *dir, const char *name,
++                           int len, ino_t *data)
++{
++       struct ext3_dir_entry_2 *de;
++       struct buffer_head *bh;
++       struct dentry parent;
++       struct dentry dentry;
++       void *lock = NULL;
++
++       if (len > EXT3_NAME_LEN)
++               return -ENAMETOOLONG;
++
++       parent.d_inode = dir;
++       dentry.d_parent = &parent;
++       dentry.d_name.name = name;
++       dentry.d_name.len = len;
++
++       bh = ext3_find_entry(&dentry, &de, 0, &lock);
++       if (bh) {
++               unsigned long ino = le32_to_cpu(de->inode);
++               ext3_unlock_htree(dir, lock);
++               brelse (bh);
++               if (data)
++                       *data = ino;
++               return 0; /* found name */
++       }
++
++       return -ENOENT;
++}
++
+ struct dentry *ext3_get_parent(struct dentry *child)
+ {
+@@ -2854,6 +2884,7 @@
+ struct inode_operations ext3_dir_inode_operations = {
+       .create         = ext3_create,
+       .lookup         = ext3_lookup,
++      .lookup_raw     = ext3_lookup_raw,
+       .link           = ext3_link,
+       .unlink         = ext3_unlink,
+       .symlink        = ext3_symlink,
index ad2d3ab..2e1ecf3 100644 (file)
@@ -1,7 +1,7 @@
 Index: linux-2.6.10/fs/namei.c
 ===================================================================
 Index: linux-2.6.10/fs/namei.c
 ===================================================================
---- linux-2.6.10.orig/fs/namei.c       2005-03-31 17:43:42.417809208 +0800
-+++ linux-2.6.10/fs/namei.c    2005-03-31 17:47:14.292599344 +0800
+--- linux-2.6.10.orig/fs/namei.c       2005-05-18 11:50:10.000000000 +0800
++++ linux-2.6.10/fs/namei.c    2005-05-18 11:50:11.000000000 +0800
 @@ -474,6 +474,7 @@
        intent_init(&nd->intent.open, it.op);
        nd->intent.open.flags = it.flags;
 @@ -474,6 +474,7 @@
        intent_init(&nd->intent.open, it.op);
        nd->intent.open.flags = it.flags;
@@ -186,9 +186,17 @@ Index: linux-2.6.10/fs/namei.c
        if (newnd.last_type != LAST_NORM)
 Index: linux-2.6.10/include/linux/fs.h
 ===================================================================
        if (newnd.last_type != LAST_NORM)
 Index: linux-2.6.10/include/linux/fs.h
 ===================================================================
---- linux-2.6.10.orig/include/linux/fs.h       2005-03-31 17:03:37.000000000 +0800
-+++ linux-2.6.10/include/linux/fs.h    2005-03-31 17:46:35.715463960 +0800
-@@ -956,6 +956,7 @@
+--- linux-2.6.10.orig/include/linux/fs.h       2005-05-18 11:50:10.000000000 +0800
++++ linux-2.6.10/include/linux/fs.h    2005-05-31 22:22:38.000000000 +0800
+@@ -943,6 +943,7 @@
+       int (*mkdir) (struct inode *,struct dentry *,int);
+       int (*rmdir) (struct inode *,struct dentry *);
+       int (*mknod) (struct inode *,struct dentry *,int,dev_t);
++      int (*lookup_raw) (struct inode *, const char *, int, ino_t *);
+       int (*rename) (struct inode *, struct dentry *,
+                       struct inode *, struct dentry *);
+       int (*readlink) (struct dentry *, char __user *,int);
+@@ -956,6 +957,7 @@
        ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
        ssize_t (*listxattr) (struct dentry *, char *, size_t);
        int (*removexattr) (struct dentry *, const char *);
        ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
        ssize_t (*listxattr) (struct dentry *, char *, size_t);
        int (*removexattr) (struct dentry *, const char *);
@@ -198,8 +206,8 @@ Index: linux-2.6.10/include/linux/fs.h
  struct seq_file;
 Index: linux-2.6.10/include/linux/namei.h
 ===================================================================
  struct seq_file;
 Index: linux-2.6.10/include/linux/namei.h
 ===================================================================
---- linux-2.6.10.orig/include/linux/namei.h    2005-03-31 17:43:42.472800848 +0800
-+++ linux-2.6.10/include/linux/namei.h 2005-03-31 17:50:12.533502608 +0800
+--- linux-2.6.10.orig/include/linux/namei.h    2005-05-18 11:50:10.000000000 +0800
++++ linux-2.6.10/include/linux/namei.h 2005-05-18 11:50:11.000000000 +0800
 @@ -15,8 +15,19 @@
  #define IT_UNLINK     (1<<5)
  #define IT_TRUNC      (1<<6)
 @@ -15,8 +15,19 @@
  #define IT_UNLINK     (1<<5)
  #define IT_TRUNC      (1<<6)
index fc31bfb..cf724c8 100644 (file)
@@ -14,3 +14,4 @@ ext3-extents-in-ea-ioctl-2.6.10-fc3.patch
 ext3-extents-in-ea-exports-symbol-2.6.7.patch
 ext3-mds-num-2.6.10-fc3.patch
 ext3-fid-2.6.7.patch
 ext3-extents-in-ea-exports-symbol-2.6.7.patch
 ext3-mds-num-2.6.10-fc3.patch
 ext3-fid-2.6.7.patch
+ext3-raw-lookup-2.6.10.patch
index f81b930..62eb8c1 100644 (file)
@@ -1354,7 +1354,6 @@ static int mds_getattr_lock(struct ptlrpc_request *req, int offset,
                 LASSERT(lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT);
                 resent_req = 1;
         }
                 LASSERT(lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT);
                 resent_req = 1;
         }
-#if 0        
 #if HAVE_LOOKUP_RAW
         if (body->valid == OBD_MD_FLID) {
                 struct mds_body *mds_reply;
 #if HAVE_LOOKUP_RAW
         if (body->valid == OBD_MD_FLID) {
                 struct mds_body *mds_reply;
@@ -1367,7 +1366,6 @@ static int mds_getattr_lock(struct ptlrpc_request *req, int offset,
                         rc = PTR_ERR(dparent);
                         GOTO(cleanup, rc);
                 }
                         rc = PTR_ERR(dparent);
                         GOTO(cleanup, rc);
                 }
-
                 /*
                  * the user requested ONLY the inode number, so do a raw lookup.
                  */
                 /*
                  * the user requested ONLY the inode number, so do a raw lookup.
                  */
@@ -1389,7 +1387,6 @@ static int mds_getattr_lock(struct ptlrpc_request *req, int offset,
                 GOTO(cleanup, rc);
         }
 #endif
                 GOTO(cleanup, rc);
         }
 #endif
-#endif
         if (resent_req == 0) {
                 LASSERT(id_fid(&body->id1) != 0);
                 if (name) {
         if (resent_req == 0) {
                 LASSERT(id_fid(&body->id1) != 0);
                 if (name) {
index cc75ff1..3dde19f 100644 (file)
@@ -307,6 +307,24 @@ static struct dentry *smfs_lookup(struct inode *dir, struct dentry *dentry,
         RETURN(rdentry);
 }
 
         RETURN(rdentry);
 }
 
+static int smfs_lookup_raw(struct inode *dir, const char *name,
+                           int len, ino_t *data)
+{
+        struct inode *cache_dir = I2CI(dir);
+        int rc = 0;
+
+        if (!cache_dir)
+                RETURN(-ENOENT);
+        
+        if (cache_dir->i_op->lookup_raw) {
+                rc = cache_dir->i_op->lookup_raw(cache_dir, name, len, data);
+        } else {
+                CWARN("do not have raw lookup ops in bottom fs\n");
+        }
+
+        RETURN(rc);
+}
+
 static int smfs_link(struct dentry *old_dentry,
                      struct inode *dir, struct dentry *dentry)
 {
 static int smfs_link(struct dentry *old_dentry,
                      struct inode *dir, struct dentry *dentry)
 {
@@ -751,6 +769,7 @@ exit:
 struct inode_operations smfs_dir_iops = {
         create:         smfs_create,
         lookup:         smfs_lookup,
 struct inode_operations smfs_dir_iops = {
         create:         smfs_create,
         lookup:         smfs_lookup,
+        lookup_raw:     smfs_lookup_raw,
         link:           smfs_link,              /* BKL held */
         unlink:         smfs_unlink,            /* BKL held */
         symlink:        smfs_symlink,           /* BKL held */
         link:           smfs_link,              /* BKL held */
         unlink:         smfs_unlink,            /* BKL held */
         symlink:        smfs_symlink,           /* BKL held */