X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_identity.c;h=e7e76b0d4483de8b51bca795d574a9555a460cd0;hb=2de8f60b9ca1c8e281235857d902d1f2a599c4b5;hp=59a553551304d9ab7ee148d9b655baff2478778a;hpb=2d86bd1e70106afaff5200ba819303b16c2e587d;p=fs%2Flustre-release.git diff --git a/lustre/mdt/mdt_identity.c b/lustre/mdt/mdt_identity.c index 59a5535..e7e76b0 100644 --- a/lustre/mdt/mdt_identity.c +++ b/lustre/mdt/mdt_identity.c @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,6 +26,8 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2011, 2012, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -39,14 +39,8 @@ * Author: Fan Yong */ -#ifndef EXPORT_SYMTAB -#define EXPORT_SYMTAB -#endif #define DEBUG_SUBSYSTEM S_MDS -#ifndef AUTOCONF_INCLUDED -#include -#endif #include #include #include @@ -56,7 +50,6 @@ #include #include #include -#include #include #include #include @@ -121,7 +114,7 @@ static int mdt_identity_do_upcall(struct upcall_cache *cache, /* There is race condition: * "uc_upcall" was changed just after "is_identity_get_disabled" check. */ - cfs_read_lock(&cache->uc_upcall_rwlock); + read_lock(&cache->uc_upcall_rwlock); CDEBUG(D_INFO, "The upcall is: '%s'\n", cache->uc_upcall); if (unlikely(!strcmp(cache->uc_upcall, "NONE"))) { @@ -149,7 +142,7 @@ static int mdt_identity_do_upcall(struct upcall_cache *cache, } EXIT; out: - cfs_read_unlock(&cache->uc_upcall_rwlock); + read_unlock(&cache->uc_upcall_rwlock); return rc; } @@ -284,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; @@ -296,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)