-/* -*- 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.
/*
* 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/
* Author: Fan Yong <fanyong@clusterfs.com>
*/
-#ifndef EXPORT_SYMTAB
-#define EXPORT_SYMTAB
-#endif
#define DEBUG_SUBSYSTEM S_MDS
-#ifndef AUTOCONF_INCLUDED
-#include <linux/config.h>
-#endif
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/version.h>
#include <linux/unistd.h>
-#include <asm/system.h>
#include <asm/uaccess.h>
#include <linux/fs.h>
#include <linux/stat.h>
/* 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"))) {
}
EXIT;
out:
- cfs_read_unlock(&cache->uc_upcall_rwlock);
+ read_unlock(&cache->uc_upcall_rwlock);
return rc;
}
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;
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)