1. 17 Oct, 2008 24 commits
    • Magnus Deininger's avatar
      9p: fix device file handling · 57c7b4e6
      Magnus Deininger authored
      In v9fs_get_inode(), for block, as well as char devices (in theory), 
      the function init_special_inode() is called to set up callback functions 
      for file ops. this function uses the file mode's value to determine whether 
      to use block or char dev functions. In v9fs_inode_from_fid(), the function 
      p9mode2unixmode() is used, but for all devices it initially returns S_IFBLK, 
      then uses v9fs_get_inode() to initialise a new inode, then finally uses 
      v9fs_stat2inode(), which would determine whether the inode is a block or 
      character device. However, at that point init_special_inode() had already 
      decided to use the block device functions, so even if the inode's mode is 
      turned to a character device, the block functions are still used to operate 
      on them. The attached patch simply calls init_special_inode() again for devices 
      after parsing device node data in v9fs_stat2inode() so that the proper functions 
      are used.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      57c7b4e6
    • Eric Van Hensbergen's avatar
      9p: Improve debug support · e7f4b8f1
      Eric Van Hensbergen authored
      The new debug support lacks some of the information that the previous fcprint
      code provided -- this patch focuses on better presentation of debug data along
      with more helpful debug along error paths.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      
      
      e7f4b8f1
    • Eric Van Hensbergen's avatar
      9p: eliminate depricated conv functions · 02da398b
      Eric Van Hensbergen authored
      Remove depricated conv functions which have been replaced with new 
      protocol routines.
      
      This patch also reworks the one instance of the file-system code which
      directly calls conversion routines (to accomplish unpacking dirreads).
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      02da398b
    • Eric Van Hensbergen's avatar
      9p: rework client code to use new protocol support functions · 51a87c55
      Eric Van Hensbergen authored
      Now that the new protocol functions are in place, this patch switches
      the client code to using the new support code.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      51a87c55
    • Eric Van Hensbergen's avatar
      9p: remove unnecessary tag field from p9_req_t structure · cb198131
      Eric Van Hensbergen authored
      This removes the vestigial tag field from the p9_req_t structure.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      
      
      cb198131
    • Eric Van Hensbergen's avatar
      9p: remove 9p fcall debug prints · 51d71f9f
      Eric Van Hensbergen authored
      One of the current debug options allows users to get a verbose dump of fcalls.
      This isn't really necessary as correctly parsed protocol frames can be printed
      as part of the code in the client functions.  The consolidated printfcalls
      structure would require new entries to be added for every extension.  This
      patch removes the debug print methods and their use.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      
      
      51d71f9f
    • Eric Van Hensbergen's avatar
      9p: add new protocol support code · ace51c4d
      Eric Van Hensbergen authored
      This adds a new protocol processing support code based on Anthony Liguori's
      9p library code.  This code performs protocol marshalling/unmarshalling using
      printf like strings to represent protocol elements.  It is my intent to use
      them to replace the current functions in conv.c as well as the 
      p9_create_* functions.
      
      This should make the client implementation much more clear, and also make it
      much easier to add new protocol extensions by limiting the number of places
      in which changes need to be made.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      ace51c4d
    • Eric Van Hensbergen's avatar
      9p: encapsulate version function · 6936bf60
      Eric Van Hensbergen authored
      Alsmot all 9P client wire functions have their own (set of) functions.
      Tversion is an exception as its encapsulated into the client_create code.
      
      This patch moves the protocol specifics of this to a function to match the
      rest of the code.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      
      6936bf60
    • Eric Van Hensbergen's avatar
      9p: move dirread to fs layer · 06b55b46
      Eric Van Hensbergen authored
      Currently reading a directory is implemented in the client code.
      This function is not actually a wire operation, but a meta operation 
      which calls read operations and processes the results.
      
      This patch moves this functionality to the fs layer and calls component
      wire operations instead of constructing their packets.  This provides a 
      cleaner separation and will help when we reorganize the client functions
      and protocol processing methods.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      
      06b55b46
    • Eric Van Hensbergen's avatar
      9p: adjust 9p vfs write operation · dfb0ec2e
      Eric Van Hensbergen authored
      Currently, the 9p net wire operation ensures that all data is sent by sending
      multiple packets if the data requested is larger than the msize.  This is
      better handled in the vfs code so that we can simplify wire operations to 
      being concerned with only putting data onto and taking data off of the wire.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      
      dfb0ec2e
    • Eric Van Hensbergen's avatar
      9p: move readn meta-function from client to fs layer · fbedadc1
      Eric Van Hensbergen authored
      There are a couple of methods in the client code which aren't actually
      wire operations.  To keep things organized cleaner, these operations are
      being moved to the fs layer.
      
      This patch moves the readn meta-function (which executes multiple wire
      reads until a buffer is full) to the fs layer.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      
      fbedadc1
    • Eric Van Hensbergen's avatar
      9p: consolidate read/write functions · 0fc9655e
      Eric Van Hensbergen authored
      Currently there are two separate versions of read and write.  One for
      dealing with user buffers and the other for dealing with kernel buffers.
      There is a tremendous amount of code duplication in the otherwise
      identical versions of these functions.  This patch adds an additional
      user buffer parameter to read and write and conditionalizes handling of
      the buffer on whether the kernel buffer or the user buffer is populated.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      
      
      
      0fc9655e
    • Tejun Heo's avatar
      9p: drop broken unused error path from p9_conn_create() · 95820a36
      Tejun Heo authored
      Post p9_fd_poll() error path which checks m->poll_waddr[i] for PTR_ERR
      value has the following problems.
      
      * It's completely unused.  Error value is set iff NULL @wait_address
        has been specified to p9_pollwait() which is guaranteed not to
        happen.
      
      * It dereferences @M after deallocating it (introduced by 571ffeaf and
        spotted by Raja R Harinath.
      
      * It returned the wrong value on error.  It should return
        poll_waddr[i] but it returnes poll_waddr (introduced by 571ffeaf).
      
      * p9_mux_poll_stop() doesn't handle PTR_ERR value.  It will try to
        operate on the PTR_ERR value as if it's a normal pointer and cause
        oops.
      
      As the error path is bogus in the first place, there's no reason to
      hold onto it.  Kill it.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      Cc: Raja R Harinath <harinath@hurrynot.org>
      95820a36
    • Eric Van Hensbergen's avatar
      9p: make rpc code common and rework flush code · 91b8534f
      Eric Van Hensbergen authored
      This code moves the rpc function to the common client base,
      reorganizes the flush code to be more simple and stable, and
      makes the necessary adjustments to the underlying transports
      to adapt to the new structure.
      
      This reduces the overall amount of code duplication between the
      transports and should make adding new transports more straightforward.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      91b8534f
    • Eric Van Hensbergen's avatar
      9p: use the rcall structure passed in the request in trans_fd read_work · 1b0a763b
      Eric Van Hensbergen authored
      This patch reworks the read_work function to enable it to directly use a passed
      in rcall structure.  This should help allow us to remove unnecessary copies
      in the future.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      1b0a763b
    • Eric Van Hensbergen's avatar
      9p: apply common request code to trans_fd · 673d62cd
      Eric Van Hensbergen authored
      Apply the now common p9_req_t structure to the fd transport.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      673d62cd
    • Eric Van Hensbergen's avatar
      9p: apply common tagpool handling to trans_fd · ff683452
      Eric Van Hensbergen authored
      Simplify trans_fd by using new common client tagpool structure.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      ff683452
    • Eric Van Hensbergen's avatar
      9p: move request management to client code · fea511a6
      Eric Van Hensbergen authored
      The virtio transport uses a simplified request management system
      that I want to use for all transports.  This patch adapts and moves the
      exisiting code for managing requests to the client common code.
      Later patches will apply these mechanisms to the other transports.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      fea511a6
    • Eric Van Hensbergen's avatar
      9p: eliminate callback complexity · 044c7768
      Eric Van Hensbergen authored
      The current trans_fd rpc mechanisms use a dynamic callback mechanism which
      introduces a lot of complexity which only accomodates a single special case.
      This patch removes much of that complexity in favor of a simple exception
      mechanism to deal with flushes.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      044c7768
    • Eric Van Hensbergen's avatar
      9p: consolidate mux_rpc and request structure · 21c00368
      Eric Van Hensbergen authored
      Currently, trans_fd has two structures (p9_req and p9_mux-rpc)
      which contain mostly duplicate data.
      
      This patch consolidates these two structures and removes p9_mux_rpc.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      21c00368
    • Eric Van Hensbergen's avatar
      9p: remove unnecessary prototypes · 5503ac56
      Eric Van Hensbergen authored
      Cleanup files by reordering functions in order to remove need for
      unnecessary function prototypes.
      
      There are no code changes here, just functions being moved around and
      prototypes being eliminated.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      5503ac56
    • Eric Van Hensbergen's avatar
      9p: remove duplicate client state · bead27f0
      Eric Van Hensbergen authored
      Now that we are passing client state into the transport modules, remove
      duplicate state which is present in transport private structures.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      bead27f0
    • Eric Van Hensbergen's avatar
      9p: consolidate transport structure · 8b81ef58
      Eric Van Hensbergen authored
      Right now there is a transport module structure which provides per-transport
      type functions and data and a transport structure which contains per-instance
      public data as well as function pointers to instance specific functions.
      
      This patch moves public transport visible instance data to the client
      structure (which in some cases had duplicate data) and consolidates the
      functions into the transport module structure.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      8b81ef58
    • Tejun Heo's avatar
      9p-trans_fd: use single poller · 992b3f1d
      Tejun Heo authored
      trans_fd used pool of upto 100 pollers to monitor the r/w fds.  The
      approach makes sense in userspace back when the only available
      interfaces were poll(2) and select(2).  As each event monitor -
      trigger - handling iteration took O(n) where `n' is the number of
      watched fds, it makes sense to spread them to many pollers such that
      the `n' can be divided by the number of pollers.  However, this
      doesn't make any sense in kernel because persistent edge triggered
      event monitoring is how the whole thing is implemented in the kernel
      in the first place.
      
      This patch converts trans_fd to use single poller which watches all
      the fds instead of the poll of pollers approach.  All the fds are
      registered for monitoring on creation and only the fds with pending
      events are scanned when something happens much like how epoll is
      implemented.
      
      This change makes trans_fd fd monitoring more efficient and simpler.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      992b3f1d
  2. 16 Oct, 2008 16 commits