From owner-cvs-src@FreeBSD.ORG Wed Feb 13 15:45:12 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F79616A420; Wed, 13 Feb 2008 15:45:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7974113C468; Wed, 13 Feb 2008 15:45:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1DFjC2w092391; Wed, 13 Feb 2008 15:45:12 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1DFjCq0092390; Wed, 13 Feb 2008 15:45:12 GMT (envelope-from rwatson) Message-Id: <200802131545.m1DFjCq0092390@repoman.freebsd.org> From: Robert Watson Date: Wed, 13 Feb 2008 15:45:12 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/fs/coda cnode.h coda_subr.c coda_vnops.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2008 15:45:12 -0000 rwatson 2008-02-13 15:45:12 UTC FreeBSD src repository Modified files: sys/fs/coda cnode.h coda_subr.c coda_vnops.c Log: Implement a rudimentary access cache for the Coda kernel module, modeled on the access cache found in NFS, smbfs, and the Linux coda module. This is a positive access cache of a single entry per file, tracking recently granted rights, but unlike NFS and smbfs, supporting explicit invalidation by the distributed file system. For each cnode, maintain a C_ACCCACHE flag indicating the validity of the cache, and a cached uid and mode tracking recently granted positive access control decisions. Prefer the cache to venus_access() in VOP_ACCESS() if it is valid, and when we must fall back to venus_access(), update the cache. Allow Venus to clear the access cache, either the whole cache on CODA_FLUSH, or just entries for a specific uid on CODA_PURGEUSER. Unlike the Coda module on Linux, we don't flush all entries on a user purge using a generation number, we instead walk present cnodes and clear only entries for the specific user, meaning it is somewhat more expensive but won't hit all users. Since the Coda module is agressive about not keeping around unopened cnodes, the utility of the cache is somewhat limited for files, but works will for directories. We should make Coda less agressive about GCing cnodes in VOP_INACTIVE() in order to improve the effectiveness of in-kernel caching of attributes and access rights. MFC after: 1 month Revision Changes Path 1.27 +4 -0 src/sys/fs/coda/cnode.h 1.37 +63 -8 src/sys/fs/coda/coda_subr.c 1.95 +51 -21 src/sys/fs/coda/coda_vnops.c