Whamcloud - gitweb
ORNL-2 Enable OBD_CONNECT_ATTRFID supporting on lustre-2.x
[fs/lustre-release.git] / lustre / mdt / mdt_xattr.c
index c268b14..0e5cc6d 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -215,6 +215,7 @@ int mdt_getxattr(struct mdt_thread_info *info)
         EXIT;
 out:
         if (rc >= 0) {
+                mdt_counter_incr(req->rq_export, LPROC_MDT_GETXATTR);
                 repbody->eadatasize = rc;
                 rc = 0;
         }
@@ -238,7 +239,7 @@ static int mdt_rmtlsetfacl(struct mdt_thread_info *info,
         rc = lustre_ext_acl_xattr_id2server(uc, med->med_idmap, header);
         if (rc)
                 RETURN(rc);
+
         rc = mo_xattr_get(info->mti_env, next, &LU_BUF_NULL, xattr_name);
         if (rc == -ENODATA)
                 rc = 0;
@@ -352,8 +353,8 @@ int mdt_reint_setxattr(struct mdt_thread_info *info,
         if (IS_ERR(obj))
                 GOTO(out, rc =  PTR_ERR(obj));
 
-        info->mti_mos[0] = obj;
-        rc = mdt_version_get_check(info, 0);
+        info->mti_mos = obj;
+        rc = mdt_version_get_check_save(info, obj, 0);
         if (rc)
                 GOTO(out_unlock, rc);
 
@@ -422,6 +423,9 @@ int mdt_reint_setxattr(struct mdt_thread_info *info,
                 CDEBUG(D_INFO, "valid bits: "LPX64"\n", valid);
                 rc = -EINVAL;
         }
+        if (rc == 0)
+                mdt_counter_incr(req->rq_export, LPROC_MDT_SETXATTR);
+
         EXIT;
 out_unlock:
         mdt_object_unlock_put(info, obj, lh, rc);