9p: Implement TGETLOCK
authorM. Mohan Kumar <mohan@in.ibm.com>
Mon, 27 Sep 2010 06:52:13 +0000 (12:22 +0530)
committerEric Van Hensbergen <ericvh@gmail.com>
Thu, 28 Oct 2010 14:08:47 +0000 (09:08 -0500)
commit1d769cd192fc8c4097b1e2cd41fdee6ba3d1b2af
tree16fd71ff9178bbfe144a28a2e168c85fb541a11b
parenta099027c779068b834f335cfdc3f2bf10f531dd9
9p: Implement TGETLOCK

Synopsis

    size[4] TGetlock tag[2] fid[4] getlock[n]
    size[4] RGetlock tag[2] getlock[n]

Description

TGetlock is used to test for the existence of byte range posix locks on a file
identified by given fid. The reply contains getlock structure. If the lock could
be placed it returns F_UNLCK in type field of getlock structure.  Otherwise it
returns the details of the conflicting locks in the getlock structure

    getlock structure:
      type[1] - Type of lock: F_RDLCK, F_WRLCK
      start[8] - Starting offset for lock
      length[8] - Number of bytes to check for the lock
             If length is 0, check for lock in all bytes starting at the location
            'start' through to the end of file
      pid[4] - PID of the process that wants to take lock/owns the task
               in case of reply
      client[4] - Client id of the system that owns the process which
                  has the conflicting lock

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
fs/9p/vfs_file.c
include/net/9p/9p.h
include/net/9p/client.h
net/9p/client.c