Whamcloud - gitweb
LU-64 Modify the behavior of ioctl on directories without EA set.
[fs/lustre-release.git] / lustre / mdd / mdd_dir.c
index ba0ab43..f9d0c7f 100644 (file)
@@ -250,8 +250,8 @@ static int mdd_dir_is_empty(const struct lu_env *env,
                 RETURN(-ENOTDIR);
 
         iops = &obj->do_index_ops->dio_it;
-        it = iops->init(env, obj, BYPASS_CAPA);
-        if (it != NULL) {
+        it = iops->init(env, obj, LUDA_64BITHASH, BYPASS_CAPA);
+        if (!IS_ERR(it)) {
                 result = iops->get(env, it, (const void *)"");
                 if (result > 0) {
                         int i;
@@ -270,7 +270,7 @@ static int mdd_dir_is_empty(const struct lu_env *env,
                 iops->put(env, it);
                 iops->fini(env, it);
         } else
-                result = -ENOMEM;
+                result = PTR_ERR(it);
         RETURN(result);
 }
 
@@ -2442,7 +2442,7 @@ static int mdd_links_add(const struct lu_env *env,
                                PFID(mdd_object_fid(mdd_obj)));
         }
 
-        if (buf->lb_vmalloc)
+        if (buf->lb_len > OBD_ALLOC_BIG)
                 /* if we vmalloced a large buffer drop it */
                 mdd_buf_put(buf);
 
@@ -2529,7 +2529,7 @@ out:
                        oldlname->ln_namelen, oldlname->ln_name, rc,
                        PFID(mdd_object_fid(mdd_obj)));
 
-        if (buf->lb_vmalloc)
+        if (buf->lb_len > OBD_ALLOC_BIG)
                 /* if we vmalloced a large buffer drop it */
                 mdd_buf_put(buf);