Skip to content
  • Rick Macklem's avatar
    nfscl: Cache an open stateid for the "oneopenown" mount option · efea1bc1
    Rick Macklem authored
    For NFSv4.1/4.2, if the "oneopenown" mount option is used,
    there is, at most, only one open stateid for each NFS vnode.
    When an open stateid for a file is acquired, set a pointer to
    the open structure in the NFS vnode.  This pointer can be used to
    acquire the open stateid without searching the open linked list
    when the following is true:
    - No delegations have been issued for the file.  Since delegations
      can outlive an NFS vnode for a file, use the global
      NFSMNTP_DELEGISSUED flag on the mount to determine this.
    - No lock stateid has been issued for the file.  To determine
      this, a new NFS vnode flag called NMIGHTBELOCKED is set when a lock
      stateid is issued, which can then be tested.
    
    When this open structure pointer can be used, it avoids the need to
    acquire the NFSCLSTATELOCK() and searching the open structure list for
    an open.  The NFSCLSTATELOCK() can be highly contended when there are
    a lot of opens issued for the NFSv4.1/4.2 mount.
    
    This patch only affects NFSv4.1/4.2 mounts when the "oneopenown"
    mount option is used.
    
    MFC after:	2 weeks
    efea1bc1