Whamcloud - gitweb
LU-6215 llite: filldir_t api changed for 3.18 kernels
[fs/lustre-release.git] / lustre / llite / llite_nfs.c
index 6fb3315..38e2726 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -42,7 +42,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_LLITE
-#include <lustre_lite.h>
 #include "llite_internal.h"
 #include <linux/exportfs.h>
 
@@ -136,19 +135,6 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren
                 RETURN(ERR_PTR(-ESTALE));
         }
 
-        /**
-         * It is an anonymous dentry without OST objects created yet.
-         * We have to find the parent to tell MDS how to init lov objects.
-         */
-       if (S_ISREG(inode->i_mode) && !ll_i2info(inode)->lli_has_smd &&
-           parent != NULL && !fid_is_zero(parent)) {
-               struct ll_inode_info *lli = ll_i2info(inode);
-
-               spin_lock(&lli->lli_lock);
-               lli->lli_pfid = *parent;
-               spin_unlock(&lli->lli_lock);
-       }
-
        result = d_obtain_alias(inode);
        if (IS_ERR(result)) {
                iput(inode);
@@ -208,13 +194,22 @@ static int ll_encode_fh(struct inode *inode, __u32 *fh, int *plen,
        RETURN(FILEID_LUSTRE);
 }
 
-static int ll_nfs_get_name_filldir(void *cookie, const char *name, int namelen,
-                                   loff_t hash, u64 ino, unsigned type)
+static int
+#ifndef HAVE_FILLDIR_USE_CTX
+ll_nfs_get_name_filldir(void *cookie, const char *name, int namelen,
+                       loff_t hash, u64 ino, unsigned type)
+{
+       struct ll_getname_data *lgd = cookie;
+#else
+ll_nfs_get_name_filldir(struct dir_context *ctx, const char *name, int namelen,
+                       loff_t hash, u64 ino, unsigned type)
 {
+       struct ll_getname_data *lgd =
+               container_of(ctx, struct ll_getname_data, ctx);
+#endif /* HAVE_FILLDIR_USE_CTX */
         /* It is hack to access lde_fid for comparison with lgd_fid.
          * So the input 'name' must be part of the 'lu_dirent'. */
         struct lu_dirent *lde = container_of0(name, struct lu_dirent, lde_name);
-        struct ll_getname_data *lgd = cookie;
         struct lu_fid fid;
 
         fid_le_to_cpu(&fid, &lde->lde_fid);