Whamcloud - gitweb
LU-433 ldiskfs: remove jbd2-jcberr patch from kernel
[fs/lustre-release.git] / lustre / llite / remote_perm.c
index 2b5efe2..2d0c82f 100644 (file)
  * 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/
@@ -45,7 +47,6 @@
 
 #include <linux/module.h>
 #include <linux/types.h>
-#include <linux/random.h>
 #include <linux/version.h>
 
 #include <lustre_lite.h>
@@ -237,7 +238,7 @@ again:
                 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",
@@ -254,12 +255,12 @@ int lustre_check_remote_perm(struct inode *inode, int mask)
         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;
@@ -268,7 +269,7 @@ int lustre_check_remote_perm(struct inode *inode, int mask)
 
                 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);