Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement node deletions #45

Merged
merged 3 commits into from Nov 10, 2018
Merged

Implement node deletions #45

merged 3 commits into from Nov 10, 2018

Commits on Nov 9, 2018

  1. Prepare to support setattr on deleted files

    In order to implement unlink and rmdir, which will come later, we must
    prepare to deal with the case of applying updates to a delete node via
    still-open handles.
    
    To do this, avoid doing a getattr immediately after a setattr (because
    it may not be possible once the underlying file is gone), and instead
    compute what the updated attributes should be.  This is not completely
    accurate because of ctime, but it's good enough for now.
    
    Also, make the input path to setattr optional so that we can ask this
    function to only update the in-memory properties.
    jmmv committed Nov 9, 2018
    Configuration menu
    Copy the full SHA
    e661211 View commit details
    Browse the repository at this point in the history
  2. Implement rmdir and unlink

    To support operations on deleted nodes, this changes File and Symlink
    so that their underlying path is optional (Dir already had this).  When
    None we treat these nodes as deleted, which means that some operations
    become impossible on them and others, like setattr, only have affect
    in-memory node data.
    jmmv committed Nov 9, 2018
    Configuration menu
    Copy the full SHA
    ec035e0 View commit details
    Browse the repository at this point in the history
  3. Return EOPNOTSUPP when trying to setattr the times of a symlink

    The setattr hook should be using futimensat to update the timestamps
    of the node so that we could support the case of modifying those of
    a symlink (without following it).
    
    Unfortunately, we currently cannot do so because our testing environment
    does not have this system call available in all platforms... so just
    return EOPNOTSUPP for now (instead of doing the wrong thing and following
    the symlink).
    jmmv committed Nov 9, 2018
    Configuration menu
    Copy the full SHA
    03e6bd9 View commit details
    Browse the repository at this point in the history