Whamcloud - gitweb
LU-1403 ucred: ucred cleanup
[fs/lustre-release.git] / lustre / mdt / mdt_identity.c
index f5c8403..e8612d1 100644 (file)
@@ -277,7 +277,7 @@ __u32 mdt_identity_get_perm(struct md_identity *identity,
 int mdt_pack_remote_perm(struct mdt_thread_info *info, struct mdt_object *o,
                          void *buf)
 {
-        struct md_ucred         *uc = mdt_ucred(info);
+       struct lu_ucred         *uc = mdt_ucred_check(info);
         struct md_object        *next = mdt_object_child(o);
         struct mdt_remote_perm  *perm = buf;
 
@@ -289,13 +289,13 @@ int mdt_pack_remote_perm(struct mdt_thread_info *info, struct mdt_object *o,
         if (!exp_connect_rmtclient(info->mti_exp))
                 RETURN(-EBADE);
 
-        if ((uc->mu_valid != UCRED_OLD) && (uc->mu_valid != UCRED_NEW))
-                RETURN(-EINVAL);
+       if (uc == NULL)
+               RETURN(-EINVAL);
 
-        perm->rp_uid = uc->mu_o_uid;
-        perm->rp_gid = uc->mu_o_gid;
-        perm->rp_fsuid = uc->mu_o_fsuid;
-        perm->rp_fsgid = uc->mu_o_fsgid;
+       perm->rp_uid = uc->uc_o_uid;
+       perm->rp_gid = uc->uc_o_gid;
+       perm->rp_fsuid = uc->uc_o_fsuid;
+       perm->rp_fsgid = uc->uc_o_fsgid;
 
         perm->rp_access_perm = 0;
         if (mo_permission(info->mti_env, NULL, next, NULL, MAY_READ) == 0)