Code Monkey home page Code Monkey logo

libnfs's Introduction

libnfs Rust

Safe NFS bindings to build NFS clients in Rust libnfs rust bindings

NFS in userspace.

Note to users: Depending on your system you may need to install some extra libraries for this to link properly. Here's what I used on ubuntu 16.04:

dpkg -l | grep -i libnfs
ii  libnfs-dev:amd64                            1.9.8-1                                      amd64        NFS client library (development files)
ii  libnfs8:amd64                               1.9.8-1                                      amd64        NFS client library (shared library)

And also on ubuntu 20.04:

dpkg -l | grep -i libnfs
ii  libnfs-dev:amd64                          4.0.0-1                               amd64        NFS client library (development files)
ii  libnfs13:amd64                            4.0.0-1                               amd64        NFS client library (shared library)

libnfs's People

Contributors

cholcombe973 avatar jsgf avatar mzhong1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

libnfs's Issues

The definition of NfsFile only allows one file to be open at a time

Because NfsFile has a mutable borrow of Nfs, you can't use Nfs again until you drop the NfsFile. This would make using the API pretty awkward.

I think the options here are to either:

  1. Wrap the underlying nfs_context in an Rc to manage the lifetime, and just rely on unsafe/raw pointers to allow the mutability (should be safe for the sync API since everything is single-threaded; not sure about the async)
  2. Add a &mut Nfs parameter to all the NfsFile methods so they have access to it while they operate. This allows some probably broken behaviour like using the wrong Nfs instance for a given NfsFile.

pread API has a potential buffer overrun

pread() doesn't check that buffer.capacity() is >= count.

I think it would be a better API to just make pread do the allocation and return a Vec<u8>:

fn pread(&self, count: u64, offset: u64) -> Result<Vec<u8>> {

read/write should use libnfs's fh offset

libnfs maintains its own per-FH offset for use with read/write/seek, so the wrapper should use that rather than always using an offset of 0. Or alternatively not provide read/write and just expose pread/pwrite.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.