* 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.
+ *
+ * Copyright (c) 2012, Whamcloud, Inc.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include <linux/module.h>
#include <linux/types.h>
-#include <linux/random.h>
#include <linux/version.h>
#include <lustre_lite.h>
if (!lli->lli_remote_perms)
RETURN(-ENOENT);
- head = lli->lli_remote_perms + remote_perm_hashfunc(current->uid);
+ head = lli->lli_remote_perms + remote_perm_hashfunc(cfs_curproc_uid());
cfs_spin_lock(&lli->lli_lock);
cfs_hlist_for_each_entry(lrp, node, head, lrp_list) {
- if (lrp->lrp_uid != current->uid)
+ if (lrp->lrp_uid != cfs_curproc_uid())
continue;
- if (lrp->lrp_gid != current->gid)
+ if (lrp->lrp_gid != cfs_curproc_gid())
continue;
- if (lrp->lrp_fsuid != current->fsuid)
+ if (lrp->lrp_fsuid != cfs_curproc_fsuid())
continue;
- if (lrp->lrp_fsgid != current->fsgid)
+ if (lrp->lrp_fsgid != cfs_curproc_fsgid())
continue;
found = 1;
break;
lrp->lrp_fsgid = perm->rp_fsgid;
cfs_hlist_add_head(&lrp->lrp_list, head);
}
- lli->lli_rmtperm_utime = jiffies;
+ lli->lli_rmtperm_time = cfs_time_current();
cfs_spin_unlock(&lli->lli_lock);
CDEBUG(D_SEC, "new remote perm@%p: %u/%u/%u/%u - %#x\n",
struct ptlrpc_request *req = NULL;
struct mdt_remote_perm *perm;
struct obd_capa *oc;
- unsigned long utime;
+ cfs_time_t save;
int i = 0, rc;
ENTRY;
do {
- utime = lli->lli_rmtperm_utime;
+ save = lli->lli_rmtperm_time;
rc = do_check_remote_perm(lli, mask);
if (!rc || (rc != -ENOENT && i))
break;
cfs_down(&lli->lli_rmtperm_sem);
/* check again */
- if (utime != lli->lli_rmtperm_utime) {
+ if (save != lli->lli_rmtperm_time) {
rc = do_check_remote_perm(lli, mask);
if (!rc || (rc != -ENOENT && i)) {
cfs_up(&lli->lli_rmtperm_sem);