X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flvfs%2Fupcall_cache.c;h=084e6efde81af30ab1bbc7452ca3638007c72aa6;hb=20a6f2df5afc45a764c6ffc842e33046531f9e5e;hp=c2df572867bb33c91a966f89c000f192a5f1323f;hpb=26eb27ce838c6d9281c1a8a73429e6ee836da997;p=fs%2Flustre-release.git diff --git a/lustre/lvfs/upcall_cache.c b/lustre/lvfs/upcall_cache.c index c2df5728..084e6ef 100644 --- a/lustre/lvfs/upcall_cache.c +++ b/lustre/lvfs/upcall_cache.c @@ -1,24 +1,41 @@ /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: * - * Supplementary groups cache. + * GPL HEADER START * - * Copyright (c) 2004 Cluster File Systems, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * This file is part of Lustre, http://www.lustre.org. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. * - * Lustre is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). * - * Lustre is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf * - * You should have received a copy of the GNU General Public License - * along with Lustre; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + * GPL HEADER END + */ +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Use is subject to license terms. + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Sun Microsystems, Inc. + * + * lustre/lvfs/upcall_cache.c + * + * Supplementary groups cache. */ #define DEBUG_SUBSYSTEM S_SEC @@ -43,9 +60,6 @@ #include #include #include -#ifdef HAVE_SEGMENT_H -# include -#endif #include #include @@ -210,6 +224,10 @@ find_again: if (rc < 0) { UC_CACHE_CLEAR_ACQUIRING(entry); UC_CACHE_SET_INVALID(entry); + if (unlikely(rc == -EREMCHG)) { + put_entry(cache, entry); + GOTO(out, entry = ERR_PTR(rc)); + } } /* fall through */ } @@ -438,6 +456,7 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall, RETURN(ERR_PTR(-ENOMEM)); spin_lock_init(&cache->uc_lock); + rwlock_init(&cache->uc_upcall_rwlock); for (i = 0; i < UC_CACHE_HASH_SIZE; i++) INIT_LIST_HEAD(&cache->uc_hashtable[i]); strncpy(cache->uc_name, name, sizeof(cache->uc_name) - 1);