diff options
| author | M. Mohan Kumar <mohan@in.ibm.com> | 2010-09-27 02:52:13 -0400 |
|---|---|---|
| committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-10-28 10:08:47 -0400 |
| commit | 1d769cd192fc8c4097b1e2cd41fdee6ba3d1b2af (patch) | |
| tree | 16fd71ff9178bbfe144a28a2e168c85fb541a11b /include | |
| parent | a099027c779068b834f335cfdc3f2bf10f531dd9 (diff) | |
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>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/9p/9p.h | 18 | ||||
| -rw-r--r-- | include/net/9p/client.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index 1859a2560cc5..6367a71d84fc 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h | |||
| @@ -167,6 +167,8 @@ enum p9_msg_t { | |||
| 167 | P9_RFSYNC, | 167 | P9_RFSYNC, |
| 168 | P9_TLOCK = 52, | 168 | P9_TLOCK = 52, |
| 169 | P9_RLOCK, | 169 | P9_RLOCK, |
| 170 | P9_TGETLOCK = 54, | ||
| 171 | P9_RGETLOCK, | ||
| 170 | P9_TLINK = 70, | 172 | P9_TLINK = 70, |
| 171 | P9_RLINK, | 173 | P9_RLINK, |
| 172 | P9_TMKDIR = 72, | 174 | P9_TMKDIR = 72, |
| @@ -492,6 +494,22 @@ struct p9_flock { | |||
| 492 | char *client_id; | 494 | char *client_id; |
| 493 | }; | 495 | }; |
| 494 | 496 | ||
| 497 | /* struct p9_getlock: getlock structure | ||
| 498 | * @type - type of lock | ||
| 499 | * @start - starting offset of the lock | ||
| 500 | * @length - number of bytes | ||
| 501 | * @proc_id - process id which wants to take lock | ||
| 502 | * @client_id - client id | ||
| 503 | */ | ||
| 504 | |||
| 505 | struct p9_getlock { | ||
| 506 | u8 type; | ||
| 507 | u64 start; | ||
| 508 | u64 length; | ||
| 509 | u32 proc_id; | ||
| 510 | char *client_id; | ||
| 511 | }; | ||
| 512 | |||
| 495 | /* Structures for Protocol Operations */ | 513 | /* Structures for Protocol Operations */ |
| 496 | struct p9_tstatfs { | 514 | struct p9_tstatfs { |
| 497 | u32 fid; | 515 | u32 fid; |
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index d7dcb142e3bb..127c9f2a9cb8 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
| @@ -250,6 +250,7 @@ int p9_client_mknod_dotl(struct p9_fid *oldfid, char *name, int mode, | |||
| 250 | int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, | 250 | int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, |
| 251 | gid_t gid, struct p9_qid *); | 251 | gid_t gid, struct p9_qid *); |
| 252 | int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status); | 252 | int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status); |
| 253 | int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *fl); | ||
| 253 | struct p9_req_t *p9_tag_lookup(struct p9_client *, u16); | 254 | struct p9_req_t *p9_tag_lookup(struct p9_client *, u16); |
| 254 | void p9_client_cb(struct p9_client *c, struct p9_req_t *req); | 255 | void p9_client_cb(struct p9_client *c, struct p9_req_t *req); |
| 255 | 256 | ||
