• Hans de Goede's avatar
    vboxsf: Add support for the atomic_open directory-inode op · 52dfd86a
    Hans de Goede authored
    Opening a new file is done in 2 steps on regular filesystems:
    
    1. Call the create inode-op on the parent-dir to create an inode
    to hold the meta-data related to the file.
    2. Call the open file-op to get a handle for the file.
    
    vboxsf however does not really use disk-backed inodes because it
    is based on passing through file-related system-calls through to
    the hypervisor. So both steps translate to an open(2) call being
    passed through to the hypervisor. With the handle returned by
    the first call immediately being closed again.
    
    Making 2 open calls for a single open(..., O_CREATE, ...) calls
    has 2 problems:
    
    a) It is not really efficient.
    b) It actually breaks some apps.
    
    An example of b) is doing a git clone inside a vboxsf mount.
    When git clone tries to create a tempfile to store the pak
    files which is downloading the following happens:
    
    1. vboxsf_dir_mkfile() gets called with a mode of 0444 and succeeds.
    2. vboxsf_file_open() gets called with file...
    52dfd86a
dir.c 11.6 KB