per file lock list

From: Igor Shmukler (igor.shmukler_at_gmail.com)
Date: 07/21/05

  • Next message: Sam Pierson: "Re: Atheros, hardware access layer, collisions"
    Date: Thu, 21 Jul 2005 15:10:30 -0400
    To: fs@freebsd.org, hackers@freebsd.org, dillon@apollo.backplane.com
    
    

    Hi,

    We have a question: how to get all POSIX locks for a given file?

    As far as I know, existing API does not allow to retrieve all file
    locks. Therefore, we need to use kernel internal structures to get all
    applied locks. Unfortunately, a head of list with file locks is
    attached to inode rather then vnode. As result, it is much harder to
    get the lock list head due to the need to know exact inode type that
    is hidden behind the vnode.

    Of course, the problem could be resolved in a hackish way: we may get
    the address of VOP_ADVLOCK() method and compare it with all known FS
    methods, that handles this VOP operation: (ufs_advlock, etc.) and
    therefore apply a proper type cast to vnode->v_data to get valid
    inode. However, this would be a last resort.

    So the question: is there an elegant way to get the lock list for a given file?

    Thank you in advance.
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Sam Pierson: "Re: Atheros, hardware access layer, collisions"

    Relevant Pages

    • Re: [PATCH] prune_icache_sb
      ... post-ext2 filesystem, but that's the way it is). ... example why trying to do too many things inside vfs layer for so many ... vfs layer locks that are local to this particular machine, ... inode. ...
      (Linux-Kernel)
    • Re: Possible recursive locking detected with XFS
      ... this is the classic "recurse into the filesystem to do something ... that requires locks while holding a lock on a different inode" false positive. ...
      (Linux-Kernel)
    • Re: [PATCH] prune_icache_sb
      ... mount points (per vfs superblock) due to performance issues found after ... particularly serious for one of our kernel modules where it caches its ... locks based on vfs inode implementation. ...
      (Linux-Kernel)
    • Re: [PATCH] Increase lockdep MAX_LOCK_DEPTH
      ... MAX_LOCK_DEPTH, because when deleting an entire cluster of inodes, ... few other locks along the way, and 40 seems enough to get me through ... The problem is not filesystem block size, it's the xfs inode cluster buffer ... This inode writeback clustering is one of the reasons XFS doesn't suffer from ...
      (Linux-Kernel)
    • [PATCH 1/5] Cleanup macros for distinguishing mandatory locks
      ... macro for this check called MANDATORY_LOCK. ... as it dereferences the inode arg twice. ... * Candidates for mandatory locking have the setgid bit set ... /* Don't allow mandatory locks on files that may be memory mapped ...
      (Linux-Kernel)