summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBharata B Rao <bharata@linux.vnet.ibm.com>2013-11-15 10:11:58 +0530
committerAnand Avati <avati@redhat.com>2013-11-14 23:29:48 -0800
commit884a668a9c3e12e17d64ebd5ccd9fbf3d203fd1e (patch)
tree844b79ba52702c630f439d45703ee59136de356a
parentf21cefed298ba21f4739d6ab4ceea81b97d2aab8 (diff)
zerofill: Change the type of len argument of glfs_zerofill() to off_t
glfs_zerofill() can be potentially called to zero-out entire file and hence allow for bigger value of length parameter. Change-Id: I75f1d11af298915049a3f3a7cb3890a2d72fca63 BUG: 1028673 Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-on: http://review.gluster.org/6266 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: M. Mohan Kumar <mohan@in.ibm.com> Tested-by: M. Mohan Kumar <mohan@in.ibm.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--api/src/glfs-fops.c4
-rw-r--r--api/src/glfs.h4
-rw-r--r--libglusterfs/src/call-stub.c2
-rw-r--r--libglusterfs/src/call-stub.h2
-rw-r--r--libglusterfs/src/defaults.c4
-rw-r--r--libglusterfs/src/defaults.h4
-rw-r--r--libglusterfs/src/syncop.c2
-rw-r--r--libglusterfs/src/syncop.h2
-rw-r--r--libglusterfs/src/xlator.h2
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c2
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.h2
-rw-r--r--xlators/cluster/afr/src/afr.h2
-rw-r--r--xlators/cluster/dht/src/dht-common.h2
-rw-r--r--xlators/cluster/dht/src/dht-inode-write.c2
-rw-r--r--xlators/cluster/stripe/src/stripe.c2
-rw-r--r--xlators/debug/io-stats/src/io-stats.c2
-rw-r--r--xlators/features/marker/src/marker.c2
-rw-r--r--xlators/performance/io-cache/src/io-cache.c2
-rw-r--r--xlators/performance/io-threads/src/io-threads.c4
-rw-r--r--xlators/performance/md-cache/src/md-cache.c2
-rw-r--r--xlators/performance/open-behind/src/open-behind.c2
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.c2
-rw-r--r--xlators/protocol/client/src/client.c2
-rw-r--r--xlators/storage/posix/src/posix.c16
24 files changed, 36 insertions, 36 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index 10bb7d38b4d..93c5101a015 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -1877,7 +1877,7 @@ glfs_discard_async (struct glfs_fd *glfd, off_t offset, size_t len,
}
int
-glfs_zerofill_async (struct glfs_fd *glfd, off_t offset, size_t len,
+glfs_zerofill_async (struct glfs_fd *glfd, off_t offset, off_t len,
glfs_io_cbk fn, void *data)
{
struct glfs_io *gio = NULL;
@@ -2927,7 +2927,7 @@ out:
}
int
-glfs_zerofill (struct glfs_fd *glfd, off_t offset, size_t len)
+glfs_zerofill (struct glfs_fd *glfd, off_t offset, off_t len)
{
int ret = -1;
xlator_t *subvol = NULL;
diff --git a/api/src/glfs.h b/api/src/glfs.h
index 18fda496ea2..bf298ce47a6 100644
--- a/api/src/glfs.h
+++ b/api/src/glfs.h
@@ -556,9 +556,9 @@ int glfs_discard(glfs_fd_t *fd, off_t offset, size_t len);
int glfs_discard_async (glfs_fd_t *fd, off_t length, size_t lent,
glfs_io_cbk fn, void *data);
-int glfs_zerofill(glfs_fd_t *fd, off_t offset, size_t len);
+int glfs_zerofill(glfs_fd_t *fd, off_t offset, off_t len);
-int glfs_zerofill_async (glfs_fd_t *fd, off_t length, size_t len,
+int glfs_zerofill_async (glfs_fd_t *fd, off_t length, off_t len,
glfs_io_cbk fn, void *data);
char *glfs_getcwd (glfs_t *fs, char *buf, size_t size);
diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c
index ac79cf0711c..7e94ee3c001 100644
--- a/libglusterfs/src/call-stub.c
+++ b/libglusterfs/src/call-stub.c
@@ -2271,7 +2271,7 @@ out:
call_stub_t *
fop_zerofill_stub(call_frame_t *frame, fop_zerofill_t fn, fd_t *fd,
- off_t offset, size_t len, dict_t *xdata)
+ off_t offset, off_t len, dict_t *xdata)
{
call_stub_t *stub = NULL;
diff --git a/libglusterfs/src/call-stub.h b/libglusterfs/src/call-stub.h
index 45bef80443f..0f6c108ee64 100644
--- a/libglusterfs/src/call-stub.h
+++ b/libglusterfs/src/call-stub.h
@@ -752,7 +752,7 @@ fop_zerofill_stub(call_frame_t *frame,
fop_zerofill_t fn,
fd_t *fd,
off_t offset,
- size_t len, dict_t *xdata);
+ off_t len, dict_t *xdata);
call_stub_t *
fop_zerofill_cbk_stub(call_frame_t *frame,
diff --git a/libglusterfs/src/defaults.c b/libglusterfs/src/defaults.c
index 2ebb251504c..e6b1287f9df 100644
--- a/libglusterfs/src/defaults.c
+++ b/libglusterfs/src/defaults.c
@@ -913,7 +913,7 @@ default_discard_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
int32_t
default_zerofill_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
- off_t offset, size_t len, dict_t *xdata)
+ off_t offset, off_t len, dict_t *xdata)
{
STACK_WIND(frame, default_zerofill_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->zerofill, fd, offset, len,
@@ -1348,7 +1348,7 @@ default_discard(call_frame_t *frame, xlator_t *this, fd_t *fd,
int32_t
default_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd,
- off_t offset, size_t len, dict_t *xdata)
+ off_t offset, off_t len, dict_t *xdata)
{
STACK_WIND_TAIL(frame, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->zerofill, fd, offset, len,
diff --git a/libglusterfs/src/defaults.h b/libglusterfs/src/defaults.h
index 0747027bc35..0fb5572accc 100644
--- a/libglusterfs/src/defaults.h
+++ b/libglusterfs/src/defaults.h
@@ -259,7 +259,7 @@ int32_t default_zerofill(call_frame_t *frame,
xlator_t *this,
fd_t *fd,
off_t offset,
- size_t len, dict_t *xdata);
+ off_t len, dict_t *xdata);
/* Resume */
@@ -488,7 +488,7 @@ int32_t default_zerofill_resume(call_frame_t *frame,
xlator_t *this,
fd_t *fd,
off_t offset,
- size_t len, dict_t *xdata);
+ off_t len, dict_t *xdata);
/* _cbk */
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index c1620bb7088..25baa021ada 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -2191,7 +2191,7 @@ syncop_zerofill_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
int
-syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, size_t len)
+syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, off_t len)
{
struct syncargs args = {0, };
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index f790981f0bc..18519ff47ac 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -403,7 +403,7 @@ int syncop_fallocate(xlator_t *subvol, fd_t *fd, int32_t keep_size, off_t offset
size_t len);
int syncop_discard(xlator_t *subvol, fd_t *fd, off_t offset, size_t len);
-int syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, size_t len);
+int syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, off_t len);
int syncop_rename (xlator_t *subvol, loc_t *oldloc, loc_t *newloc);
diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h
index b57e5873e3d..2f3bc9d6fb2 100644
--- a/libglusterfs/src/xlator.h
+++ b/libglusterfs/src/xlator.h
@@ -677,7 +677,7 @@ typedef int32_t (*fop_zerofill_t) (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
off_t offset,
- size_t len,
+ off_t len,
dict_t *xdata);
struct xlator_fops {
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index c1ec69a5505..d62847defa3 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -2807,7 +2807,7 @@ out:
int
afr_zerofill (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
afr_private_t *priv = NULL;
afr_local_t *local = NULL;
diff --git a/xlators/cluster/afr/src/afr-inode-write.h b/xlators/cluster/afr/src/afr-inode-write.h
index 8e93ca44aaa..7b1fc552880 100644
--- a/xlators/cluster/afr/src/afr-inode-write.h
+++ b/xlators/cluster/afr/src/afr-inode-write.h
@@ -78,5 +78,5 @@ afr_fallocate (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
int
afr_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata);
+ off_t len, dict_t *xdata);
#endif /* __INODE_WRITE_H__ */
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 21064db58d9..dcf0f8d0cf1 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -712,7 +712,7 @@ typedef struct _afr_local {
struct {
off_t offset;
- size_t len;
+ off_t len;
struct iatt prebuf;
struct iatt postbuf;
} zerofill;
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 5ccd66799ae..7564c600bc4 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -696,7 +696,7 @@ int32_t dht_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd,
int32_t dht_discard(call_frame_t *frame, xlator_t *this, fd_t *fd,
off_t offset, size_t len, dict_t *xdata);
int32_t dht_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd,
- off_t offset, size_t len, dict_t *xdata);
+ off_t offset, off_t len, dict_t *xdata);
int32_t dht_init (xlator_t *this);
void dht_fini (xlator_t *this);
diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c
index 4b3f3a0496b..1ba98473eee 100644
--- a/xlators/cluster/dht/src/dht-inode-write.c
+++ b/xlators/cluster/dht/src/dht-inode-write.c
@@ -707,7 +707,7 @@ dht_zerofill2(xlator_t *this, call_frame_t *frame, int op_ret)
int
dht_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
xlator_t *subvol = NULL;
int op_errno = -1;
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 69b510e231e..fa718a3e4e5 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -4172,7 +4172,7 @@ out:
int32_t
stripe_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
stripe_local_t *local = NULL;
stripe_fd_ctx_t *fctx = NULL;
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index 7fb697ae45d..3ca57753c56 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -2453,7 +2453,7 @@ io_stats_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
int
io_stats_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
START_FOP_LATENCY(frame);
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
index 6a2c856913e..6df1f5688e2 100644
--- a/xlators/features/marker/src/marker.c
+++ b/xlators/features/marker/src/marker.c
@@ -1991,7 +1991,7 @@ out:
int32_t
marker_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
int32_t ret = 0;
marker_local_t *local = NULL;
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index 201777b380e..054d28c03bf 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -1461,7 +1461,7 @@ ioc_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
static int32_t
ioc_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
uint64_t ioc_inode = 0;
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index bbcf4ed26ca..4dd7a997373 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -2522,7 +2522,7 @@ iot_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int
iot_zerofill_wrapper(call_frame_t *frame, xlator_t *this, fd_t *fd,
- off_t offset, size_t len, dict_t *xdata)
+ off_t offset, off_t len, dict_t *xdata)
{
STACK_WIND (frame, iot_zerofill_cbk, FIRST_CHILD (this),
FIRST_CHILD (this)->fops->zerofill, fd, offset, len, xdata);
@@ -2531,7 +2531,7 @@ iot_zerofill_wrapper(call_frame_t *frame, xlator_t *this, fd_t *fd,
int
iot_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
call_stub_t *stub = NULL;
int ret = -1;
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index 84c363ad9c7..ef156e309a1 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -2122,7 +2122,7 @@ out:
}
int mdc_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
mdc_local_t *local;
diff --git a/xlators/performance/open-behind/src/open-behind.c b/xlators/performance/open-behind/src/open-behind.c
index 7e5b5727872..29ef64364dc 100644
--- a/xlators/performance/open-behind/src/open-behind.c
+++ b/xlators/performance/open-behind/src/open-behind.c
@@ -721,7 +721,7 @@ err:
int
ob_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
call_stub_t *stub;
diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c
index 069ab1f1a91..6e2d84591d8 100644
--- a/xlators/performance/read-ahead/src/read-ahead.c
+++ b/xlators/performance/read-ahead/src/read-ahead.c
@@ -1006,7 +1006,7 @@ ra_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
static int
ra_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
ra_file_t *file = NULL;
fd_t *iter_fd = NULL;
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index 1f7d13ea452..ac3fcb1179a 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -2032,7 +2032,7 @@ out:
int32_t
client_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
int ret = -1;
clnt_conf_t *conf = NULL;
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index fb45c7a6746..768ab492937 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -634,15 +634,15 @@ out:
}
static int32_t
-_posix_do_zerofill(int fd, off_t offset, size_t len, int o_direct)
+_posix_do_zerofill(int fd, off_t offset, off_t len, int o_direct)
{
- size_t num_vect = 0;
- int32_t num_loop = 1;
- int32_t idx = 0;
+ off_t num_vect = 0;
+ off_t num_loop = 1;
+ off_t idx = 0;
int32_t op_ret = -1;
int32_t vect_size = VECTOR_SIZE;
- size_t remain = 0;
- size_t extra = 0;
+ off_t remain = 0;
+ off_t extra = 0;
struct iovec *vector = NULL;
char *iov_base = NULL;
char *alloc_buf = NULL;
@@ -714,7 +714,7 @@ err:
static int32_t
posix_do_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd,
- off_t offset, size_t len, struct iatt *statpre,
+ off_t offset, off_t len, struct iatt *statpre,
struct iatt *statpost)
{
struct posix_fd *pfd = NULL;
@@ -827,7 +827,7 @@ err:
static int32_t
posix_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata)
+ off_t len, dict_t *xdata)
{
int32_t ret = 0;
struct iatt statpre = {0,};