-/* -*- 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) 2012, Whamcloud, Inc.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
static inline struct ll_remote_perm *alloc_ll_remote_perm(void)
{
- struct ll_remote_perm *lrp;
+ struct ll_remote_perm *lrp;
- OBD_SLAB_ALLOC_PTR_GFP(lrp, ll_remote_perm_cachep, GFP_KERNEL);
- if (lrp)
- CFS_INIT_HLIST_NODE(&lrp->lrp_list);
- return lrp;
+ OBD_SLAB_ALLOC_PTR_GFP(lrp, ll_remote_perm_cachep, CFS_ALLOC_KERNEL);
+ if (lrp)
+ CFS_INIT_HLIST_NODE(&lrp->lrp_list);
+ return lrp;
}
static inline void free_ll_remote_perm(struct ll_remote_perm *lrp)
cfs_hlist_head_t *hash;
int i;
- OBD_SLAB_ALLOC(hash, ll_rmtperm_hash_cachep, GFP_KERNEL,
- REMOTE_PERM_HASHSIZE * sizeof(*hash));
-
+ OBD_SLAB_ALLOC_GFP(hash, ll_rmtperm_hash_cachep,
+ REMOTE_PERM_HASHSIZE * sizeof(*hash),
+ CFS_ALLOC_STD);
if (!hash)
return NULL;
cfs_might_sleep();
- cfs_down(&lli->lli_rmtperm_sem);
+ cfs_mutex_lock(&lli->lli_rmtperm_mutex);
/* check again */
if (save != lli->lli_rmtperm_time) {
rc = do_check_remote_perm(lli, mask);
if (!rc || (rc != -ENOENT && i)) {
- cfs_up(&lli->lli_rmtperm_sem);
+ cfs_mutex_unlock(&lli->lli_rmtperm_mutex);
break;
}
}
ll_i2suppgid(inode), &req);
capa_put(oc);
if (rc) {
- cfs_up(&lli->lli_rmtperm_sem);
+ cfs_mutex_unlock(&lli->lli_rmtperm_mutex);
break;
}
perm = req_capsule_server_swab_get(&req->rq_pill, &RMF_ACL,
lustre_swab_mdt_remote_perm);
if (unlikely(perm == NULL)) {
- cfs_up(&lli->lli_rmtperm_sem);
+ cfs_mutex_unlock(&lli->lli_rmtperm_mutex);
rc = -EPROTO;
break;
}
rc = ll_update_remote_perm(inode, perm);
- cfs_up(&lli->lli_rmtperm_sem);
+ cfs_mutex_unlock(&lli->lli_rmtperm_mutex);
if (rc == -ENOMEM)
break;