summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2010-10-01 05:45:12 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-01 05:05:53 -0700
commitfd2e7d007e5362f0738cd9a825349abcf5d27d8f (patch)
treed86cd9b0162cd43cb6d1e573b24f6c49a5e353f4 /rpc
parent55c6e672503a2451186e17b9c1b7daf6e3ae5463 (diff)
Changes to replace flock with gf_flock across GlusterFS.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 865 (Add locks recovery support in GlusterFS) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=865
Diffstat (limited to 'rpc')
-rw-r--r--rpc/xdr/src/glusterfs3-xdr.c12
-rw-r--r--rpc/xdr/src/glusterfs3-xdr.h47
-rw-r--r--rpc/xdr/src/glusterfs3.x11
3 files changed, 38 insertions, 32 deletions
diff --git a/rpc/xdr/src/glusterfs3-xdr.c b/rpc/xdr/src/glusterfs3-xdr.c
index 3792d28d2..a6ebf5cf3 100644
--- a/rpc/xdr/src/glusterfs3-xdr.c
+++ b/rpc/xdr/src/glusterfs3-xdr.c
@@ -55,7 +55,7 @@ xdr_gf_statfs (XDR *xdrs, gf_statfs *objp)
}
bool_t
-xdr_gf_flock (XDR *xdrs, gf_flock *objp)
+xdr_gf_proto_flock (XDR *xdrs, gf_proto_flock *objp)
{
if (!xdr_u_int (xdrs, &objp->type))
@@ -68,6 +68,8 @@ xdr_gf_flock (XDR *xdrs, gf_flock *objp)
return FALSE;
if (!xdr_u_int (xdrs, &objp->pid))
return FALSE;
+ if (!xdr_u_quad_t (xdrs, &objp->owner))
+ return FALSE;
return TRUE;
}
@@ -705,7 +707,7 @@ xdr_gfs3_lk_req (XDR *xdrs, gfs3_lk_req *objp)
return FALSE;
if (!xdr_u_int (xdrs, &objp->type))
return FALSE;
- if (!xdr_gf_flock (xdrs, &objp->flock))
+ if (!xdr_gf_proto_flock (xdrs, &objp->flock))
return FALSE;
return TRUE;
}
@@ -718,7 +720,7 @@ xdr_gfs3_lk_rsp (XDR *xdrs, gfs3_lk_rsp *objp)
return FALSE;
if (!xdr_int (xdrs, &objp->op_errno))
return FALSE;
- if (!xdr_gf_flock (xdrs, &objp->flock))
+ if (!xdr_gf_proto_flock (xdrs, &objp->flock))
return FALSE;
return TRUE;
}
@@ -733,7 +735,7 @@ xdr_gfs3_inodelk_req (XDR *xdrs, gfs3_inodelk_req *objp)
return FALSE;
if (!xdr_u_int (xdrs, &objp->type))
return FALSE;
- if (!xdr_gf_flock (xdrs, &objp->flock))
+ if (!xdr_gf_proto_flock (xdrs, &objp->flock))
return FALSE;
if (!xdr_string (xdrs, &objp->path, ~0))
return FALSE;
@@ -754,7 +756,7 @@ xdr_gfs3_finodelk_req (XDR *xdrs, gfs3_finodelk_req *objp)
return FALSE;
if (!xdr_u_int (xdrs, &objp->type))
return FALSE;
- if (!xdr_gf_flock (xdrs, &objp->flock))
+ if (!xdr_gf_proto_flock (xdrs, &objp->flock))
return FALSE;
if (!xdr_string (xdrs, &objp->volume, ~0))
return FALSE;
diff --git a/rpc/xdr/src/glusterfs3-xdr.h b/rpc/xdr/src/glusterfs3-xdr.h
index b0e20cf79..0edf13564 100644
--- a/rpc/xdr/src/glusterfs3-xdr.h
+++ b/rpc/xdr/src/glusterfs3-xdr.h
@@ -205,41 +205,44 @@ gf_statfs_from_statfs (struct gf_statfs *gf_stat, struct statvfs *stat)
gf_stat->namemax = stat->f_namemax;
}
-struct gf_flock {
+struct gf_proto_flock {
u_int type;
u_int whence;
u_quad_t start;
u_quad_t len;
u_int pid;
+ u_quad_t owner;
};
-typedef struct gf_flock gf_flock;
+typedef struct gf_proto_flock gf_proto_flock;
static inline void
-gf_flock_to_flock (struct gf_flock *gf_flock, struct flock *flock)
+gf_proto_flock_to_flock (struct gf_proto_flock *gf_proto_flock, struct gf_flock *gf_flock)
{
- if (!flock || !gf_flock)
+ if (!gf_flock || !gf_proto_flock)
return;
- flock->l_type = gf_flock->type;
- flock->l_whence = gf_flock->whence;
- flock->l_start = gf_flock->start;
- flock->l_len = gf_flock->len;
- flock->l_pid = gf_flock->pid;
+ gf_flock->l_type = gf_proto_flock->type;
+ gf_flock->l_whence = gf_proto_flock->whence;
+ gf_flock->l_start = gf_proto_flock->start;
+ gf_flock->l_len = gf_proto_flock->len;
+ gf_flock->l_pid = gf_proto_flock->pid;
+ gf_flock->l_owner = gf_proto_flock->owner;
}
static inline void
-gf_flock_from_flock (struct gf_flock *gf_flock, struct flock *flock)
+gf_proto_flock_from_flock (struct gf_proto_flock *gf_proto_flock, struct gf_flock *gf_flock)
{
- if (!flock || !gf_flock)
+ if (!gf_flock || !gf_proto_flock)
return;
- gf_flock->type = (flock->l_type);
- gf_flock->whence = (flock->l_whence);
- gf_flock->start = (flock->l_start);
- gf_flock->len = (flock->l_len);
- gf_flock->pid = (flock->l_pid);
+ gf_proto_flock->type = (gf_flock->l_type);
+ gf_proto_flock->whence = (gf_flock->l_whence);
+ gf_proto_flock->start = (gf_flock->l_start);
+ gf_proto_flock->len = (gf_flock->l_len);
+ gf_proto_flock->pid = (gf_flock->l_pid)
+; gf_proto_flock->owner = (gf_flock->l_owner);
}
struct gf_iatt {
@@ -584,14 +587,14 @@ struct gfs3_lk_req {
quad_t fd;
u_int cmd;
u_int type;
- struct gf_flock flock;
+ struct gf_proto_flock flock;
};
typedef struct gfs3_lk_req gfs3_lk_req;
struct gfs3_lk_rsp {
int op_ret;
int op_errno;
- struct gf_flock flock;
+ struct gf_proto_flock flock;
};
typedef struct gfs3_lk_rsp gfs3_lk_rsp;
@@ -599,7 +602,7 @@ struct gfs3_inodelk_req {
char gfid[16];
u_int cmd;
u_int type;
- struct gf_flock flock;
+ struct gf_proto_flock flock;
char *path;
char *volume;
};
@@ -610,7 +613,7 @@ struct gfs3_finodelk_req {
quad_t fd;
u_int cmd;
u_int type;
- struct gf_flock flock;
+ struct gf_proto_flock flock;
char *volume;
};
typedef struct gfs3_finodelk_req gfs3_finodelk_req;
@@ -1018,7 +1021,7 @@ typedef struct gfs3_readdirp_rsp gfs3_readdirp_rsp;
#if defined(__STDC__) || defined(__cplusplus)
extern bool_t xdr_gf_statfs (XDR *, gf_statfs*);
-extern bool_t xdr_gf_flock (XDR *, gf_flock*);
+extern bool_t xdr_gf_proto_flock (XDR *, gf_proto_flock*);
extern bool_t xdr_gf_iatt (XDR *, gf_iatt*);
extern bool_t xdr_gfs3_stat_req (XDR *, gfs3_stat_req*);
extern bool_t xdr_gfs3_stat_rsp (XDR *, gfs3_stat_rsp*);
@@ -1105,7 +1108,7 @@ extern bool_t xdr_gfs3_readdirp_rsp (XDR *, gfs3_readdirp_rsp*);
#else /* K&R C */
extern bool_t xdr_gf_statfs ();
-extern bool_t xdr_gf_flock ();
+extern bool_t xdr_gf_proto_flock ();
extern bool_t xdr_gf_iatt ();
extern bool_t xdr_gfs3_stat_req ();
extern bool_t xdr_gfs3_stat_rsp ();
diff --git a/rpc/xdr/src/glusterfs3.x b/rpc/xdr/src/glusterfs3.x
index a46047f11..a03f7a588 100644
--- a/rpc/xdr/src/glusterfs3.x
+++ b/rpc/xdr/src/glusterfs3.x
@@ -13,12 +13,13 @@ struct gf_statfs {
unsigned hyper namemax;
};
-struct gf_flock {
+struct gf_proto_flock {
unsigned int type;
unsigned int whence;
unsigned hyper start;
unsigned hyper len;
unsigned int pid;
+ unsigned hyper owner;
} ;
@@ -262,19 +263,19 @@ struct gfs3_lookup_req {
hyper fd;
unsigned int cmd;
unsigned int type;
- struct gf_flock flock;
+ struct gf_proto_flock flock;
} ;
struct gfs3_lk_rsp {
int op_ret;
int op_errno;
- struct gf_flock flock;
+ struct gf_proto_flock flock;
} ;
struct gfs3_inodelk_req {
opaque gfid[16];
unsigned int cmd;
unsigned int type;
- struct gf_flock flock;
+ struct gf_proto_flock flock;
string path<>;
string volume<>;
} ;
@@ -284,7 +285,7 @@ struct gfs3_finodelk_req {
hyper fd;
unsigned int cmd;
unsigned int type;
- struct gf_flock flock;
+ struct gf_proto_flock flock;
string volume<>;
} ;