⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fsinterface.ms

📁 早期freebsd实现
💻 MS
📖 第 1 页 / 共 4 页
字号:
.\" Copyright (c) 1986 The Regents of the University of California..\" All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\"    notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\"    notice, this list of conditions and the following disclaimer in the.\"    documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\"    must display the following acknowledgement:.\"	This product includes software developed by the University of.\"	California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\"    may be used to endorse or promote products derived from this software.\"    without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\"	@(#)fsinterface.ms	1.4 (Berkeley) 4/16/91.\".if \nv .rm CM.de UX.ie \\n(UX \s-1UNIX\s0\\$1.el \{\\s-1UNIX\s0\\$1\(dg.FS\(dg \s-1UNIX\s0 is a registered trademark of AT&T..FE.nr UX 1.\}...TLToward a Compatible Filesystem Interface.AUMichael J. KarelsMarshall Kirk McKusick.AIComputer Systems Research GroupComputer Science DivisionDepartment of Electrical Engineering and Computer ScienceUniversity of California, BerkeleyBerkeley, California  94720.AB.LPAs network or remote filesystems have been implemented for.UX ,several stylized interfaces between the filesystem implementationand the rest of the kernel have been developed..FSThis is an update of a paper originally presentedat the September 1986 conference of the European.UXUsers' Group.Last modified April 16, 1991..FENotable among these are Sun Microsystems' Virtual Filesystem interface (VFS)using vnodes, Digital Equipment's Generic File System (GFS) architecture,and AT&T's File System Switch (FSS).Each design attempts to isolate filesystem-dependent detailsbelow a generic interface and to provide a framework within whichnew filesystems may be incorporated.However, each of these interfaces is different fromand incompatible with the others.Each of them addresses somewhat different design goals.Each was based on a different starting version of.UX ,targetted a different set of filesystems with varying characteristics,and uses a different set of primitive operations provided by the filesystem.The current study compares the various filesystem interfaces.Criteria for comparison include generality, completeness, robustness,efficiency and esthetics.Several of the underlying design issues are examined in detail.As a result of this comparison, a proposal for a new filesystem interfaceis advanced that includes the best features of the existing implementations.The proposal adopts the calling convention for name lookup introducedin 4.3BSD, but is otherwise closely related to Sun's VFS.A prototype implementation is now being developed at Berkeley.This proposal and the rationale underlying its developmenthave been presented to major software vendorsas an early step toward convergence on a compatible filesystem interface..AE.SHIntroduction.PPAs network communications and workstation environmentsbecame common elements in.UXsystems, several vendors of.UXsystems have designed and built network file systemsthat allow client process on one.UXmachine to access files on a server machine.Examples include Sun's Network File System, NFS [Sandberg85],AT&T's recently-announced Remote File Sharing, RFS [Rifkin86],the LOCUS distributed filesystem [Walker85],and Masscomp's extended filesystem [Cole85].Other remote filesystems have been implemented in research or university groupsfor internal use, notably the network filesystem in the Eighth Edition.UXsystem [Weinberger84] and two different filesystems used at Carnegie-MellonUniversity [Satyanarayanan85].Numerous other remote file access methods have been devised for usewithin individual.UXprocesses,many of them by modifications to the C I/O librarysimilar to those in the Newcastle Connection [Brownbridge82]..PPMultiple network filesystems may frequentlybe found in use within a single organization.These circumstances make it highly desirable to be able to transport filesystemimplementations from one system to another.Such portability is considerably enhanced by the use of a stylized interfacewith carefully-defined entry points to separate the filesystem from the restof the operating system.This interface should be similar to the interface between device driversand the kernel.Although varying somewhat among the common versions of.UX ,the device driver interfaces are sufficiently similar that device driversmay be moved from one system to another without major problems.A clean, well-defined interface to the filesystem also allows a singlesystem to support multiple local filesystem types..PPFor reasons such as these, several filesystem interfaces have been usedwhen integrating new filesystems into the system.The best-known of these are Sun Microsystems' Virtual File System interface,VFS [Kleiman86], and AT&T's File System Switch, FSS.Another interface, known as the Generic File System, GFS,has been implemented for the ULTRIX\(dd.FS\(dd ULTRIX is a trademark of Digital Equipment Corp..FEsystem by Digital [Rodriguez86].There are numerous differences among these designs.The differences may be understood from the varying philosophiesand design goals of the groups involved, from the systems under whichthe implementations were done, and from the filesystems originally targettedby the designs.These differences are summarized in the following sectionswithin the limitations of the published specifications..SHDesign goals.PPThere are several design goals which, in varying degrees,have driven the various designs.Each attempts to divide the filesystem into a filesystem-type-independentlayer and individual filesystem implementations.The division between these layers occurs at somewhat different placesin these systems, reflecting different views of the diversity and typesof the filesystems that may be accommodated.Compatibility with existing local filesystems has varying importance;at the user-process level, each attempts to be completely transparentexcept for a few filesystem-related system management programs.The AT&T interface also makes a major effort to retain familiar internalsystem interfaces, and even to retain object-file-level binary compatibilitywith operating system modules such as device drivers.Both Sun and DEC were willing to change internal data structures and interfacesso that other operating system modules might require recompilationor source-code modification..PPAT&T's interface both allows and requires filesystems to support the fulland exact semantics of their previous filesystem,including interruptions of system calls on slow operations.System calls that deal with remote files are encapsulatedwith their environment and sent to a server where execution continues.The system call may be aborted by either client or server, returningcontrol to the client.Most system calls that descend into the file-system dependent layerof a filesystem other than the standard local filesystem do not returnto the higher-level kernel calling routines.Instead, the filesystem-dependent code completes the requestedoperation and then executes a non-local goto (\fIlongjmp\fP) to exit thesystem call.These efforts to avoid modification of main-line kernel codeindicate a far greater emphasis on internal compatibility than on modularity,clean design, or efficiency..PPIn contrast, the Sun VFS interface makes major modifications to the internalinterfaces in the kernel, with a very clear separationof filesystem-independent and -dependent data structures and operations.The semantics of the filesystem are largely retained for local operations,although this is achieved at some expense where it does not fit the internalstructuring well.The filesystem implementations are not required to support the samesemantics as local.UXfilesystems.Several historical features of.UXfilesystem behavior are difficult to achieve using the VFS interface,including the atomicity of file and link creation and the use of open fileswhose names have been removed..PPA major design objective of Sun's network filesystem,statelessness,permeates the VFS interface.No locking may be done in the filesystem-independent layer,and locking in the filesystem-dependent layer may occur only duringa single call into that layer..PPA final design goal of most implementors is performance.For remote filesystems,this goal tends to be in conflict with the goals of complete semanticconsistency, compatibility and modularity.Sun has chosen performance over modularity in some areas,but has emphasized clean separation of the layers within the filesystemat the expense of performance.Although the performance of RFS is yet to be seen,AT&T seems to have considered compatibility far more important than modularityor performance..SHDifferences among filesystem interfaces.PPThe existing filesystem interfaces may be characterizedin several ways.Each system is centered around a few data structures or objects,along with a set of primitives for performing operations upon these objects.In the original.UXfilesystem [Ritchie74],the basic object used by the filesystem is the inode, or index node.The inode contains all of the information about a file except its name:its type, identification, ownership, permissions, timestamps and location.Inodes are identified by the filesystem device number and the index withinthe filesystem.The major entry points to the filesystem are \fInamei\fP,which translates a filesystem pathname into the underlying inode,and \fIiget\fP, which locates an inode by number and installs it in the in-coreinode table.\fINamei\fP performs name translation by iterative lookupof each component name in its directory to find its inumber,then using \fIiget\fP to return the actual inode.If the last component has been reached, this inode is returned;otherwise, the inode describes the next directory to be searched.The inode returned may be used in various ways by the caller;it may be examined, the file may be read or written,types and access may be checked, and fields may be modified.Modified inodes are automatically written back the the filesystemon disk when the last reference is released with \fIiput\fP.Although the details are considerably different,the same general scheme is used in the faster filesystem in 4.2BSD.UX[Mckusick85]..PPBoth the AT&T interface and, to a lesser extent, the DEC interfaceattempt to preserve the inode-oriented interface.Each modify the inode to allow different varieties of the structurefor different filesystem types by separating the filesystem-dependentparts of the inode into a separate structure or one arm of a union.Both interfaces allow operationsequivalent to the \fInamei\fP and \fIiget\fP operationsof the old filesystem to be performed in the filesystem-independentlayer, with entry points to the individual filesystem implementations to supportthe type-specific parts of these operations.  Implicit in this interfaceis that files may be conveniently be named by and located using a singleindex within a filesystem.The GFS provides specific entry points to the filesystemsto change most file properties rather than allowing arbitrary changesto be made to the generic part of the inode..PPIn contrast, the Sun VFS interface replaces the inode as the primary objectwith the vnode.The vnode contains no filesystem-dependent fields except the pointerto the set of operations implemented by the filesystem.Properties of a vnode that might be transient, such as the ownership,permissions, size and timestamps, are maintained by the lower layer.These properties may be presented in a generic format upon request;callers are expected not to hold this information for any length of time,as they may not be up-to-date later on.The vnode operations do not include a corollary for \fIiget\fP;the only external interface for obtaining vnodes for specific filesis the name lookup operation.(Separate procedures are provided outside of this interfacethat obtain a ``file handle'' for a vnode which may be givento a client by a server, such that the vnode may be retrievedupon later presentation of the file handle.).SHName translation issues.PPEach of the systems described include a mechanism for performing

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -