summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--contrib/fuse-include/fuse-misc.h3
-rw-r--r--contrib/fuse-lib/misc.c5
-rw-r--r--libglusterfs/src/call-stub.c8
-rw-r--r--libglusterfs/src/call-stub.h16
-rw-r--r--libglusterfs/src/common-utils.c4
-rw-r--r--libglusterfs/src/defaults.c14
-rw-r--r--libglusterfs/src/defaults.h14
-rw-r--r--libglusterfs/src/glusterfs.h8
-rw-r--r--libglusterfs/src/xlator.h8
-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
-rw-r--r--xlators/cluster/afr/src/afr-common.c10
-rw-r--r--xlators/cluster/afr/src/afr-lk-common.c26
-rw-r--r--xlators/cluster/afr/src/afr.h6
-rw-r--r--xlators/cluster/dht/src/dht-common.c8
-rw-r--r--xlators/cluster/ha/src/ha.c12
-rw-r--r--xlators/cluster/map/src/map.c8
-rw-r--r--xlators/cluster/stripe/src/stripe.c4
-rw-r--r--xlators/cluster/stripe/src/stripe.h2
-rw-r--r--xlators/cluster/unify/src/unify.c8
-rw-r--r--xlators/debug/error-gen/src/error-gen.c8
-rw-r--r--xlators/debug/io-stats/src/io-stats.c8
-rw-r--r--xlators/debug/trace/src/trace.c8
-rw-r--r--xlators/features/locks/src/common.c14
-rw-r--r--xlators/features/locks/src/common.h12
-rw-r--r--xlators/features/locks/src/inodelk.c12
-rw-r--r--xlators/features/locks/src/locks.h4
-rw-r--r--xlators/features/locks/src/posix.c12
-rw-r--r--xlators/features/path-convertor/src/path.c2
-rw-r--r--xlators/features/quiesce/src/quiesce.c6
-rw-r--r--xlators/features/read-only/src/read-only.c6
-rw-r--r--xlators/meta/src/meta.c4
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c10
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.h2
-rw-r--r--xlators/performance/io-cache/src/io-cache.c4
-rw-r--r--xlators/performance/io-threads/src/io-threads.c6
-rw-r--r--xlators/performance/quick-read/src/quick-read.c10
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c4
-rw-r--r--xlators/protocol/client/src/client-lk.c24
-rw-r--r--xlators/protocol/client/src/client.c6
-rw-r--r--xlators/protocol/client/src/client.h6
-rw-r--r--xlators/protocol/client/src/client3_1-fops.c10
-rw-r--r--xlators/protocol/legacy/client/src/client-protocol.c8
-rw-r--r--xlators/protocol/legacy/lib/src/protocol.h4
-rw-r--r--xlators/protocol/legacy/server/src/server-helpers.c4
-rw-r--r--xlators/protocol/legacy/server/src/server-protocol.c2
-rw-r--r--xlators/protocol/legacy/server/src/server-protocol.h2
-rw-r--r--xlators/protocol/server/src/server-helpers.c4
-rw-r--r--xlators/protocol/server/src/server.h2
-rw-r--r--xlators/protocol/server/src/server3_1-fops.c10
-rw-r--r--xlators/storage/bdb/src/bdb.c8
-rw-r--r--xlators/storage/posix/src/posix.c8
53 files changed, 242 insertions, 222 deletions
diff --git a/contrib/fuse-include/fuse-misc.h b/contrib/fuse-include/fuse-misc.h
index 16b473472..f905215b0 100644
--- a/contrib/fuse-include/fuse-misc.h
+++ b/contrib/fuse-include/fuse-misc.h
@@ -10,4 +10,5 @@
unsigned long calc_timeout_sec (double t);
unsigned int calc_timeout_nsec (double t);
-void convert_fuse_file_lock (struct fuse_file_lock *fl, struct flock *flock);
+void convert_fuse_file_lock (struct fuse_file_lock *fl, struct gf_flock *flock,
+ uint64_t lk_owner);
diff --git a/contrib/fuse-lib/misc.c b/contrib/fuse-lib/misc.c
index 877c3880d..28a9284bf 100644
--- a/contrib/fuse-lib/misc.c
+++ b/contrib/fuse-lib/misc.c
@@ -10,6 +10,7 @@
#include <string.h>
#include <limits.h>
#include <fcntl.h>
+#include "glusterfs.h"
#include "fuse_kernel.h"
#include "fuse-misc.h"
@@ -37,7 +38,8 @@ calc_timeout_nsec (double t)
}
void
-convert_fuse_file_lock (struct fuse_file_lock *fl, struct flock *flock)
+convert_fuse_file_lock (struct fuse_file_lock *fl, struct gf_flock *flock,
+ uint64_t lk_owner)
{
memset (flock, 0, sizeof (struct flock));
flock->l_type = fl->type;
@@ -48,4 +50,5 @@ convert_fuse_file_lock (struct fuse_file_lock *fl, struct flock *flock)
else
flock->l_len = fl->end - fl->start + 1;
flock->l_pid = fl->pid;
+ flock->l_owner = lk_owner;
}
diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c
index 7008cfd6f..551fa99ae 100644
--- a/libglusterfs/src/call-stub.c
+++ b/libglusterfs/src/call-stub.c
@@ -1469,7 +1469,7 @@ fop_lk_stub (call_frame_t *frame,
fop_lk_t fn,
fd_t *fd,
int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
call_stub_t *stub = NULL;
@@ -1494,7 +1494,7 @@ fop_lk_cbk_stub (call_frame_t *frame,
fop_lk_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
call_stub_t *stub = NULL;
@@ -1515,7 +1515,7 @@ out:
call_stub_t *
fop_inodelk_stub (call_frame_t *frame, fop_inodelk_t fn,
- const char *volume, loc_t *loc, int32_t cmd, struct flock *lock)
+ const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock)
{
call_stub_t *stub = NULL;
@@ -1561,7 +1561,7 @@ fop_inodelk_cbk_stub (call_frame_t *frame, fop_inodelk_cbk_t fn,
call_stub_t *
fop_finodelk_stub (call_frame_t *frame, fop_finodelk_t fn,
- const char *volume, fd_t *fd, int32_t cmd, struct flock *lock)
+ const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
call_stub_t *stub = NULL;
diff --git a/libglusterfs/src/call-stub.h b/libglusterfs/src/call-stub.h
index 83efa9a48..340468c3e 100644
--- a/libglusterfs/src/call-stub.h
+++ b/libglusterfs/src/call-stub.h
@@ -416,12 +416,12 @@ typedef struct {
fop_lk_t fn;
fd_t *fd;
int32_t cmd;
- struct flock lock;
+ struct gf_flock lock;
} lk;
struct {
fop_lk_cbk_t fn;
int32_t op_ret, op_errno;
- struct flock lock;
+ struct gf_flock lock;
} lk_cbk;
/* inodelk */
@@ -430,7 +430,7 @@ typedef struct {
const char *volume;
loc_t loc;
int32_t cmd;
- struct flock lock;
+ struct gf_flock lock;
} inodelk;
struct {
@@ -444,7 +444,7 @@ typedef struct {
const char *volume;
fd_t *fd;
int32_t cmd;
- struct flock lock;
+ struct gf_flock lock;
} finodelk;
struct {
@@ -968,24 +968,24 @@ fop_lk_stub (call_frame_t *frame,
fop_lk_t fn,
fd_t *fd,
int32_t cmd,
- struct flock *lock);
+ struct gf_flock *lock);
call_stub_t *
fop_lk_cbk_stub (call_frame_t *frame,
fop_lk_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock);
+ struct gf_flock *lock);
call_stub_t *
fop_inodelk_stub (call_frame_t *frame, fop_inodelk_t fn,
const char *volume, loc_t *loc, int32_t cmd,
- struct flock *lock);
+ struct gf_flock *lock);
call_stub_t *
fop_finodelk_stub (call_frame_t *frame, fop_finodelk_t fn,
const char *volume, fd_t *fd, int32_t cmd,
- struct flock *lock);
+ struct gf_flock *lock);
call_stub_t *
fop_entrylk_stub (call_frame_t *frame, fop_entrylk_t fn,
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 75476a029..f2db89c33 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -1392,7 +1392,7 @@ gf_string2boolean (const char *str, gf_boolean_t *b)
int
gf_lockfd (int fd)
{
- struct flock fl;
+ struct gf_flock fl;
fl.l_type = F_WRLCK;
fl.l_whence = SEEK_SET;
@@ -1406,7 +1406,7 @@ gf_lockfd (int fd)
int
gf_unlockfd (int fd)
{
- struct flock fl;
+ struct gf_flock fl;
fl.l_type = F_UNLCK;
fl.l_whence = SEEK_SET;
diff --git a/libglusterfs/src/defaults.c b/libglusterfs/src/defaults.c
index d51cc8cca..3e271dde4 100644
--- a/libglusterfs/src/defaults.c
+++ b/libglusterfs/src/defaults.c
@@ -329,7 +329,7 @@ default_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t
default_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
STACK_UNWIND_STRICT (lk, frame, op_ret, op_errno, lock);
return 0;
@@ -675,7 +675,7 @@ default_removexattr_resume (call_frame_t *frame, xlator_t *this, loc_t *loc,
int32_t
default_lk_resume (call_frame_t *frame, xlator_t *this, fd_t *fd,
- int32_t cmd, struct flock *lock)
+ int32_t cmd, struct gf_flock *lock)
{
STACK_WIND (frame, default_lk_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lk, fd, cmd, lock);
@@ -686,7 +686,7 @@ default_lk_resume (call_frame_t *frame, xlator_t *this, fd_t *fd,
int32_t
default_inodelk_resume (call_frame_t *frame, xlator_t *this,
const char *volume, loc_t *loc, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
STACK_WIND (frame, default_inodelk_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->inodelk,
@@ -697,7 +697,7 @@ default_inodelk_resume (call_frame_t *frame, xlator_t *this,
int32_t
default_finodelk_resume (call_frame_t *frame, xlator_t *this,
const char *volume, fd_t *fd, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
STACK_WIND (frame, default_finodelk_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->finodelk,
@@ -1043,7 +1043,7 @@ default_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
int32_t
default_lk (call_frame_t *frame, xlator_t *this, fd_t *fd,
- int32_t cmd, struct flock *lock)
+ int32_t cmd, struct gf_flock *lock)
{
STACK_WIND (frame, default_lk_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lk, fd, cmd, lock);
@@ -1054,7 +1054,7 @@ default_lk (call_frame_t *frame, xlator_t *this, fd_t *fd,
int32_t
default_inodelk (call_frame_t *frame, xlator_t *this,
const char *volume, loc_t *loc, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
STACK_WIND (frame, default_inodelk_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->inodelk,
@@ -1064,7 +1064,7 @@ default_inodelk (call_frame_t *frame, xlator_t *this,
int32_t
default_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd, struct flock *lock)
+ const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
STACK_WIND (frame, default_finodelk_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->finodelk,
diff --git a/libglusterfs/src/defaults.h b/libglusterfs/src/defaults.h
index 7ddb10061..f02358210 100644
--- a/libglusterfs/src/defaults.h
+++ b/libglusterfs/src/defaults.h
@@ -181,15 +181,15 @@ int32_t default_lk (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
int32_t cmd,
- struct flock *flock);
+ struct gf_flock *flock);
int32_t default_inodelk (call_frame_t *frame, xlator_t *this,
const char *volume, loc_t *loc, int32_t cmd,
- struct flock *flock);
+ struct gf_flock *flock);
int32_t default_finodelk (call_frame_t *frame, xlator_t *this,
const char *volume, fd_t *fd, int32_t cmd,
- struct flock *flock);
+ struct gf_flock *flock);
int32_t default_entrylk (call_frame_t *frame, xlator_t *this,
const char *volume, loc_t *loc, const char *basename,
@@ -396,15 +396,15 @@ int32_t default_lk_resume (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
int32_t cmd,
- struct flock *flock);
+ struct gf_flock *flock);
int32_t default_inodelk_resume (call_frame_t *frame, xlator_t *this,
const char *volume, loc_t *loc, int32_t cmd,
- struct flock *flock);
+ struct gf_flock *flock);
int32_t default_finodelk_resume (call_frame_t *frame, xlator_t *this,
const char *volume, fd_t *fd, int32_t cmd,
- struct flock *flock);
+ struct gf_flock *flock);
int32_t default_entrylk_resume (call_frame_t *frame, xlator_t *this,
const char *volume, loc_t *loc, const char *basename,
@@ -627,7 +627,7 @@ default_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t
default_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock);
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock);
int32_t
default_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 2bb06fbb7..9e66c3044 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -144,6 +144,14 @@ typedef enum {
GF_OP_TYPE_MAX,
} gf_op_type_t;
+struct gf_flock {
+ short l_type;
+ short l_whence;
+ off_t l_start;
+ off_t l_len;
+ pid_t l_pid;
+ uint64_t l_owner;
+};
/* NOTE: all the miscellaneous flags used by GlusterFS should be listed here */
typedef enum {
diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h
index 84ad990d4..618cf2025 100644
--- a/libglusterfs/src/xlator.h
+++ b/libglusterfs/src/xlator.h
@@ -339,7 +339,7 @@ typedef int32_t (*fop_lk_cbk_t) (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *flock);
+ struct gf_flock *flock);
typedef int32_t (*fop_inodelk_cbk_t) (call_frame_t *frame,
void *cookie,
@@ -560,21 +560,21 @@ typedef int32_t (*fop_lk_t) (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
int32_t cmd,
- struct flock *flock);
+ struct gf_flock *flock);
typedef int32_t (*fop_inodelk_t) (call_frame_t *frame,
xlator_t *this,
const char *volume,
loc_t *loc,
int32_t cmd,
- struct flock *flock);
+ struct gf_flock *flock);
typedef int32_t (*fop_finodelk_t) (call_frame_t *frame,
xlator_t *this,
const char *volume,
fd_t *fd,
int32_t cmd,
- struct flock *flock);
+ struct gf_flock *flock);
typedef int32_t (*fop_entrylk_t) (call_frame_t *frame,
xlator_t *this,
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<>;
} ;
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index e5a7e87c7..ee5fa3a60 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -1871,7 +1871,7 @@ afr_inodelk_cbk (call_frame_t *frame, void *cookie,
int32_t
afr_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd, struct flock *flock)
+ const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *flock)
{
afr_private_t *priv = NULL;
afr_local_t *local = NULL;
@@ -1953,7 +1953,7 @@ afr_finodelk_cbk (call_frame_t *frame, void *cookie,
int32_t
afr_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd, struct flock *flock)
+ const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *flock)
{
afr_private_t *priv = NULL;
afr_local_t *local = NULL;
@@ -2264,7 +2264,7 @@ out:
int32_t
afr_lk_unlock_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
afr_local_t * local = NULL;
@@ -2325,7 +2325,7 @@ afr_lk_unlock (call_frame_t *frame, xlator_t *this)
int32_t
afr_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
afr_local_t *local = NULL;
afr_private_t *priv = NULL;
@@ -2391,7 +2391,7 @@ afr_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
afr_lk (call_frame_t *frame, xlator_t *this,
fd_t *fd, int32_t cmd,
- struct flock *flock)
+ struct gf_flock *flock)
{
afr_private_t *priv = NULL;
afr_local_t *local = NULL;
diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c
index 12050af1d..06f355974 100644
--- a/xlators/cluster/afr/src/afr-lk-common.c
+++ b/xlators/cluster/afr/src/afr-lk-common.c
@@ -120,7 +120,7 @@ internal_lock_count (call_frame_t *frame, xlator_t *this,
static void
afr_print_inodelk (char *str, int size, int cmd,
- struct flock *flock, uint64_t owner)
+ struct gf_flock *flock, uint64_t owner)
{
char *cmd_str = NULL;
char *type_str = NULL;
@@ -247,7 +247,7 @@ afr_set_lock_call_type (afr_lock_call_type_t lock_call_type,
static void
afr_trace_inodelk_out (call_frame_t *frame, afr_lock_call_type_t lock_call_type,
- afr_lock_op_type_t lk_op_type, struct flock *flock,
+ afr_lock_op_type_t lk_op_type, struct gf_flock *flock,
int op_ret, int op_errno, int32_t child_index)
{
xlator_t *this = NULL;
@@ -286,7 +286,7 @@ afr_trace_inodelk_out (call_frame_t *frame, afr_lock_call_type_t lock_call_type,
static void
afr_trace_inodelk_in (call_frame_t *frame, afr_lock_call_type_t lock_call_type,
- afr_lock_op_type_t lk_op_type, struct flock *flock,
+ afr_lock_op_type_t lk_op_type, struct gf_flock *flock,
int32_t cmd, int32_t child_index)
{
xlator_t *this = NULL;
@@ -578,7 +578,7 @@ afr_unlock_inodelk (call_frame_t *frame, xlator_t *this)
afr_local_t *local = NULL;
afr_private_t *priv = NULL;
- struct flock flock;
+ struct gf_flock flock;
int call_count = 0;
int i = 0;
@@ -908,7 +908,7 @@ afr_lock_blocking (call_frame_t *frame, xlator_t *this, int child_index)
const char *lower_name = NULL;
const char *higher_name = NULL;
- struct flock flock;
+ struct gf_flock flock;
uint64_t ctx;
int ret = 0;
@@ -1360,7 +1360,7 @@ afr_nonblocking_inodelk (call_frame_t *frame, xlator_t *this)
uint64_t ctx = 0;
int i = 0;
int ret = 0;
- struct flock flock;
+ struct gf_flock flock;
local = frame->local;
int_lock = &local->internal_lock;
@@ -1836,15 +1836,15 @@ out:
int32_t
afr_get_locks_fd_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock);
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock);
int32_t
afr_recover_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
afr_local_t *local = NULL;
afr_private_t *priv = NULL;
int32_t source_child = 0;
- struct flock flock = {0,};
+ struct gf_flock flock = {0,};
if (op_ret) {
gf_log (this->name, GF_LOG_DEBUG,
@@ -1871,7 +1871,7 @@ cleanup:
int
afr_recover_lock (call_frame_t *frame, xlator_t *this,
- struct flock *flock)
+ struct gf_flock *flock)
{
afr_local_t *local = NULL;
afr_private_t *priv = NULL;
@@ -1892,7 +1892,7 @@ afr_recover_lock (call_frame_t *frame, xlator_t *this,
}
static int
-is_afr_lock_eol (struct flock *lock)
+is_afr_lock_eol (struct gf_flock *lock)
{
int ret = 0;
@@ -1904,7 +1904,7 @@ is_afr_lock_eol (struct flock *lock)
int32_t
afr_get_locks_fd_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
if (op_ret) {
gf_log (this->name, GF_LOG_DEBUG,
@@ -1939,7 +1939,7 @@ afr_lock_recovery (call_frame_t *frame, xlator_t *this)
fd_t *fd = NULL;
int ret = 0;
int32_t source_child = 0;
- struct flock flock = {0,};
+ struct gf_flock flock = {0,};
priv = this->private;
local = frame->local;
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 005847b41..ed50fdfbf 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -235,7 +235,7 @@ afr_index_for_transaction_type (afr_transaction_type type)
typedef struct {
loc_t *lk_loc;
- struct flock lk_flock;
+ struct gf_flock lk_flock;
const char *lk_basename;
const char *lower_basename;
@@ -347,8 +347,8 @@ typedef struct _afr_local {
struct {
int32_t cmd;
- struct flock user_flock;
- struct flock ret_flock;
+ struct gf_flock user_flock;
+ struct gf_flock ret_flock;
unsigned char *locked_nodes;
} lk;
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 2c8a53547..0a39084a1 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2350,7 +2350,7 @@ err:
int
dht_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, struct flock *flock)
+ int op_ret, int op_errno, struct gf_flock *flock)
{
DHT_STACK_UNWIND (lk, frame, op_ret, op_errno, flock);
@@ -2360,7 +2360,7 @@ dht_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
dht_lk (call_frame_t *frame, xlator_t *this,
- fd_t *fd, int cmd, struct flock *flock)
+ fd_t *fd, int cmd, struct gf_flock *flock)
{
xlator_t *subvol = NULL;
int op_errno = -1;
@@ -4287,7 +4287,7 @@ dht_inodelk_cbk (call_frame_t *frame, void *cookie,
int32_t
dht_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd, struct flock *lock)
+ const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock)
{
xlator_t *subvol = NULL;
int op_errno = -1;
@@ -4346,7 +4346,7 @@ dht_finodelk_cbk (call_frame_t *frame, void *cookie,
int
dht_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd, struct flock *lock)
+ const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
xlator_t *subvol = NULL;
int op_errno = -1;
diff --git a/xlators/cluster/ha/src/ha.c b/xlators/cluster/ha/src/ha.c
index 54b41858e..a8dd5c724 100644
--- a/xlators/cluster/ha/src/ha.c
+++ b/xlators/cluster/ha/src/ha.c
@@ -3066,7 +3066,7 @@ ha_lk_setlk_unlck_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
ha_local_t *local = NULL;
int cnt = 0;
@@ -3099,7 +3099,7 @@ ha_lk_setlk_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
ha_local_t *local = NULL;
ha_private_t *pvt = NULL;
@@ -3155,7 +3155,7 @@ ha_lk_setlk_cbk (call_frame_t *frame,
cnt++;
}
if (cnt) {
- struct flock lock;
+ struct gf_flock lock;
lock = local->stub->args.lk.lock;
for (i = 0; i < child_count; i++) {
if (state[i]) {
@@ -3189,7 +3189,7 @@ ha_lk_getlk_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
ha_local_t *local = NULL;
ha_private_t *pvt = NULL;
@@ -3244,7 +3244,7 @@ ha_lk (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
ha_local_t *local = NULL;
ha_private_t *pvt = NULL;
@@ -3378,7 +3378,7 @@ ha_inodelk (call_frame_t *frame,
const char *volume,
loc_t *loc,
int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
ha_local_t *local = NULL;
int op_errno = 0;
diff --git a/xlators/cluster/map/src/map.c b/xlators/cluster/map/src/map.c
index dd89d0ebe..df650db86 100644
--- a/xlators/cluster/map/src/map.c
+++ b/xlators/cluster/map/src/map.c
@@ -438,7 +438,7 @@ map_lk_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
STACK_UNWIND (frame, op_ret, op_errno, lock);
return 0;
@@ -1770,7 +1770,7 @@ map_lk (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
int32_t op_errno = 1;
xlator_t *subvol = NULL;
@@ -1799,7 +1799,7 @@ map_lk (call_frame_t *frame,
int32_t
map_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd, struct flock *lock)
+ const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock)
{
int32_t op_errno = 1;
xlator_t *subvol = NULL;
@@ -1829,7 +1829,7 @@ map_inodelk (call_frame_t *frame, xlator_t *this,
int32_t
map_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd, struct flock *lock)
+ const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
int32_t op_errno = 1;
xlator_t *subvol = NULL;
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 00c888f68..72c7b4515 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -2566,7 +2566,7 @@ err:
int32_t
stripe_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
int32_t callcnt = 0;
stripe_local_t *local = NULL;
@@ -2614,7 +2614,7 @@ out:
int32_t
stripe_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
stripe_local_t *local = NULL;
xlator_list_t *trav = NULL;
diff --git a/xlators/cluster/stripe/src/stripe.h b/xlators/cluster/stripe/src/stripe.h
index 8afc6aa9a..a17912908 100644
--- a/xlators/cluster/stripe/src/stripe.h
+++ b/xlators/cluster/stripe/src/stripe.h
@@ -147,7 +147,7 @@ struct stripe_local {
int entry_self_heal_needed;
int8_t *list;
- struct flock lock;
+ struct gf_flock lock;
fd_t *fd;
void *value;
struct iobref *iobref;
diff --git a/xlators/cluster/unify/src/unify.c b/xlators/cluster/unify/src/unify.c
index e50d3274f..c307de6f4 100644
--- a/xlators/cluster/unify/src/unify.c
+++ b/xlators/cluster/unify/src/unify.c
@@ -2644,7 +2644,7 @@ unify_lk_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
STACK_UNWIND (frame, op_ret, op_errno, lock);
return 0;
@@ -2658,7 +2658,7 @@ unify_lk (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
UNIFY_CHECK_FD_CTX_AND_UNWIND_ON_ERR (fd);
xlator_t *child = NULL;
@@ -3999,7 +3999,7 @@ unify_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
*/
int
unify_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int cmd, struct flock *flock)
+ const char *volume, fd_t *fd, int cmd, struct gf_flock *flock)
{
UNIFY_CHECK_FD_CTX_AND_UNWIND_ON_ERR (fd);
xlator_t *child = NULL;
@@ -4103,7 +4103,7 @@ unify_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
*/
int
unify_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int cmd, struct flock *flock)
+ const char *volume, loc_t *loc, int cmd, struct gf_flock *flock)
{
xlator_t *child = NULL;
diff --git a/xlators/debug/error-gen/src/error-gen.c b/xlators/debug/error-gen/src/error-gen.c
index 095b077b4..b9ed44b21 100644
--- a/xlators/debug/error-gen/src/error-gen.c
+++ b/xlators/debug/error-gen/src/error-gen.c
@@ -1526,7 +1526,7 @@ error_gen_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
int
error_gen_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
STACK_UNWIND_STRICT (lk, frame, op_ret, op_errno, lock);
return 0;
@@ -1535,7 +1535,7 @@ error_gen_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
error_gen_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
int op_errno = 0;
eg_t *egp = NULL;
@@ -1574,7 +1574,7 @@ error_gen_inodelk_cbk (call_frame_t *frame, void *cookie,
int
error_gen_inodelk (call_frame_t *frame, xlator_t *this,
const char *volume, loc_t *loc, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
int op_errno = 0;
eg_t *egp = NULL;
@@ -1613,7 +1613,7 @@ error_gen_finodelk_cbk (call_frame_t *frame, void *cookie,
int
error_gen_finodelk (call_frame_t *frame, xlator_t *this,
const char *volume, fd_t *fd, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
int op_errno = 0;
eg_t *egp = NULL;
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index dcdd42645..4a96ca3c2 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -797,7 +797,7 @@ io_stats_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
io_stats_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
END_FOP_LATENCY (frame, LK);
STACK_UNWIND_STRICT (lk, frame, op_ret, op_errno, lock);
@@ -864,7 +864,7 @@ io_stats_entrylk (call_frame_t *frame, xlator_t *this,
int
io_stats_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd, struct flock *flock)
+ const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *flock)
{
BUMP_FOP (INODELK);
@@ -892,7 +892,7 @@ io_stats_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
io_stats_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd, struct flock *flock)
+ const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *flock)
{
BUMP_FOP (FINODELK);
@@ -1489,7 +1489,7 @@ io_stats_fstat (call_frame_t *frame, xlator_t *this,
int
io_stats_lk (call_frame_t *frame, xlator_t *this,
- fd_t *fd, int32_t cmd, struct flock *lock)
+ fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
BUMP_FOP (LK);
diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c
index f5af77681..43e9c7a7a 100644
--- a/xlators/debug/trace/src/trace.c
+++ b/xlators/debug/trace/src/trace.c
@@ -1121,7 +1121,7 @@ trace_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
trace_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
if (trace_fop_names[GF_FOP_LK].enabled) {
if (op_ret >= 0) {
@@ -1226,7 +1226,7 @@ trace_entrylk (call_frame_t *frame, xlator_t *this,
int
trace_inodelk (call_frame_t *frame, xlator_t *this, const char *volume,
- loc_t *loc, int32_t cmd, struct flock *flock)
+ loc_t *loc, int32_t cmd, struct gf_flock *flock)
{
if (trace_fop_names[GF_FOP_INODELK].enabled) {
gf_log (this->name, GF_LOG_NORMAL,
@@ -1260,7 +1260,7 @@ trace_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
trace_finodelk (call_frame_t *frame, xlator_t *this, const char *volume,
- fd_t *fd, int32_t cmd, struct flock *flock)
+ fd_t *fd, int32_t cmd, struct gf_flock *flock)
{
if (trace_fop_names[GF_FOP_FINODELK].enabled) {
gf_log (this->name, GF_LOG_NORMAL,
@@ -1938,7 +1938,7 @@ trace_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd)
int
trace_lk (call_frame_t *frame, xlator_t *this, fd_t *fd,
- int32_t cmd, struct flock *lock)
+ int32_t cmd, struct gf_flock *lock)
{
if (trace_fop_names[GF_FOP_LK].enabled) {
gf_log (this->name, GF_LOG_NORMAL,
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c
index 9f2d11304..0df5fcae5 100644
--- a/xlators/features/locks/src/common.c
+++ b/xlators/features/locks/src/common.c
@@ -176,7 +176,7 @@ pl_print_lockee (char *str, int size, fd_t *fd, loc_t *loc)
void
pl_print_lock (char *str, int size, int cmd,
- struct flock *flock, uint64_t owner)
+ struct gf_flock *flock, uint64_t owner)
{
char *cmd_str = NULL;
char *type_str = NULL;
@@ -234,7 +234,7 @@ pl_print_lock (char *str, int size, int cmd,
void
pl_trace_in (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct flock *flock, const char *domain)
+ int cmd, struct gf_flock *flock, const char *domain)
{
posix_locks_private_t *priv = NULL;
char pl_locker[256];
@@ -282,7 +282,7 @@ pl_print_verdict (char *str, int size, int op_ret, int op_errno)
void
pl_trace_out (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct flock *flock, int op_ret, int op_errno, const char *domain)
+ int cmd, struct gf_flock *flock, int op_ret, int op_errno, const char *domain)
{
posix_locks_private_t *priv = NULL;
@@ -313,7 +313,7 @@ pl_trace_out (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
void
pl_trace_block (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct flock *flock, const char *domain)
+ int cmd, struct gf_flock *flock, const char *domain)
{
posix_locks_private_t *priv = NULL;
@@ -460,7 +460,7 @@ out:
/* Create a new posix_lock_t */
posix_lock_t *
-new_posix_lock (struct flock *flock, void *transport, pid_t client_pid,
+new_posix_lock (struct gf_flock *flock, void *transport, pid_t client_pid,
uint64_t owner, fd_t *fd)
{
posix_lock_t *lock = NULL;
@@ -506,9 +506,9 @@ __destroy_lock (posix_lock_t *lock)
}
-/* Convert a posix_lock to a struct flock */
+/* Convert a posix_lock to a struct gf_flock */
void
-posix_lock_to_flock (posix_lock_t *lock, struct flock *flock)
+posix_lock_to_flock (posix_lock_t *lock, struct gf_flock *flock)
{
flock->l_pid = lock->client_pid;
flock->l_type = lock->fl_type;
diff --git a/xlators/features/locks/src/common.h b/xlators/features/locks/src/common.h
index c7d817f8d..72b113310 100644
--- a/xlators/features/locks/src/common.h
+++ b/xlators/features/locks/src/common.h
@@ -21,7 +21,7 @@
#define __COMMON_H__
posix_lock_t *
-new_posix_lock (struct flock *flock, void *transport, pid_t client_pid,
+new_posix_lock (struct gf_flock *flock, void *transport, pid_t client_pid,
uint64_t owner, fd_t *fd);
pl_inode_t *
@@ -38,7 +38,7 @@ void
grant_blocked_locks (xlator_t *this, pl_inode_t *inode);
void
-posix_lock_to_flock (posix_lock_t *lock, struct flock *flock);
+posix_lock_to_flock (posix_lock_t *lock, struct gf_flock *flock);
int
locks_overlap (posix_lock_t *l1, posix_lock_t *l2);
@@ -75,13 +75,13 @@ int32_t
get_entrylk_count (xlator_t *this, inode_t *inode);
void pl_trace_in (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct flock *flock, const char *domain);
+ int cmd, struct gf_flock *flock, const char *domain);
void pl_trace_out (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct flock *flock, int op_ret, int op_errno, const char *domain);
+ int cmd, struct gf_flock *flock, int op_ret, int op_errno, const char *domain);
void pl_trace_block (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct flock *flock, const char *domain);
+ int cmd, struct gf_flock *flock, const char *domain);
void pl_trace_flush (xlator_t *this, call_frame_t *frame, fd_t *fd);
@@ -108,7 +108,7 @@ void
pl_print_locker (char *str, int size, xlator_t *this, call_frame_t *frame);
void
-pl_print_inodelk (char *str, int size, int cmd, struct flock *flock, const char *domain);
+pl_print_inodelk (char *str, int size, int cmd, struct gf_flock *flock, const char *domain);
void
pl_trace_release (xlator_t *this, fd_t *fd);
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
index eaae8d4de..f0985c8ce 100644
--- a/xlators/features/locks/src/inodelk.c
+++ b/xlators/features/locks/src/inodelk.c
@@ -56,7 +56,7 @@ inodelk_type_conflict (pl_inode_lock_t *l1, pl_inode_lock_t *l2)
}
void
-pl_print_inodelk (char *str, int size, int cmd, struct flock *flock, const char *domain)
+pl_print_inodelk (char *str, int size, int cmd, struct gf_flock *flock, const char *domain)
{
char *cmd_str = NULL;
char *type_str = NULL;
@@ -505,7 +505,7 @@ out:
/* Create a new inode_lock_t */
pl_inode_lock_t *
-new_inode_lock (struct flock *flock, void *transport, pid_t client_pid,
+new_inode_lock (struct gf_flock *flock, void *transport, pid_t client_pid,
uint64_t owner, const char *volume)
{
@@ -540,7 +540,7 @@ new_inode_lock (struct flock *flock, void *transport, pid_t client_pid,
int
pl_common_inodelk (call_frame_t *frame, xlator_t *this,
const char *volume, inode_t *inode, int32_t cmd,
- struct flock *flock, loc_t *loc, fd_t *fd)
+ struct gf_flock *flock, loc_t *loc, fd_t *fd)
{
int32_t op_ret = -1;
int32_t op_errno = 0;
@@ -612,7 +612,7 @@ pl_common_inodelk (call_frame_t *frame, xlator_t *this,
/* fall through */
case F_SETLK:
- memcpy (&reqlock->user_flock, flock, sizeof (struct flock));
+ memcpy (&reqlock->user_flock, flock, sizeof (struct gf_flock));
ret = pl_inode_setlk (this, pinode, reqlock,
can_block, dom);
@@ -653,7 +653,7 @@ out:
int
pl_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd, struct flock *flock)
+ const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *flock)
{
pl_common_inodelk (frame, this, volume, loc->inode, cmd, flock, loc, NULL);
@@ -663,7 +663,7 @@ pl_inodelk (call_frame_t *frame, xlator_t *this,
int
pl_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd, struct flock *flock)
+ const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *flock)
{
pl_common_inodelk (frame, this, volume, fd->inode, cmd, flock, NULL, fd);
diff --git a/xlators/features/locks/src/locks.h b/xlators/features/locks/src/locks.h
index 483e3e666..83683c352 100644
--- a/xlators/features/locks/src/locks.h
+++ b/xlators/features/locks/src/locks.h
@@ -40,7 +40,7 @@ struct __posix_lock {
off_t fl_end;
short blocked; /* waiting to acquire */
- struct flock user_flock; /* the flock supplied by the user */
+ struct gf_flock user_flock; /* the flock supplied by the user */
xlator_t *this; /* required for blocked locks */
unsigned long fd_num;
@@ -65,7 +65,7 @@ struct __pl_inode_lock {
const char *volume;
- struct flock user_flock; /* the flock supplied by the user */
+ struct gf_flock user_flock; /* the flock supplied by the user */
xlator_t *this; /* required for blocked locks */
fd_t *fd;
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index 7c8ead8b3..1b3a1a604 100644
--- a/xlators/features/locks/src/posix.c
+++ b/xlators/features/locks/src/posix.c
@@ -932,7 +932,7 @@ unlock:
int
pl_lk (call_frame_t *frame, xlator_t *this,
- fd_t *fd, int32_t cmd, struct flock *flock)
+ fd_t *fd, int32_t cmd, struct gf_flock *flock)
{
void *transport = NULL;
pid_t client_pid = 0;
@@ -984,7 +984,7 @@ pl_lk (call_frame_t *frame, xlator_t *this,
/* fall through */
case F_RESLK_LCK:
- memcpy (&reqlock->user_flock, flock, sizeof (struct flock));
+ memcpy (&reqlock->user_flock, flock, sizeof (struct gf_flock));
reqlock->frame = frame;
reqlock->this = this;
@@ -1065,7 +1065,7 @@ pl_lk (call_frame_t *frame, xlator_t *this,
case F_SETLK64:
#endif
case F_SETLK:
- memcpy (&reqlock->user_flock, flock, sizeof (struct flock));
+ memcpy (&reqlock->user_flock, flock, sizeof (struct gf_flock));
ret = pl_verify_reservelk (this, pl_inode, reqlock, can_block);
if (ret < 0) {
gf_log (this->name, GF_LOG_TRACE,
@@ -1439,7 +1439,7 @@ out:
}
void
-pl_dump_lock (char *str, int size, struct flock *flock,
+pl_dump_lock (char *str, int size, struct gf_flock *flock,
uint64_t owner, void *trans)
{
char *type_str = NULL;
@@ -1794,11 +1794,11 @@ fini (xlator_t *this)
int
pl_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd, struct flock *flock);
+ const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *flock);
int
pl_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd, struct flock *flock);
+ const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *flock);
int
pl_entrylk (call_frame_t *frame, xlator_t *this,
diff --git a/xlators/features/path-convertor/src/path.c b/xlators/features/path-convertor/src/path.c
index 0a86baa87..bf871c1fe 100644
--- a/xlators/features/path-convertor/src/path.c
+++ b/xlators/features/path-convertor/src/path.c
@@ -1057,7 +1057,7 @@ path_entrylk (call_frame_t *frame, xlator_t *this,
int32_t
path_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd, struct flock *lock)
+ const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock)
{
char *loc_path = (char *)loc->path;
char *tmp_path = NULL;
diff --git a/xlators/features/quiesce/src/quiesce.c b/xlators/features/quiesce/src/quiesce.c
index 8d062cb51..168e32373 100644
--- a/xlators/features/quiesce/src/quiesce.c
+++ b/xlators/features/quiesce/src/quiesce.c
@@ -987,7 +987,7 @@ quiesce_lk (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
quiesce_priv_t *priv = NULL;
call_stub_t *stub = NULL;
@@ -1020,7 +1020,7 @@ quiesce_lk (call_frame_t *frame,
int32_t
quiesce_inodelk (call_frame_t *frame, xlator_t *this,
const char *volume, loc_t *loc, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
quiesce_priv_t *priv = NULL;
call_stub_t *stub = NULL;
@@ -1050,7 +1050,7 @@ quiesce_inodelk (call_frame_t *frame, xlator_t *this,
int32_t
quiesce_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd, struct flock *lock)
+ const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
quiesce_priv_t *priv = NULL;
call_stub_t *stub = NULL;
diff --git a/xlators/features/read-only/src/read-only.c b/xlators/features/read-only/src/read-only.c
index 49c2ce58d..8c71f0a0d 100644
--- a/xlators/features/read-only/src/read-only.c
+++ b/xlators/features/read-only/src/read-only.c
@@ -60,7 +60,7 @@ ro_fentrylk (call_frame_t *frame, xlator_t *this, const char *volume,
int32_t
ro_inodelk (call_frame_t *frame, xlator_t *this, const char *volume,
- loc_t *loc, int32_t cmd, struct flock *lock)
+ loc_t *loc, int32_t cmd, struct gf_flock *lock)
{
STACK_UNWIND_STRICT (inodelk, frame, -1, EROFS);
return 0;
@@ -68,7 +68,7 @@ ro_inodelk (call_frame_t *frame, xlator_t *this, const char *volume,
int32_t
ro_finodelk (call_frame_t *frame, xlator_t *this, const char *volume,
- fd_t *fd, int32_t cmd, struct flock *lock)
+ fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
STACK_UNWIND_STRICT (finodelk, frame, -1, EROFS);
return 0;
@@ -76,7 +76,7 @@ ro_finodelk (call_frame_t *frame, xlator_t *this, const char *volume,
int32_t
ro_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int cmd,
- struct flock *flock)
+ struct gf_flock *flock)
{
STACK_UNWIND_STRICT (lk, frame, -1, EROFS, NULL);
return 0;
diff --git a/xlators/meta/src/meta.c b/xlators/meta/src/meta.c
index face2fe70..19e422785 100644
--- a/xlators/meta/src/meta.c
+++ b/xlators/meta/src/meta.c
@@ -1136,7 +1136,7 @@ meta_lk_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
STACK_UNWIND (frame,
op_ret,
@@ -1150,7 +1150,7 @@ meta_lk (call_frame_t *frame,
xlator_t *this,
dict_t *file,
int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
STACK_WIND (frame,
meta_lk_cbk,
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 5d5eb63c7..b6497b15e 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -2645,7 +2645,7 @@ static int gf_fuse_lk_enosys_log;
static int
fuse_getlk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
fuse_state_t *state = NULL;
@@ -2710,7 +2710,8 @@ fuse_getlk (xlator_t *this, fuse_in_header_t *finh, void *msg)
fd = FH_TO_FD (fli->fh);
GET_STATE (this, finh, state);
state->fd = fd;
- convert_fuse_file_lock (&fli->lk, &state->lk_lock);
+ convert_fuse_file_lock (&fli->lk, &state->lk_lock,
+ fli->owner);
state->lk_owner = fli->owner;
@@ -2722,7 +2723,7 @@ fuse_getlk (xlator_t *this, fuse_in_header_t *finh, void *msg)
static int
fuse_setlk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
fuse_state_t *state = NULL;
@@ -2790,7 +2791,8 @@ fuse_setlk (xlator_t *this, fuse_in_header_t *finh, void *msg)
GET_STATE (this, finh, state);
state->finh = finh;
state->fd = fd;
- convert_fuse_file_lock (&fli->lk, &state->lk_lock);
+ convert_fuse_file_lock (&fli->lk, &state->lk_lock,
+ fli->owner);
state->lk_owner = fli->owner;
diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h
index 53a2cc598..d719832e3 100644
--- a/xlators/mount/fuse/src/fuse-bridge.h
+++ b/xlators/mount/fuse/src/fuse-bridge.h
@@ -265,7 +265,7 @@ typedef struct {
dev_t rdev;
mode_t mode;
struct iatt attr;
- struct flock lk_lock;
+ struct gf_flock lk_lock;
struct iovec vector;
uuid_t gfid;
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index 7de7640de..f64d06816 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -1323,7 +1323,7 @@ ioc_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset)
int32_t
ioc_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
- int32_t op_errno, struct flock *lock)
+ int32_t op_errno, struct gf_flock *lock)
{
STACK_UNWIND_STRICT (lk, frame, op_ret, op_errno, lock);
return 0;
@@ -1331,7 +1331,7 @@ ioc_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
int32_t
ioc_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
ioc_inode_t *ioc_inode = NULL;
uint64_t tmp_inode = 0;
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index 72fbd567f..3d072d20f 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -1000,7 +1000,7 @@ out:
int32_t
iot_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *flock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *flock)
{
STACK_UNWIND_STRICT (lk, frame, op_ret, op_errno, flock);
return 0;
@@ -1009,7 +1009,7 @@ iot_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
iot_lk_wrapper (call_frame_t *frame, xlator_t *this, fd_t *fd,
- int32_t cmd, struct flock *flock)
+ int32_t cmd, struct gf_flock *flock)
{
STACK_WIND (frame, iot_lk_cbk,
FIRST_CHILD(this),
@@ -1021,7 +1021,7 @@ iot_lk_wrapper (call_frame_t *frame, xlator_t *this, fd_t *fd,
int
iot_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
- struct flock *flock)
+ struct gf_flock *flock)
{
call_stub_t *stub = NULL;
int ret = -1;
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index 5813d961c..b5991fcde 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -1856,7 +1856,7 @@ qr_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t
qr_finodelk_helper (call_frame_t *frame, xlator_t *this, const char *volume,
- fd_t *fd, int32_t cmd, struct flock *lock)
+ fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
STACK_WIND (frame, qr_finodelk_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->finodelk, volume, fd, cmd, lock);
@@ -1866,7 +1866,7 @@ qr_finodelk_helper (call_frame_t *frame, xlator_t *this, const char *volume,
int32_t
qr_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd,
- int32_t cmd, struct flock *lock)
+ int32_t cmd, struct gf_flock *lock)
{
int flags = 0;
uint64_t value = 0;
@@ -2193,7 +2193,7 @@ out:
int32_t
qr_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
- int32_t op_errno, struct flock *lock)
+ int32_t op_errno, struct gf_flock *lock)
{
QR_STACK_UNWIND (lk, frame, op_ret, op_errno, lock);
return 0;
@@ -2202,7 +2202,7 @@ qr_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
int32_t
qr_lk_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
STACK_WIND (frame, qr_lk_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lk, fd, cmd, lock);
@@ -2213,7 +2213,7 @@ qr_lk_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
int32_t
qr_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
int flags = 0;
uint64_t value = 0;
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index 20301cffd..76ae9d209 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -3381,7 +3381,7 @@ out:
int32_t
sp_inodelk_helper (call_frame_t *frame, xlator_t *this, const char *volume,
- loc_t *loc, int32_t cmd, struct flock *lock)
+ loc_t *loc, int32_t cmd, struct gf_flock *lock)
{
uint64_t value = 0;
sp_inode_ctx_t *inode_ctx = NULL;
@@ -3423,7 +3423,7 @@ unwind:
int32_t
sp_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc,
- int32_t cmd, struct flock *lock)
+ int32_t cmd, struct gf_flock *lock)
{
int32_t op_errno = -1;
call_stub_t *stub = NULL;
diff --git a/xlators/protocol/client/src/client-lk.c b/xlators/protocol/client/src/client-lk.c
index 37cae88b7..c5696500c 100644
--- a/xlators/protocol/client/src/client-lk.c
+++ b/xlators/protocol/client/src/client-lk.c
@@ -479,7 +479,7 @@ client_cmd_to_gf_cmd (int32_t cmd, int32_t *gf_cmd)
}
static client_posix_lock_t *
-new_client_lock (struct flock *flock, uint64_t owner,
+new_client_lock (struct gf_flock *flock, uint64_t owner,
int32_t cmd, fd_t *fd)
{
client_posix_lock_t *new_lock = NULL;
@@ -497,7 +497,7 @@ new_client_lock (struct flock *flock, uint64_t owner,
INIT_LIST_HEAD (&new_lock->list);
new_lock->fd = fd;
- memcpy (&new_lock->user_flock, flock, sizeof (struct flock));
+ memcpy (&new_lock->user_flock, flock, sizeof (struct gf_flock));
new_lock->fl_type = flock->l_type;
new_lock->fl_start = flock->l_start;
@@ -526,7 +526,7 @@ client_save_number_fds (clnt_conf_t *conf, int count)
}
int
-client_add_lock_for_recovery (fd_t *fd, struct flock *flock, uint64_t owner,
+client_add_lock_for_recovery (fd_t *fd, struct gf_flock *flock, uint64_t owner,
int32_t cmd)
{
clnt_fd_ctx_t *fdctx = NULL;
@@ -568,7 +568,7 @@ out:
}
static int
-construct_reserve_unlock (struct flock *lock, call_frame_t *frame,
+construct_reserve_unlock (struct gf_flock *lock, call_frame_t *frame,
client_posix_lock_t *client_lock)
{
GF_ASSERT (lock);
@@ -588,11 +588,11 @@ construct_reserve_unlock (struct flock *lock, call_frame_t *frame,
static int
construct_reserve_lock (client_posix_lock_t *client_lock, call_frame_t *frame,
- struct flock *lock)
+ struct gf_flock *lock)
{
GF_ASSERT (client_lock);
- memcpy (lock, &(client_lock->user_flock), sizeof (struct flock));
+ memcpy (lock, &(client_lock->user_flock), sizeof (struct gf_flock));
frame->root->lk_owner = client_lock->owner;
@@ -625,7 +625,7 @@ client_remove_reserve_lock_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
clnt_local_t *local = NULL;
clnt_conf_t *conf = NULL;
@@ -665,7 +665,7 @@ static void
client_remove_reserve_lock (xlator_t *this, call_frame_t *frame,
client_posix_lock_t *lock)
{
- struct flock unlock;
+ struct gf_flock unlock;
clnt_local_t *local = NULL;
local = frame->local;
@@ -705,7 +705,7 @@ client_reserve_lock_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
clnt_local_t *local = NULL;
@@ -761,14 +761,14 @@ client_recovery_lock_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
clnt_local_t *local = NULL;
clnt_fd_ctx_t *fdctx = NULL;
clnt_conf_t *conf = NULL;
client_posix_lock_t *next_lock = NULL;
- struct flock reserve_flock;
+ struct gf_flock reserve_flock;
uint64_t fd_count = 0;
local = frame->local;
@@ -864,7 +864,7 @@ client_attempt_lock_recovery (xlator_t *this, clnt_fd_ctx_t *fdctx)
clnt_local_t *local = NULL;
client_posix_lock_t *lock = NULL;
- struct flock reserve_flock;
+ struct gf_flock reserve_flock;
int ret = 0;
local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t);
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index 84f377839..4297c628d 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -1184,7 +1184,7 @@ out:
int32_t
client_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
int ret = -1;
clnt_conf_t *conf = NULL;
@@ -1212,7 +1212,7 @@ out:
int32_t
client_inodelk (call_frame_t *frame, xlator_t *this, const char *volume,
- loc_t *loc, int32_t cmd, struct flock *lock)
+ loc_t *loc, int32_t cmd, struct gf_flock *lock)
{
int ret = -1;
clnt_conf_t *conf = NULL;
@@ -1242,7 +1242,7 @@ out:
int32_t
client_finodelk (call_frame_t *frame, xlator_t *this, const char *volume,
- fd_t *fd, int32_t cmd, struct flock *lock)
+ fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
int ret = -1;
clnt_conf_t *conf = NULL;
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
index a31873a02..1e90c5935 100644
--- a/xlators/protocol/client/src/client.h
+++ b/xlators/protocol/client/src/client.h
@@ -80,7 +80,7 @@ typedef struct _client_fd_ctx {
typedef struct _client_posix_lock {
fd_t *fd; /* The fd on which the lk operation was made */
- struct flock user_flock; /* the flock supplied by the user */
+ struct gf_flock user_flock; /* the flock supplied by the user */
off_t fl_start;
off_t fl_end;
short fl_type;
@@ -120,7 +120,7 @@ typedef struct client_args {
loc_t *oldloc;
loc_t *newloc;
const char *name;
- struct flock *flock;
+ struct gf_flock *flock;
const char *volume;
const char *basename;
off_t offset;
@@ -166,7 +166,7 @@ int clnt_readdir_rsp_cleanup (gfs3_readdir_rsp *rsp);
int clnt_readdirp_rsp_cleanup (gfs3_readdirp_rsp *rsp);
int client_attempt_lock_recovery (xlator_t *this, clnt_fd_ctx_t *fdctx);
int32_t delete_granted_locks_owner (fd_t *fd, uint64_t owner);
-int client_add_lock_for_recovery (fd_t *fd, struct flock *flock, uint64_t owner,
+int client_add_lock_for_recovery (fd_t *fd, struct gf_flock *flock, uint64_t owner,
int32_t cmd);
uint64_t decrement_reopen_fd_count (xlator_t *this, clnt_conf_t *conf);
int32_t delete_granted_locks_fd (clnt_fd_ctx_t *fdctx);
diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c
index 31cf93015..786db4c79 100644
--- a/xlators/protocol/client/src/client3_1-fops.c
+++ b/xlators/protocol/client/src/client3_1-fops.c
@@ -1526,7 +1526,7 @@ client3_1_lk_cbk (struct rpc_req *req, struct iovec *iov, int count,
{
call_frame_t *frame = NULL;
clnt_local_t *local = NULL;
- struct flock lock = {0,};
+ struct gf_flock lock = {0,};
gfs3_lk_rsp rsp = {0,};
int ret = 0;
@@ -1548,7 +1548,7 @@ client3_1_lk_cbk (struct rpc_req *req, struct iovec *iov, int count,
}
if (rsp.op_ret >= 0) {
- gf_flock_to_flock (&rsp.flock, &lock);
+ gf_proto_flock_to_flock (&rsp.flock, &lock);
}
/* Save the lock to the client lock cache to be able
@@ -4377,7 +4377,7 @@ client3_1_lk (call_frame_t *frame, xlator_t *this,
req.fd = fdctx->remote_fd;
req.cmd = gf_cmd;
req.type = gf_type;
- gf_flock_from_flock (&req.flock, args->flock);
+ gf_proto_flock_from_flock (&req.flock, args->flock);
ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_LK,
client3_1_lk_cbk, NULL, xdr_from_lk_req,
@@ -4443,7 +4443,7 @@ client3_1_inodelk (call_frame_t *frame, xlator_t *this,
req.volume = (char *)args->volume;
req.cmd = gf_cmd;
req.type = gf_type;
- gf_flock_from_flock (&req.flock, args->flock);
+ gf_proto_flock_from_flock (&req.flock, args->flock);
conf = this->private;
@@ -4533,7 +4533,7 @@ client3_1_finodelk (call_frame_t *frame, xlator_t *this,
req.fd = fdctx->remote_fd;
req.cmd = gf_cmd;
req.type = gf_type;
- gf_flock_from_flock (&req.flock, args->flock);
+ gf_proto_flock_from_flock (&req.flock, args->flock);
ret = client_submit_request (this, &req, frame, conf->fops,
GFS3_OP_FINODELK,
diff --git a/xlators/protocol/legacy/client/src/client-protocol.c b/xlators/protocol/legacy/client/src/client-protocol.c
index ebb4e6fcf..c9ef0d9e3 100644
--- a/xlators/protocol/legacy/client/src/client-protocol.c
+++ b/xlators/protocol/legacy/client/src/client-protocol.c
@@ -2815,7 +2815,7 @@ unwind:
int
client_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
- struct flock *flock)
+ struct gf_flock *flock)
{
int ret = -1;
gf_hdr_common_t *hdr = NULL;
@@ -2912,7 +2912,7 @@ unwind:
int
client_inodelk (call_frame_t *frame, xlator_t *this, const char *volume,
- loc_t *loc, int32_t cmd, struct flock *flock)
+ loc_t *loc, int32_t cmd, struct gf_flock *flock)
{
int ret = -1;
gf_hdr_common_t *hdr = NULL;
@@ -3007,7 +3007,7 @@ unwind:
int
client_finodelk (call_frame_t *frame, xlator_t *this, const char *volume,
- fd_t *fd, int32_t cmd, struct flock *flock)
+ fd_t *fd, int32_t cmd, struct gf_flock *flock)
{
int ret = -1;
gf_hdr_common_t *hdr = NULL;
@@ -5046,7 +5046,7 @@ int
client_lk_common_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
struct iobuf *iobuf)
{
- struct flock lock = {0,};
+ struct gf_flock lock = {0,};
gf_fop_lk_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
diff --git a/xlators/protocol/legacy/lib/src/protocol.h b/xlators/protocol/legacy/lib/src/protocol.h
index e929693d7..bc00450e1 100644
--- a/xlators/protocol/legacy/lib/src/protocol.h
+++ b/xlators/protocol/legacy/lib/src/protocol.h
@@ -299,7 +299,7 @@ struct gf_flock {
static inline void
-gf_flock_to_flock (struct gf_flock *gf_flock, struct flock *flock)
+gf_flock_to_flock (struct gf_flock *gf_flock, struct gf_flock *flock)
{
flock->l_type = ntoh16 (gf_flock->type);
flock->l_whence = ntoh16 (gf_flock->whence);
@@ -310,7 +310,7 @@ gf_flock_to_flock (struct gf_flock *gf_flock, struct flock *flock)
static inline void
-gf_flock_from_flock (struct gf_flock *gf_flock, struct flock *flock)
+gf_flock_from_flock (struct gf_flock *gf_flock, struct gf_flock *flock)
{
gf_flock->type = hton16 (flock->l_type);
gf_flock->whence = hton16 (flock->l_whence);
diff --git a/xlators/protocol/legacy/server/src/server-helpers.c b/xlators/protocol/legacy/server/src/server-helpers.c
index 08f89af5a..b285d90ff 100644
--- a/xlators/protocol/legacy/server/src/server-helpers.c
+++ b/xlators/protocol/legacy/server/src/server-helpers.c
@@ -162,7 +162,7 @@ do_lock_table_cleanup (xlator_t *this, server_connection_t *conn,
{
struct list_head file_lockers, dir_lockers;
call_frame_t *tmp_frame = NULL;
- struct flock flock = {0, };
+ struct gf_flock flock = {0, };
xlator_t *bound_xl = NULL;
struct _locker *locker = NULL, *tmp = NULL;
int ret = -1;
@@ -395,7 +395,7 @@ server_connection_destroy (xlator_t *this, server_connection_t *conn)
struct list_head dir_lockers;
struct _lock_table *ltable = NULL;
struct _locker *locker = NULL, *tmp = NULL;
- struct flock flock = {0,};
+ struct gf_flock flock = {0,};
fd_t *fd = NULL;
int32_t i = 0;
fdentry_t *fdentries = NULL;
diff --git a/xlators/protocol/legacy/server/src/server-protocol.c b/xlators/protocol/legacy/server/src/server-protocol.c
index b2ce4bd11..cbb9ce635 100644
--- a/xlators/protocol/legacy/server/src/server-protocol.c
+++ b/xlators/protocol/legacy/server/src/server-protocol.c
@@ -463,7 +463,7 @@ gf_del_locker (struct _lock_table *table, const char *volume,
*/
static int
server_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
gf_hdr_common_t *hdr = NULL;
gf_fop_lk_rsp_t *rsp = NULL;
diff --git a/xlators/protocol/legacy/server/src/server-protocol.h b/xlators/protocol/legacy/server/src/server-protocol.h
index 136912871..e2e1738e9 100644
--- a/xlators/protocol/legacy/server/src/server-protocol.h
+++ b/xlators/protocol/legacy/server/src/server-protocol.h
@@ -182,7 +182,7 @@ struct _server_state {
int mask;
char is_revalidate;
dict_t *dict;
- struct flock flock;
+ struct gf_flock flock;
const char *volume;
dir_entry_t *entry;
};
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 59a498971..e63bc2002 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -281,7 +281,7 @@ do_lock_table_cleanup (xlator_t *this, server_connection_t *conn,
{
struct list_head file_lockers, dir_lockers;
call_frame_t *tmp_frame = NULL;
- struct flock flock = {0, };
+ struct gf_flock flock = {0, };
xlator_t *bound_xl = NULL;
struct _locker *locker = NULL, *tmp = NULL;
int ret = -1;
@@ -518,7 +518,7 @@ server_connection_destroy (xlator_t *this, server_connection_t *conn)
struct list_head dir_lockers;
struct _lock_table *ltable = NULL;
struct _locker *locker = NULL, *tmp = NULL;
- struct flock flock = {0,};
+ struct gf_flock flock = {0,};
fd_t *fd = NULL;
int32_t i = 0;
fdentry_t *fdentries = NULL;
diff --git a/xlators/protocol/server/src/server.h b/xlators/protocol/server/src/server.h
index a86c6b318..5786ae5b5 100644
--- a/xlators/protocol/server/src/server.h
+++ b/xlators/protocol/server/src/server.h
@@ -185,7 +185,7 @@ struct _server_state {
int mask;
char is_revalidate;
dict_t *dict;
- struct flock flock;
+ struct gf_flock flock;
const char *volume;
dir_entry_t *entry;
};
diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c
index f07be9bd7..1b0c407ee 100644
--- a/xlators/protocol/server/src/server3_1-fops.c
+++ b/xlators/protocol/server/src/server3_1-fops.c
@@ -172,7 +172,7 @@ out:
int
server_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct flock *lock)
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock)
{
gfs3_lk_rsp rsp = {0,};
rpcsvc_request_t *req = NULL;
@@ -202,7 +202,7 @@ server_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
break;
}
- gf_flock_from_flock (&rsp.flock, lock);
+ gf_proto_flock_from_flock (&rsp.flock, lock);
} else if (op_errno != ENOSYS) {
gf_log (this->name, GF_LOG_TRACE,
"%"PRId64": LK %"PRId64" (%"PRId64") ==> %"PRId32" (%s)",
@@ -4314,7 +4314,7 @@ server_inodelk (rpcsvc_request_t *req)
state->type = args.type;
state->volume = gf_strdup (args.volume);
- gf_flock_to_flock (&args.flock, &state->flock);
+ gf_proto_flock_to_flock (&args.flock, &state->flock);
switch (state->type) {
case GF_LK_F_RDLCK:
@@ -4385,7 +4385,7 @@ server_finodelk (rpcsvc_request_t *req)
state->type = args.type;
- gf_flock_to_flock (&args.flock, &state->flock);
+ gf_proto_flock_to_flock (&args.flock, &state->flock);
switch (state->type) {
case GF_LK_F_RDLCK:
@@ -4820,7 +4820,7 @@ server_lk (rpcsvc_request_t *req)
break;
}
- gf_flock_to_flock (&args.flock, &state->flock);
+ gf_proto_flock_to_flock (&args.flock, &state->flock);
switch (state->type) {
case GF_LK_F_RDLCK:
diff --git a/xlators/storage/bdb/src/bdb.c b/xlators/storage/bdb/src/bdb.c
index 6104728e3..3b48fe4a4 100644
--- a/xlators/storage/bdb/src/bdb.c
+++ b/xlators/storage/bdb/src/bdb.c
@@ -713,9 +713,9 @@ bdb_lk (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
- struct flock nullock = {0, };
+ struct gf_flock nullock = {0, };
if (BDB_TIMED_LOG (ENOTSUP, gf_bdb_lk_log)) {
gf_log (this->name, GF_LOG_DEBUG,
@@ -3050,7 +3050,7 @@ out:
int32_t
bdb_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd, struct flock *lock)
+ const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock)
{
gf_log (this->name, GF_LOG_ERROR,
"glusterfs internal locking request. please load "
@@ -3064,7 +3064,7 @@ bdb_inodelk (call_frame_t *frame, xlator_t *this,
int32_t
bdb_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd, struct flock *lock)
+ const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
gf_log (this->name, GF_LOG_ERROR,
"glusterfs internal locking request. please load "
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 6399d0bc0..398c1dd7e 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -3792,9 +3792,9 @@ static int gf_posix_lk_log;
int32_t
posix_lk (call_frame_t *frame, xlator_t *this,
- fd_t *fd, int32_t cmd, struct flock *lock)
+ fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
- struct flock nullock = {0, };
+ struct gf_flock nullock = {0, };
gf_posix_lk_log++;
@@ -3809,7 +3809,7 @@ posix_lk (call_frame_t *frame, xlator_t *this,
int32_t
posix_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd, struct flock *lock)
+ const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock)
{
gf_log (this->name, GF_LOG_CRITICAL,
"\"features/locks\" translator is not loaded. "
@@ -3821,7 +3821,7 @@ posix_inodelk (call_frame_t *frame, xlator_t *this,
int32_t
posix_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd, struct flock *lock)
+ const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock)
{
gf_log (this->name, GF_LOG_CRITICAL,
"\"features/locks\" translator is not loaded. "