Whamcloud - gitweb
LU-4768 tests: Update ost-survey script
[fs/lustre-release.git] / lustre / llite / xattr.c
index 509d9c8..f0d48f4 100644 (file)
@@ -42,7 +42,6 @@
 #define DEBUG_SUBSYSTEM S_LLITE
 
 #include <obd_support.h>
-#include <lustre_lite.h>
 #include <lustre_dlm.h>
 #include <lustre_ver.h>
 #include <lustre_eacl.h>
@@ -250,6 +249,7 @@ int ll_setxattr(struct dentry *dentry, const char *name,
                        int lum_size = (lump->lmm_magic == LOV_USER_MAGIC_V1) ?
                                sizeof(*lump) : sizeof(struct lov_user_md_v3);
 
+                       memset(&f, 0, sizeof(f)); /* f.f_flags is used below */
                        f.f_dentry = dentry;
                        rc = ll_lov_setstripe_ea_info(inode, &f, it_flags, lump,
                                                      lum_size);
@@ -398,25 +398,25 @@ getxattr_nocache:
 
                /* only detect the xattr size */
                if (size == 0)
-                       GOTO(out, rc = body->eadatasize);
+                       GOTO(out, rc = body->mbo_eadatasize);
 
-               if (size < body->eadatasize) {
+               if (size < body->mbo_eadatasize) {
                        CERROR("server bug: replied size %u > %u\n",
-                               body->eadatasize, (int)size);
+                               body->mbo_eadatasize, (int)size);
                        GOTO(out, rc = -ERANGE);
                }
 
-               if (body->eadatasize == 0)
+               if (body->mbo_eadatasize == 0)
                        GOTO(out, rc = -ENODATA);
 
                /* do not need swab xattr data */
                xdata = req_capsule_server_sized_get(&req->rq_pill, &RMF_EADATA,
-                                                       body->eadatasize);
+                                                       body->mbo_eadatasize);
                if (!xdata)
                        GOTO(out, rc = -EFAULT);
 
-               memcpy(buffer, xdata, body->eadatasize);
-               rc = body->eadatasize;
+               memcpy(buffer, xdata, body->mbo_eadatasize);
+               rc = body->mbo_eadatasize;
        }
 
 #ifdef CONFIG_FS_POSIX_ACL
@@ -477,12 +477,6 @@ ssize_t ll_getxattr(struct dentry *dentry, const char *name,
                 if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode))
                         return -ENODATA;
 
-                if (size == 0 && S_ISDIR(inode->i_mode)) {
-                        /* XXX directory EA is fix for now, optimize to save
-                         * RPC transfer */
-                        GOTO(out, rc = sizeof(struct lov_user_md));
-                }
-
                lsm = ccc_inode_lsm_get(inode);
                if (lsm == NULL) {
                        if (S_ISDIR(inode->i_mode)) {