HP UX Common Internet File System (CIFS) Client/Server Software manual Unix, Nfs

Page 10

An important detail is that Oplocks are invoked by the file system, not an application API. Therefore, an application can close an oplocked file, but the file system does not relinquish the Oplock. When the Oplock break is issued, the file system then simply closes the file in preparation for the subsequent open by the second process.

4.2UNIX

UNIX utilizes 2 kinds of file locking:

Advisory locking

Mandatory locking

Both lock types are implemented with the same function calls: fcntl and lockf. fcntl is the POSIX interface (introduced at SVR4), and lockf is provided for backward compatibility. The calling semantics are slightly different, but the functionality is basically the same.

Both functions specify read and/or write locking, and allow for byte-range locks or locking of the entire file. A read lock allows concurrent access for reading, but not writing. A write lock is exclusive.

ADVISORY LOCKING assumes that all processes attempting to access a file participate in the locking protocol by calling the locking functions correctly and honoring the lock status of the file. There is no requirement that a process must adhere to the advisory locking protocol. A process that does not participate in the protocol can obliviously write or read to a file that is locked with locking functions. Therefore there is a significant assumption of risk of data corruption with advisory locking.

MANDATORY LOCKING is implemented with function calls identical to advisory locking. Mandatory locking is then enabled per-file by manipulating the file’s permissions with chmod. To enable a file for mandatory locking, the group-id bit must be set, and the execute bit must be cleared (implying that executable files cannot be locked). Once set, any calls to open, read, or write to a previously locked file are failed by the kernel, regardless of whether the process participates in the file locking protocol. Most UNIX locking scenarios refer to advisory locking protocol. The UNIX mandatory option seems to be rarely utilized, so further references to mandatory locking refer to Windows only.

Note that UNIX does not employ the concept of Mandatory Share Mode (Open Mode) locking like Windows does. UNIX locking consists of byte range locking and is strictly programmatic on a previously opened file. Also, UNIX is incapable of sending an oplock break to a client, and therefore cannot interoperate with Windows clients using Opportunistic Locking.

4.3NFS

File locking for NFS is provided by two cooperating protocols:

Network Lock Manager

Network Status Monitor

10

Image 10
Contents Eric Roseme Snsl Advanced Technology Center Version 1.03 SeptemberE0300 Legal Notices Copyright NoticesContents Introduction CIFS/9000 Product Overview File Locking Overview ACLPage File Locking Implementations Windows CifsPage Unix NFSPC NFS Mandatory Share Mode Locking Open Mode CIFS/9000 File Locking ImplementationPage Page Page Windows only Client Access Local File System CIFS/9000 File Locking Interoperability ExamplesPage Windows only Client Access NFS Mounted File System Page Windows and Unix Client Access Local File System Page Windows and Unix Client Access NFS Mounted File System Page UNIX/NFS PC-NFS Page Unix PC-NFS Page Clients Page Byte Range Locking Mandatory Share Mode Open Mode CIFS/9000CIFS/9000 Locking Summary OplocksCIFS/9000 Competition Locking Summary Mandatory Share Mode Open Mode Network AppliancePage Mandatory Share Mode Open Mode EMC Celerra EMC CelerraPage Auspex NeTservices Mandatory Share Mode Open Mode Auspex NeTservicesPage Mandatory Share Mode Open Mode Veritas FSE Veritas File Server EditionLocking Summary Table EMCCIFS/9000 File Locking Interoperability Summary Page Smb.conf for Windows-Only Access Appendix a smb.conf ExamplesSmb.conf for Mixed-Mode Access Appendix B Sales Tool Locking Technology Examples Determine Locking RequirementByte Range Locking CIFS/NFS Open Mode Locking CIFS/NFS Open Mode Locking Competitor’s Claims for NFS Non-Locking Protection
Related manuals
Manual 21 pages 36.77 Kb