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>
This commit is contained in:
Bharata B Rao 2013-11-15 10:11:58 +05:30 committed by Anand Avati
parent f21cefed29
commit 884a668a9c
24 changed files with 36 additions and 36 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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,

View File

@ -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,

View File

@ -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 */

View File

@ -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, };

View File

@ -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);

View File

@ -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 {

View File

@ -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;

View File

@ -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__ */

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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,};