• F
    file-posix: Add image locking to perm operations · 244a5668
    Fam Zheng 提交于
    This extends the permission bits of op blocker API to external using
    Linux OFD locks.
    
    Each permission in @perm and @shared_perm is represented by a locked
    byte in the image file.  Requesting a permission in @perm is translated
    to a shared lock of the corresponding byte; rejecting to share the same
    permission is translated to a shared lock of a separate byte. With that,
    we use 2x number of bytes of distinct permission types.
    
    virtlockd in libvirt locks the first byte, so we do locking from a
    higher offset.
    Suggested-by: NKevin Wolf <kwolf@redhat.com>
    Signed-off-by: NFam Zheng <famz@redhat.com>
    Signed-off-by: NKevin Wolf <kwolf@redhat.com>
    244a5668
file-posix.c 82.6 KB