summaryrefslogtreecommitdiffstats
path: root/include/net/9p
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/9p')
-rw-r--r--include/net/9p/9p.h28
-rw-r--r--include/net/9p/client.h1
2 files changed, 29 insertions, 0 deletions
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 55e9605..1859a25 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -165,6 +165,8 @@ enum p9_msg_t {
P9_RREADDIR,
P9_TFSYNC = 50,
P9_RFSYNC,
+ P9_TLOCK = 52,
+ P9_RLOCK,
P9_TLINK = 70,
P9_RLINK,
P9_TMKDIR = 72,
@@ -464,6 +466,32 @@ struct p9_iattr_dotl {
u64 mtime_nsec;
};
+#define P9_LOCK_SUCCESS 0
+#define P9_LOCK_BLOCKED 1
+#define P9_LOCK_ERROR 2
+#define P9_LOCK_GRACE 3
+
+#define P9_LOCK_FLAGS_BLOCK 1
+#define P9_LOCK_FLAGS_RECLAIM 2
+
+/* struct p9_flock: POSIX lock structure
+ * @type - type of lock
+ * @flags - lock flags
+ * @start - starting offset of the lock
+ * @length - number of bytes
+ * @proc_id - process id which wants to take lock
+ * @client_id - client id
+ */
+
+struct p9_flock {
+ u8 type;
+ u32 flags;
+ u64 start;
+ u64 length;
+ u32 proc_id;
+ char *client_id;
+};
+
/* Structures for Protocol Operations */
struct p9_tstatfs {
u32 fid;
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 8744e3a..d7dcb14 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -249,6 +249,7 @@ int p9_client_mknod_dotl(struct p9_fid *oldfid, char *name, int mode,
dev_t rdev, gid_t gid, struct p9_qid *);
int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode,
gid_t gid, struct p9_qid *);
+int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status);
struct p9_req_t *p9_tag_lookup(struct p9_client *, u16);
void p9_client_cb(struct p9_client *c, struct p9_req_t *req);
OpenPOWER on IntegriCloud