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

lofs fid improvements #35

Merged
merged 11 commits into from
Nov 30, 2015
Merged

lofs fid improvements #35

merged 11 commits into from
Nov 30, 2015

Commits on Nov 29, 2015

  1. lofs: walk: newfid must be fresh (or equal to fid)

    Walk(9P) says: "The walk request carries as arguments an existing fid and a
    proposed newfid (which must not be in use unless it is the same as fid"
    
    This patch returns an error if the newfid is already in use, unless it
    is the same as fid.
    
    Signed-off-by: David Scott <dave.scott@unikernel.com>
    djs55 committed Nov 29, 2015
    Configuration menu
    Copy the full SHA
    6d6168d View commit details
    Browse the repository at this point in the history
  2. lofs: remove should clunk the fid in the failure case

    The Remove(9P) man page says: "The remove request asks the file server
    both to remove the file represented by fid and to clunk the fid, even if
    the remove fails."
    
    This patch includes a unit test which checks this behaviour.
    
    Signed-off-by: David Scott <dave.scott@unikernel.com>
    djs55 committed Nov 29, 2015
    Configuration menu
    Copy the full SHA
    7797922 View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2015

  1. lofs: bind fids to a resource record

    This is the start of a series of patches where we associate more
    server-side state with fids.
    
    Signed-off-by: David Scott <dave.scott@unikernel.com>
    djs55 committed Nov 30, 2015
    Configuration menu
    Copy the full SHA
    0f76592 View commit details
    Browse the repository at this point in the history
  2. lofs: server-side resources can have open handles

    Note we are not yet storing these open handles.
    
    Signed-off-by: David Scott <dave.scott@unikernel.com>
    djs55 committed Nov 30, 2015
    Configuration menu
    Copy the full SHA
    3c91734 View commit details
    Browse the repository at this point in the history
  3. lofs: in clunk and remove, close the resource

    Signed-off-by: David Scott <dave.scott@unikernel.com>
    djs55 committed Nov 30, 2015
    Configuration menu
    Copy the full SHA
    46b1e88 View commit details
    Browse the repository at this point in the history
  4. lofs: open and create should open the resource

    Note this means that the unit tests need to create the directories with
    `Read permission, for them to be successfully opened.
    
    This also implies that we perform an implicit mode check on `open` which
    we didn't do before.
    
    Signed-off-by: David Scott <dave.scott@unikernel.com>
    djs55 committed Nov 30, 2015
    Configuration menu
    Copy the full SHA
    9559b57 View commit details
    Browse the repository at this point in the history
  5. lofs: read and write use cached handles

    Rather than opening fresh handles each time, we now use the handles from
    `open` or `create`. Note this means we have to hold a mutex around
    `seek`+`read` and `seek`+`write` to prevent parallel operations
    conflicting over the file position.
    
    Signed-off-by: David Scott <dave.scott@unikernel.com>
    djs55 committed Nov 30, 2015
    Configuration menu
    Copy the full SHA
    6d3df76 View commit details
    Browse the repository at this point in the history
  6. test: check that reading out-of-bounds doesn't fail badly

    If the client reads beyond the end of the directory, return with a
    length of 0 rather than an `Invalid_argument "Cstruct.sub..."`
    
    Signed-off-by: David Scott <dave.scott@unikernel.com>
    djs55 committed Nov 30, 2015
    Configuration menu
    Copy the full SHA
    819f99a View commit details
    Browse the repository at this point in the history
  7. lofs: remove of a symlink should use lstat

    A symlink can be dangling, which means that `stat` will return `ENOENT`.
    When removing we want to remove the symlink itself so `lstat` is
    appropriate.
    
    Signed-off-by: David Scott <dave.scott@unikernel.com>
    djs55 committed Nov 30, 2015
    Configuration menu
    Copy the full SHA
    c80459f View commit details
    Browse the repository at this point in the history
  8. lofs: use return_unit rather than Lwt.return ()

    Signed-off-by: David Scott <dave.scott@unikernel.com>
    djs55 committed Nov 30, 2015
    Configuration menu
    Copy the full SHA
    9917c62 View commit details
    Browse the repository at this point in the history
  9. lofs: explicitly call clunk from remove

    This avoids duplicating the `clunk` internals (i.e. closing the
    associated Resource)
    
    Signed-off-by: David Scott <dave.scott@unikernel.com>
    djs55 committed Nov 30, 2015
    Configuration menu
    Copy the full SHA
    4353f2c View commit details
    Browse the repository at this point in the history