Code Monkey home page Code Monkey logo

linux-srvfs-oot's Introduction

Plan9 style /srv files system for posting file descriptors
===========================================================

srvfs is synthentic file system for "posting" open file descriptors back
int the file system, so the can be opened and used from here. This is one
of the vital concepts of Plan9.

The primary use case is programs that "dial" some connection (eg. sockets),
do some initial handshakes (eg. authentication) and publish the open fd
into the file system, so other programs can get an open fd (via open())
from here and continue using this connection.

Another use case is selective crossing of security domains (eg. separate
uid's): agents can open certain files (they're permitted to) on behalf
of some clients, which don't have access to those files, and post open
file descriptors into the file system, where the agent can easily pick
them up.


Building
--------

Usually, just running 'make' should be enough. The kernel module will be
built against the currently running kernel, but not installed anywhere.
The module then can be loaded via insmod(1).


Using
-----

The driver adds the filesystem as "srvfs". It can be easily mounted via:

mount none <target-dir> -t srvfs


A program whishing to post an open fd, just has to open a new file within
the srv file system and write the fd number (decimal printed) into it.
The kernel driver then takes a reference to the (kernel-internal) file
descriptor structure and redirect all file operations to this fd. The fd
will be kept open, even if the original process terminates, until the
file entry in srvfs is unlink()ed.


2DO
---
    * locking:
        * yet completely untested
        * needs deeper revision, just returning 0 on unimplemented fops
          might not be enough, seems there's a generic implementation
          we need to call instead
        * see various functions in fs/lock.c
        * what does is_remote_lock() really do ?
    * test suite:
        * currently just have some simple test scripts, which don't
          cover much yet :(

linux-srvfs-oot's People

Contributors

metux avatar

Watchers

James Cloos 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.