Whamcloud - gitweb
LU-5234 llite: restore newer kernel support for ll_read_dir 61/10761/2
authorJames Simmons <uja.ornl@gmail.com>
Thu, 19 Jun 2014 23:15:27 +0000 (19:15 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 23 Jun 2014 00:01:31 +0000 (00:01 +0000)
During the merger of the patch for LU-4906 the support for
newer kernels was removed in the new code. This patch
restores this functionality so RHEL7 and SuSE12 clients can
function again.

Change-Id: Ieea4fb23cd644b2d6ce998cfdba8e0e15e481fc5
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/10761
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/dir.c

index 48f8be8..519e2dc 100644 (file)
@@ -246,8 +246,14 @@ int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
                         * to access the 'ent' through its 'lde_name',
                         * so the parameter 'name' for 'filldir()' must
                         * be part of the 'ent'. */
                         * to access the 'ent' through its 'lde_name',
                         * so the parameter 'name' for 'filldir()' must
                         * be part of the 'ent'. */
+#ifdef HAVE_DIR_CONTEXT
+                       ctx->pos = lhash;
+                       done = !dir_emit(ctx, ent->lde_name, namelen, ino,
+                                        type);
+#else
                        done = filldir(cookie, ent->lde_name, namelen, lhash,
                                       ino, type);
                        done = filldir(cookie, ent->lde_name, namelen, lhash,
                                       ino, type);
+#endif
                }
 
                if (done) {
                }
 
                if (done) {
@@ -277,8 +283,11 @@ int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
                                               &chain);
                }
        }
                                               &chain);
                }
        }
-
+#ifdef HAVE_DIR_CONTEXT
+       ctx->pos = pos;
+#else
        *ppos = pos;
        *ppos = pos;
+#endif
        ll_dir_chain_fini(&chain);
        RETURN(rc);
 }
        ll_dir_chain_fini(&chain);
        RETURN(rc);
 }