SMB/CIFS Opportunistic Locks
来源:互联网 发布:php文件断点续传 编辑:程序博客网 时间:2024/05/18 02:15
An opportunistic lock (also called an oplock) is a lock placed by a client on a file residing on a server. In most cases, a client requests an opportunistic lock so it can cache data locally, thus reducing network traffic and improving apparent response time. Opportunistic locks are used by network redirectors on clients with remote servers, as well as by client applications on local servers.
Opportunistic locks coordinate data caching and coherency between clients and servers and among multiple clients. Data that is coherent is data that is the same across the network. In other words, if data is coherent, data on the server and all the clients is synchronized.
Opportunistic locks are not commands by the client to the server. They are requests from the client to the server. From the point of view of the client, they are opportunistic. In other words, the server grants such locks whenever other factors make the locks possible.
When a local application requests access to a remote file, the implementation of opportunistic locks is transparent to the application. The network redirector and the server involved open and close the opportunistic locks automatically. However, opportunistic locks can also be used when a local application requests access to a local file, and access by other applications and processes must be delegated to prevent corruption of the file. In this case, the local application directly requests an opportunistic lock from the local file system and caches the file locally. When used in this way, the opportunistic lock is effectively a semaphore managed by the local server, and is mainly used for the purposes of data coherency in the file and file access notification.
Before using opportunistic locks in your application, you should be familiar with the file access and sharing modes described in Creating and Opening Files.
The maximum number of concurrent opportunistic locks that you can create is limited only by the amount of available memory. For example, the maximum number created in test conditions with Windows 2000 and the NTFS file system is 359,000 locks.
Local applications should not attempt to request opportunistic locks from remote servers. An error will be returned by DeviceIoControl if an attempt is made to do this.
Opportunistic locks are of very limited use for applications. The only practical use is to test a network redirector or a server opportunistic lock handler. Typically, file systems implement support for opportunistic locks. Applications generally leave opportunistic lock management to the file system drivers. Anyone implementing a file system should use the Installable File System (IFS) Kit. Anyone developing a device driver other than an installable file system should use the Windows Driver Kit (WDK).
Opportunistic locks and the associated operations are a superset of the opportunistic lock portion of the Common Internet File System (CIFS) protocol, an Internet Draft. The CIFS protocol is an enhanced version of the Server Message Block (SMB) protocol. For more information, see Microsoft SMB Protocol and CIFS Protocol Overview. The CIFS Internet Draft explicitly identifies that a CIFS implementation may implement opportunistic locks by refusing to grant them.
The following topics identify opportunistic locks:
- Local Caching
- Data Coherency
- How to Request an Opportunistic Lock
- Server Response to Open Requests on Locked Files
- Types of Opportunistic Locks
- Breaking Opportunistic Locks
- Opportunistic Lock Examples
- Opportunistic Lock Operations
For additional information about opportunistic locks, see the CIFS Internet Draft document. Any discrepancies between this topic and the current CIFS Internet Draft should be resolved in favor of the CIFS Internet Draft.
- SMB/CIFS Opportunistic Locks
- CIFS 下opportunistic locks(机会锁)
- SMB/CIFS协议
- SMB/CIFS协议详解
- SMB and CIFS
- 应用SMB/CIFS协议
- SMB/CIFS协议简介
- SMB/CIFS/Samba
- SMB and CIFS
- SMB/CIFS 协议 命令
- SMB CIFS DOMIAN
- NetBIOS与SMB/CIFS协议
- SMB CIFS Samba NFS NAS
- SMB、CIFS、NETBios协议概念
- freenas 安装配置, nfs, cifs, smb类似cifs
- 深入浅出典型协议分析:SMB/CIFS协议
- 浅谈文件服务器smb/cifs,nfs,afp,ftp
- SMB/CIFS协议解析(一)
- WebService优点和缺点小结
- Attribute在.net编程中的应用
- linux下Samba服务器的设置
- .NET 窗体间传送数据方法谈 —— 迟来的补遗
- 发一个比较好看的
- SMB/CIFS Opportunistic Locks
- 初学51地图,感觉LTEvent API注释可能存在问题
- XFire 入门
- 最好用的JS编辑器:JSEclipse及YUT-EXT库的智能代码完成功能
- WTL目录
- 推荐两款基于Eclipse的Javascript插件
- 文本框中输入法切换问题
- 工作流实施中FlowPortal.net对于表单设计易用性和可扩展性的考虑
- 没事的时候看看:道德经