Git Product home page Git Product logo

naivefs's Introduction

NaiveFS

Naive file system based on fuse.

About FUSE

  • File System in Userspace: the most widely used user-space file system framework.
  • Provides simple API and easy to understand its internal architecture and implementation details.
  • FUSE's kernel module registers a fuse file-system driver and a /dev/fuse block device (like a shared space between user daemon and kernel module for exchanging requests and responses).
  • VFS will route file requests from userspace to registered fuse kernel driver. The kernel driver allocates a FUSE request structure and puts it in a FUSE queue. Process wait for the request handled by user daemon of fuse. Processing the request might require re-entering the kernel again:
    • In our implementation, we have to handle requests by accessing virtual disk /dev/disk to simulate real file system driver. So one request from user processes will at least trap into kernel 3 times: 1. user process submits request; 2. fuse user daemon (our file system) handles virtual disk; 3. fuse user daemon submits response.
    • The user process will be suspended until all the processes above is finished.
    • Crash may happens at any point of these processes, so we need to manage consistency and persistency.
  • User-kernel protocol:
    • handle requests from FUSE's kernel driver which have a direct mapping to traditional VFS operations;
    • Request structure:
      • type
      • sequence number
      • node ID: an unsigned 64-bit integer
  • FUSE request queues:
    • interrupts: INTERRUPT,
    • forgets: FORGET (selected fairly with non-FORGET requests)
    • pending: synchronous requests (e.g., Metadata)
    • processing: the oldest pending request is moved to user space and the processing queue
    • background: asynchronous requests (read requests and write requests if the writeback cache is enabled)

TODO List

  • A makefile for whole project. Thus we can run tests and build targets in different environments.

  • FUSE operations:

    • Special:
      • INIT
      • DESTROY
    • Metadata:
      • OPEN
      • CREATE
      • STATFS
      • LINK
      • UNLINK
      • RELEASE
      • ACCESS
      • CHMOD
      • CHOWN
      • TRUNCATE
      • UTIMENS
      • RENAME
    • Data: (yfzcsc)
      • READ
      • WRITE
      • FLUSH
      • FSYNC
      • COPY_FILE_RANGE (not necessary)
      • WRITE_BUF (not necessary)
      • READ_BUF (not necessary)
    • Attributes: (yfzcsc)
      • GETATTR
      • SETATTR
    • Extended Attributes: (yfzcsc)
      • SETXATTR (not necessary)
      • GETXATTR (not necessary)
      • LISTXATTR (not necessary)
      • REMOVEXATTR (not necessary)
    • Symlinks: (yfzcsc)
      • SYMLINK
      • READLINK
    • Directory: (yfzcsc)
      • MKDIR
      • RMDIR
      • OPENDIR (not necessary)
      • RELEASEDIR (not necessary)
      • READDIR
      • FSYNCDIR (not necessary)
    • Locking:
      • LOCK
      • FLOCK
    • Misc: (yfzcsc)
      • BMAP
      • FALLOCATE
      • MKNOD
      • LOCTL
      • POLL

Run

bash run.sh

naivefs's People

Contributors

tkf2019 avatar yfzcsc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.