X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Fllite_rmtacl.c;h=2ff821e1f04b146f57ea09beb9b46183e7d5939d;hb=6c3606b79a4c25946255a680f79ff2d58df66bbc;hp=dd52cd49ffd94fc36f44c20c6fba51fe44e4dd5f;hpb=70e80ade90af09300396706b8910e196a7928520;p=fs%2Flustre-release.git diff --git a/lustre/llite/llite_rmtacl.c b/lustre/llite/llite_rmtacl.c index dd52cd4..2ff821e 100644 --- a/lustre/llite/llite_rmtacl.c +++ b/lustre/llite/llite_rmtacl.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. @@ -16,8 +14,8 @@ * in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see [sun.com URL with a - * copy of GPLv2]. + * version 2 along with this program; If not, see + * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or @@ -26,7 +24,7 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* @@ -90,8 +88,8 @@ static struct rmtacl_ctl_entry *rce_alloc(pid_t key, int ops) static void rce_free(struct rmtacl_ctl_entry *rce) { - if (!list_empty(&rce->rce_list)) - list_del(&rce->rce_list); + if (!cfs_list_empty(&rce->rce_list)) + cfs_list_del(&rce->rce_list); OBD_FREE_PTR(rce); } @@ -100,9 +98,9 @@ static struct rmtacl_ctl_entry *__rct_search(struct rmtacl_ctl_table *rct, pid_t key) { struct rmtacl_ctl_entry *rce; - struct list_head *head = &rct->rct_entries[rce_hashfunc(key)]; + cfs_list_t *head = &rct->rct_entries[rce_hashfunc(key)]; - list_for_each_entry(rce, head, rce_list) + cfs_list_for_each_entry(rce, head, rce_list) if (rce->rce_key == key) return rce; @@ -113,9 +111,9 @@ struct rmtacl_ctl_entry *rct_search(struct rmtacl_ctl_table *rct, pid_t key) { struct rmtacl_ctl_entry *rce; - spin_lock(&rct->rct_lock); + cfs_spin_lock(&rct->rct_lock); rce = __rct_search(rct, key); - spin_unlock(&rct->rct_lock); + cfs_spin_unlock(&rct->rct_lock); return rce; } @@ -127,15 +125,15 @@ int rct_add(struct rmtacl_ctl_table *rct, pid_t key, int ops) if (rce == NULL) return -ENOMEM; - spin_lock(&rct->rct_lock); + cfs_spin_lock(&rct->rct_lock); e = __rct_search(rct, key); if (unlikely(e != NULL)) { CWARN("Unexpected stale rmtacl_entry found: " "[key: %d] [ops: %d]\n", (int)key, ops); rce_free(e); } - list_add_tail(&rce->rce_list, &rct->rct_entries[rce_hashfunc(key)]); - spin_unlock(&rct->rct_lock); + cfs_list_add_tail(&rce->rce_list, &rct->rct_entries[rce_hashfunc(key)]); + cfs_spin_unlock(&rct->rct_lock); return 0; } @@ -144,11 +142,11 @@ int rct_del(struct rmtacl_ctl_table *rct, pid_t key) { struct rmtacl_ctl_entry *rce; - spin_lock(&rct->rct_lock); + cfs_spin_lock(&rct->rct_lock); rce = __rct_search(rct, key); if (rce) rce_free(rce); - spin_unlock(&rct->rct_lock); + cfs_spin_unlock(&rct->rct_lock); return rce ? 0 : -ENOENT; } @@ -157,7 +155,7 @@ void rct_init(struct rmtacl_ctl_table *rct) { int i; - spin_lock_init(&rct->rct_lock); + cfs_spin_lock_init(&rct->rct_lock); for (i = 0; i < RCE_HASHES; i++) CFS_INIT_LIST_HEAD(&rct->rct_entries[i]); } @@ -167,14 +165,14 @@ void rct_fini(struct rmtacl_ctl_table *rct) struct rmtacl_ctl_entry *rce; int i; - spin_lock(&rct->rct_lock); + cfs_spin_lock(&rct->rct_lock); for (i = 0; i < RCE_HASHES; i++) - while (!list_empty(&rct->rct_entries[i])) { - rce = list_entry(rct->rct_entries[i].next, - struct rmtacl_ctl_entry, rce_list); + while (!cfs_list_empty(&rct->rct_entries[i])) { + rce = cfs_list_entry(rct->rct_entries[i].next, + struct rmtacl_ctl_entry, rce_list); rce_free(rce); } - spin_unlock(&rct->rct_lock); + cfs_spin_unlock(&rct->rct_lock); } @@ -198,8 +196,8 @@ static struct eacl_entry *ee_alloc(pid_t key, struct lu_fid *fid, int type, void ee_free(struct eacl_entry *ee) { - if (!list_empty(&ee->ee_list)) - list_del(&ee->ee_list); + if (!cfs_list_empty(&ee->ee_list)) + cfs_list_del(&ee->ee_list); if (ee->ee_acl) lustre_ext_acl_xattr_free(ee->ee_acl); @@ -211,14 +209,14 @@ static struct eacl_entry *__et_search_del(struct eacl_table *et, pid_t key, struct lu_fid *fid, int type) { struct eacl_entry *ee; - struct list_head *head = &et->et_entries[ee_hashfunc(key)]; + cfs_list_t *head = &et->et_entries[ee_hashfunc(key)]; LASSERT(fid != NULL); - list_for_each_entry(ee, head, ee_list) + cfs_list_for_each_entry(ee, head, ee_list) if (ee->ee_key == key) { if (lu_fid_eq(&ee->ee_fid, fid) && ee->ee_type == type) { - list_del_init(&ee->ee_list); + cfs_list_del_init(&ee->ee_list); return ee; } } @@ -231,23 +229,23 @@ struct eacl_entry *et_search_del(struct eacl_table *et, pid_t key, { struct eacl_entry *ee; - spin_lock(&et->et_lock); + cfs_spin_lock(&et->et_lock); ee = __et_search_del(et, key, fid, type); - spin_unlock(&et->et_lock); + cfs_spin_unlock(&et->et_lock); return ee; } void et_search_free(struct eacl_table *et, pid_t key) { struct eacl_entry *ee, *next; - struct list_head *head = &et->et_entries[ee_hashfunc(key)]; + cfs_list_t *head = &et->et_entries[ee_hashfunc(key)]; - spin_lock(&et->et_lock); - list_for_each_entry_safe(ee, next, head, ee_list) + cfs_spin_lock(&et->et_lock); + cfs_list_for_each_entry_safe(ee, next, head, ee_list) if (ee->ee_key == key) ee_free(ee); - spin_unlock(&et->et_lock); + cfs_spin_unlock(&et->et_lock); } int ee_add(struct eacl_table *et, pid_t key, struct lu_fid *fid, int type, @@ -259,7 +257,7 @@ int ee_add(struct eacl_table *et, pid_t key, struct lu_fid *fid, int type, if (ee == NULL) return -ENOMEM; - spin_lock(&et->et_lock); + cfs_spin_lock(&et->et_lock); e = __et_search_del(et, key, fid, type); if (unlikely(e != NULL)) { CWARN("Unexpected stale eacl_entry found: " @@ -267,8 +265,8 @@ int ee_add(struct eacl_table *et, pid_t key, struct lu_fid *fid, int type, (int)key, PFID(fid), type); ee_free(e); } - list_add_tail(&ee->ee_list, &et->et_entries[ee_hashfunc(key)]); - spin_unlock(&et->et_lock); + cfs_list_add_tail(&ee->ee_list, &et->et_entries[ee_hashfunc(key)]); + cfs_spin_unlock(&et->et_lock); return 0; } @@ -277,7 +275,7 @@ void et_init(struct eacl_table *et) { int i; - spin_lock_init(&et->et_lock); + cfs_spin_lock_init(&et->et_lock); for (i = 0; i < EE_HASHES; i++) CFS_INIT_LIST_HEAD(&et->et_entries[i]); } @@ -287,14 +285,14 @@ void et_fini(struct eacl_table *et) struct eacl_entry *ee; int i; - spin_lock(&et->et_lock); + cfs_spin_lock(&et->et_lock); for (i = 0; i < EE_HASHES; i++) - while (!list_empty(&et->et_entries[i])) { - ee = list_entry(et->et_entries[i].next, - struct eacl_entry, ee_list); + while (!cfs_list_empty(&et->et_entries[i])) { + ee = cfs_list_entry(et->et_entries[i].next, + struct eacl_entry, ee_list); ee_free(ee); } - spin_unlock(&et->et_lock); + cfs_spin_unlock(&et->et_lock); } #endif