summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-04-05 14:53:08 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-04-06 01:47:43 +0200
commit6aa12fcb30c8f7246fd0215b1d808191c0d87668 (patch)
tree92eb805ea2ed03b1e42f6ce55ca26a65a92761fb /source3/smbd
parent48166468fe3ca515dae3431bbe674809489f743c (diff)
downloadsamba-6aa12fcb30c8f7246fd0215b1d808191c0d87668.tar.gz
samba-6aa12fcb30c8f7246fd0215b1d808191c0d87668.tar.bz2
samba-6aa12fcb30c8f7246fd0215b1d808191c0d87668.zip
build: Remove SMB_OFF_T, replace with off_t
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/aio.c12
-rw-r--r--source3/smbd/close.c2
-rw-r--r--source3/smbd/dir.c4
-rw-r--r--source3/smbd/fileio.c14
-rw-r--r--source3/smbd/nttrans.c8
-rw-r--r--source3/smbd/proto.h30
-rw-r--r--source3/smbd/reply.c58
-rw-r--r--source3/smbd/smb2_read.c2
-rw-r--r--source3/smbd/trans2.c12
-rw-r--r--source3/smbd/vfs.c38
10 files changed, 90 insertions, 90 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index 44081f69a0..000206a985 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -147,7 +147,7 @@ static struct aio_extra *create_aio_extra(TALLOC_CTX *mem_ctx,
NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
struct smb_request *smbreq,
- files_struct *fsp, SMB_OFF_T startpos,
+ files_struct *fsp, off_t startpos,
size_t smb_maxcnt)
{
struct aio_extra *aio_ex;
@@ -254,7 +254,7 @@ NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
struct smb_request *smbreq,
files_struct *fsp, const char *data,
- SMB_OFF_T startpos,
+ off_t startpos,
size_t numtowrite)
{
struct aio_extra *aio_ex;
@@ -418,7 +418,7 @@ NTSTATUS schedule_smb2_aio_read(connection_struct *conn,
files_struct *fsp,
TALLOC_CTX *ctx,
DATA_BLOB *preadbuf,
- SMB_OFF_T startpos,
+ off_t startpos,
size_t smb_maxcnt)
{
struct aio_extra *aio_ex;
@@ -1060,7 +1060,7 @@ void cancel_aio_by_fsp(files_struct *fsp)
#else
NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
struct smb_request *smbreq,
- files_struct *fsp, SMB_OFF_T startpos,
+ files_struct *fsp, off_t startpos,
size_t smb_maxcnt)
{
return NT_STATUS_RETRY;
@@ -1069,7 +1069,7 @@ NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
struct smb_request *smbreq,
files_struct *fsp, const char *data,
- SMB_OFF_T startpos,
+ off_t startpos,
size_t numtowrite)
{
return NT_STATUS_RETRY;
@@ -1085,7 +1085,7 @@ NTSTATUS schedule_smb2_aio_read(connection_struct *conn,
files_struct *fsp,
TALLOC_CTX *ctx,
DATA_BLOB *preadbuf,
- SMB_OFF_T startpos,
+ off_t startpos,
size_t smb_maxcnt)
{
return NT_STATUS_RETRY;
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index da6d8483a1..dc6df47ee6 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -118,7 +118,7 @@ static NTSTATUS check_magic(struct files_struct *fsp)
goto out;
}
- if (transfer_file(tmp_fd,outfd,(SMB_OFF_T)st.st_ex_size) == (SMB_OFF_T)-1) {
+ if (transfer_file(tmp_fd,outfd,(off_t)st.st_ex_size) == (off_t)-1) {
int err = errno;
close(tmp_fd);
close(outfd);
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 79a0f8bf18..cb27110f26 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -82,7 +82,7 @@ bool make_dir_struct(TALLOC_CTX *ctx,
char *buf,
const char *mask,
const char *fname,
- SMB_OFF_T size,
+ off_t size,
uint32 mode,
time_t date,
bool uc)
@@ -1221,7 +1221,7 @@ bool get_dir_entry(TALLOC_CTX *ctx,
const char *mask,
uint32_t dirtype,
char **_fname,
- SMB_OFF_T *_size,
+ off_t *_size,
uint32_t *_mode,
struct timespec *_date,
bool check_descend,
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 85d879d8c5..8bdb66bcfe 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -25,13 +25,13 @@
#include "smbd/globals.h"
#include "smbprofile.h"
-static bool setup_write_cache(files_struct *, SMB_OFF_T);
+static bool setup_write_cache(files_struct *, off_t);
/****************************************************************************
Read from write cache if we can.
****************************************************************************/
-static bool read_from_write_cache(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n)
+static bool read_from_write_cache(files_struct *fsp,char *data,off_t pos,size_t n)
{
write_cache *wcp = fsp->wcp;
@@ -54,7 +54,7 @@ static bool read_from_write_cache(files_struct *fsp,char *data,SMB_OFF_T pos,siz
Read from a file.
****************************************************************************/
-ssize_t read_file(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n)
+ssize_t read_file(files_struct *fsp,char *data,off_t pos,size_t n)
{
ssize_t ret=0,readret;
@@ -121,7 +121,7 @@ tryagain:
static ssize_t real_write_file(struct smb_request *req,
files_struct *fsp,
const char *data,
- SMB_OFF_T pos,
+ off_t pos,
size_t n)
{
ssize_t ret;
@@ -287,7 +287,7 @@ void trigger_write_time_update_immediate(struct files_struct *fsp)
ssize_t write_file(struct smb_request *req,
files_struct *fsp,
const char *data,
- SMB_OFF_T pos,
+ off_t pos,
size_t n)
{
write_cache *wcp = fsp->wcp;
@@ -905,7 +905,7 @@ void delete_write_cache(files_struct *fsp)
Setup the write cache structure.
****************************************************************************/
-static bool setup_write_cache(files_struct *fsp, SMB_OFF_T file_size)
+static bool setup_write_cache(files_struct *fsp, off_t file_size)
{
ssize_t alloc_size = lp_write_cache_size(SNUM(fsp->conn));
write_cache *wcp;
@@ -950,7 +950,7 @@ static bool setup_write_cache(files_struct *fsp, SMB_OFF_T file_size)
Cope with a size change.
****************************************************************************/
-void set_filelen_write_cache(files_struct *fsp, SMB_OFF_T file_size)
+void set_filelen_write_cache(files_struct *fsp, off_t file_size)
{
if(fsp->wcp) {
/* The cache *must* have been flushed before we do this. */
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 20379ac6d9..168ef56553 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -451,7 +451,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
/* Breakout the oplock request bits so we can set the
reply bits separately. */
uint32 fattr=0;
- SMB_OFF_T file_len = 0;
+ off_t file_len = 0;
int info = 0;
files_struct *fsp = NULL;
char *p = NULL;
@@ -972,7 +972,7 @@ static void call_nt_transact_create(connection_struct *conn,
char *data = *ppdata;
/* Breakout the oplock request bits so we can set the reply bits separately. */
uint32 fattr=0;
- SMB_OFF_T file_len = 0;
+ off_t file_len = 0;
int info = 0;
files_struct *fsp = NULL;
char *p = NULL;
@@ -1355,7 +1355,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
files_struct *fsp1,*fsp2;
uint32 fattr;
int info;
- SMB_OFF_T ret=-1;
+ off_t ret=-1;
NTSTATUS status = NT_STATUS_OK;
char *parent;
@@ -1470,7 +1470,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
file_set_dosmode(conn, smb_fname_dst, fattr, parent, false);
TALLOC_FREE(parent);
- if (ret < (SMB_OFF_T)smb_fname_src->st.st_ex_size) {
+ if (ret < (off_t)smb_fname_src->st.st_ex_size) {
status = NT_STATUS_DISK_FULL;
goto out;
}
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 1af07882b5..ca267a0500 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -66,19 +66,19 @@ void srv_set_signing(struct smbd_server_connection *conn,
NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
struct smb_request *req,
- files_struct *fsp, SMB_OFF_T startpos,
+ files_struct *fsp, off_t startpos,
size_t smb_maxcnt);
NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
struct smb_request *req,
files_struct *fsp, const char *data,
- SMB_OFF_T startpos,
+ off_t startpos,
size_t numtowrite);
NTSTATUS schedule_smb2_aio_read(connection_struct *conn,
struct smb_request *smbreq,
files_struct *fsp,
TALLOC_CTX *ctx,
DATA_BLOB *preadbuf,
- SMB_OFF_T startpos,
+ off_t startpos,
size_t smb_maxcnt);
NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
struct smb_request *smbreq,
@@ -185,7 +185,7 @@ bool make_dir_struct(TALLOC_CTX *ctx,
char *buf,
const char *mask,
const char *fname,
- SMB_OFF_T size,
+ off_t size,
uint32 mode,
time_t date,
bool uc);
@@ -229,7 +229,7 @@ bool get_dir_entry(TALLOC_CTX *ctx,
const char *mask,
uint32 dirtype,
char **pp_fname_out,
- SMB_OFF_T *size,
+ off_t *size,
uint32 *mode,
struct timespec *date,
bool check_descend,
@@ -317,7 +317,7 @@ NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode);
/* The following definitions come from smbd/fileio.c */
-ssize_t read_file(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n);
+ssize_t read_file(files_struct *fsp,char *data,off_t pos,size_t n);
void update_write_time_handler(struct event_context *ctx,
struct timed_event *te,
struct timeval now,
@@ -327,10 +327,10 @@ void trigger_write_time_update_immediate(struct files_struct *fsp);
ssize_t write_file(struct smb_request *req,
files_struct *fsp,
const char *data,
- SMB_OFF_T pos,
+ off_t pos,
size_t n);
void delete_write_cache(files_struct *fsp);
-void set_filelen_write_cache(files_struct *fsp, SMB_OFF_T file_size);
+void set_filelen_write_cache(files_struct *fsp, off_t file_size);
ssize_t flush_write_cache(files_struct *fsp, enum flush_reason_enum reason);
NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, bool write_through);
int fsp_stat(files_struct *fsp);
@@ -867,7 +867,7 @@ NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req,
uint32 dirtype, struct smb_filename *smb_fname,
bool has_wild);
void reply_unlink(struct smb_request *req);
-ssize_t fake_sendfile(files_struct *fsp, SMB_OFF_T startpos, size_t nread);
+ssize_t fake_sendfile(files_struct *fsp, off_t startpos, size_t nread);
void sendfile_short_send(files_struct *fsp,
ssize_t nread,
size_t headersize,
@@ -1147,7 +1147,7 @@ bool smbd_vfs_init(connection_struct *conn);
NTSTATUS vfs_file_exist(connection_struct *conn, struct smb_filename *smb_fname);
ssize_t vfs_read_data(files_struct *fsp, char *buf, size_t byte_count);
ssize_t vfs_pread_data(files_struct *fsp, char *buf,
- size_t byte_count, SMB_OFF_T offset);
+ size_t byte_count, off_t offset);
ssize_t vfs_write_data(struct smb_request *req,
files_struct *fsp,
const char *buffer,
@@ -1156,12 +1156,12 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
files_struct *fsp,
const char *buffer,
size_t N,
- SMB_OFF_T offset);
+ off_t offset);
int vfs_allocate_file_space(files_struct *fsp, uint64_t len);
-int vfs_set_filelen(files_struct *fsp, SMB_OFF_T len);
-int vfs_slow_fallocate(files_struct *fsp, SMB_OFF_T offset, SMB_OFF_T len);
-int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len);
-SMB_OFF_T vfs_transfer_file(files_struct *in, files_struct *out, SMB_OFF_T n);
+int vfs_set_filelen(files_struct *fsp, off_t len);
+int vfs_slow_fallocate(files_struct *fsp, off_t offset, off_t len);
+int vfs_fill_sparse(files_struct *fsp, off_t len);
+off_t vfs_transfer_file(files_struct *in, files_struct *out, off_t n);
const char *vfs_readdirname(connection_struct *conn, void *p,
SMB_STRUCT_STAT *sbuf, char **talloced);
int vfs_ChDir(connection_struct *conn, const char *path);
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 8cefba0dfc..dc4310639b 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1081,7 +1081,7 @@ void reply_getatr(struct smb_request *req)
struct smb_filename *smb_fname = NULL;
char *fname = NULL;
int mode=0;
- SMB_OFF_T size=0;
+ off_t size=0;
time_t mtime=0;
const char *p;
NTSTATUS status;
@@ -1374,7 +1374,7 @@ void reply_search(struct smb_request *req)
char *directory = NULL;
struct smb_filename *smb_fname = NULL;
char *fname = NULL;
- SMB_OFF_T size;
+ off_t size;
uint32 mode;
struct timespec date;
uint32 dirtype;
@@ -1716,7 +1716,7 @@ void reply_open(struct smb_request *req)
struct smb_filename *smb_fname = NULL;
char *fname = NULL;
uint32 fattr=0;
- SMB_OFF_T size = 0;
+ off_t size = 0;
time_t mtime=0;
int info;
files_struct *fsp;
@@ -1989,7 +1989,7 @@ void reply_open_and_X(struct smb_request *req)
reply_nterror(req, NT_STATUS_DISK_FULL);
goto out;
}
- retval = vfs_set_filelen(fsp, (SMB_OFF_T)allocation_size);
+ retval = vfs_set_filelen(fsp, (off_t)allocation_size);
if (retval < 0) {
close_file(req, fsp, ERROR_CLOSE);
reply_nterror(req, NT_STATUS_DISK_FULL);
@@ -2840,7 +2840,7 @@ static void fail_readraw(void)
Fake (read/write) sendfile. Returns -1 on read or write fail.
****************************************************************************/
-ssize_t fake_sendfile(files_struct *fsp, SMB_OFF_T startpos, size_t nread)
+ssize_t fake_sendfile(files_struct *fsp, off_t startpos, size_t nread)
{
size_t bufsize;
size_t tosend = nread;
@@ -3003,7 +3003,7 @@ static void reply_readbraw_error(struct smbd_server_connection *sconn)
static void send_file_readbraw(connection_struct *conn,
struct smb_request *req,
files_struct *fsp,
- SMB_OFF_T startpos,
+ off_t startpos,
size_t nread,
ssize_t mincount)
{
@@ -3134,10 +3134,10 @@ void reply_readbraw(struct smb_request *req)
struct smbd_server_connection *sconn = req->sconn;
ssize_t maxcount,mincount;
size_t nread = 0;
- SMB_OFF_T startpos;
+ off_t startpos;
files_struct *fsp;
struct lock_struct lock;
- SMB_OFF_T size = 0;
+ off_t size = 0;
START_PROFILE(SMBreadbraw);
@@ -3208,7 +3208,7 @@ void reply_readbraw(struct smb_request *req)
* This is a large offset (64 bit) read.
*/
- startpos |= (((SMB_OFF_T)IVAL(req->vwv+8, 0)) << 32);
+ startpos |= (((off_t)IVAL(req->vwv+8, 0)) << 32);
if(startpos < 0) {
DEBUG(0,("reply_readbraw: negative 64 bit "
@@ -3280,7 +3280,7 @@ void reply_lockread(struct smb_request *req)
connection_struct *conn = req->conn;
ssize_t nread = -1;
char *data;
- SMB_OFF_T startpos;
+ off_t startpos;
size_t numtoread;
NTSTATUS status;
files_struct *fsp;
@@ -3392,7 +3392,7 @@ void reply_read(struct smb_request *req)
size_t numtoread;
ssize_t nread = 0;
char *data;
- SMB_OFF_T startpos;
+ off_t startpos;
int outsize = 0;
files_struct *fsp;
struct lock_struct lock;
@@ -3507,7 +3507,7 @@ static int setup_readX_header(struct smb_request *req, char *outbuf,
****************************************************************************/
static void send_file_readX(connection_struct *conn, struct smb_request *req,
- files_struct *fsp, SMB_OFF_T startpos,
+ files_struct *fsp, off_t startpos,
size_t smb_maxcnt)
{
ssize_t nread = -1;
@@ -3704,7 +3704,7 @@ void reply_read_and_X(struct smb_request *req)
struct smbd_server_connection *sconn = req->sconn;
connection_struct *conn = req->conn;
files_struct *fsp;
- SMB_OFF_T startpos;
+ off_t startpos;
size_t smb_maxcnt;
bool big_readX = False;
#if 0
@@ -3780,7 +3780,7 @@ void reply_read_and_X(struct smb_request *req)
/*
* This is a large offset (64 bit) read.
*/
- startpos |= (((SMB_OFF_T)IVAL(req->vwv+10, 0)) << 32);
+ startpos |= (((off_t)IVAL(req->vwv+10, 0)) << 32);
}
@@ -3875,7 +3875,7 @@ void reply_writebraw(struct smb_request *req)
ssize_t total_written=0;
size_t numtowrite=0;
size_t tcount;
- SMB_OFF_T startpos;
+ off_t startpos;
const char *data=NULL;
bool write_through;
files_struct *fsp;
@@ -4125,7 +4125,7 @@ void reply_writeunlock(struct smb_request *req)
connection_struct *conn = req->conn;
ssize_t nwritten = -1;
size_t numtowrite;
- SMB_OFF_T startpos;
+ off_t startpos;
const char *data;
NTSTATUS status = NT_STATUS_OK;
files_struct *fsp;
@@ -4239,7 +4239,7 @@ void reply_write(struct smb_request *req)
connection_struct *conn = req->conn;
size_t numtowrite;
ssize_t nwritten = -1;
- SMB_OFF_T startpos;
+ off_t startpos;
const char *data;
files_struct *fsp;
struct lock_struct lock;
@@ -4300,12 +4300,12 @@ void reply_write(struct smb_request *req)
/*
* This is actually an allocate call, and set EOF. JRA.
*/
- nwritten = vfs_allocate_file_space(fsp, (SMB_OFF_T)startpos);
+ nwritten = vfs_allocate_file_space(fsp, (off_t)startpos);
if (nwritten < 0) {
reply_nterror(req, NT_STATUS_DISK_FULL);
goto strict_unlock;
}
- nwritten = vfs_set_filelen(fsp, (SMB_OFF_T)startpos);
+ nwritten = vfs_set_filelen(fsp, (off_t)startpos);
if (nwritten < 0) {
reply_nterror(req, NT_STATUS_DISK_FULL);
goto strict_unlock;
@@ -4448,7 +4448,7 @@ void reply_write_and_X(struct smb_request *req)
connection_struct *conn = req->conn;
files_struct *fsp;
struct lock_struct lock;
- SMB_OFF_T startpos;
+ off_t startpos;
size_t numtowrite;
bool write_through;
ssize_t nwritten;
@@ -4522,7 +4522,7 @@ void reply_write_and_X(struct smb_request *req)
/*
* This is a large offset (64 bit) write.
*/
- startpos |= (((SMB_OFF_T)IVAL(req->vwv+12, 0)) << 32);
+ startpos |= (((off_t)IVAL(req->vwv+12, 0)) << 32);
}
@@ -4620,8 +4620,8 @@ out:
void reply_lseek(struct smb_request *req)
{
connection_struct *conn = req->conn;
- SMB_OFF_T startpos;
- SMB_OFF_T res= -1;
+ off_t startpos;
+ off_t res= -1;
int mode,umode;
files_struct *fsp;
@@ -4643,7 +4643,7 @@ void reply_lseek(struct smb_request *req)
mode = SVAL(req->vwv+1, 0) & 3;
/* NB. This doesn't use IVAL_TO_SMB_OFF_T as startpos can be signed in this case. */
- startpos = (SMB_OFF_T)IVALS(req->vwv+2, 0);
+ startpos = (off_t)IVALS(req->vwv+2, 0);
switch (mode) {
case 0:
@@ -4666,7 +4666,7 @@ void reply_lseek(struct smb_request *req)
if (umode == SEEK_END) {
if((res = SMB_VFS_LSEEK(fsp,startpos,umode)) == -1) {
if(errno == EINVAL) {
- SMB_OFF_T current_pos = startpos;
+ off_t current_pos = startpos;
if(fsp_stat(fsp) == -1) {
reply_nterror(req,
@@ -4845,7 +4845,7 @@ void reply_writeclose(struct smb_request *req)
size_t numtowrite;
ssize_t nwritten = -1;
NTSTATUS close_status = NT_STATUS_OK;
- SMB_OFF_T startpos;
+ off_t startpos;
const char *data;
struct timespec mtime;
files_struct *fsp;
@@ -5454,7 +5454,7 @@ void reply_printwrite(struct smb_request *req)
data = (const char *)req->buf + 3;
- if (write_file(req,fsp,data,(SMB_OFF_T)-1,numtowrite) != numtowrite) {
+ if (write_file(req,fsp,data,(off_t)-1,numtowrite) != numtowrite) {
reply_nterror(req, map_nt_error_from_unix(errno));
END_PROFILE(SMBsplwr);
return;
@@ -6695,7 +6695,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
bool target_is_directory)
{
struct smb_filename *smb_fname_dst_tmp = NULL;
- SMB_OFF_T ret=-1;
+ off_t ret=-1;
files_struct *fsp1,*fsp2;
uint32 dosattrs;
uint32 new_create_disposition;
@@ -6840,7 +6840,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
goto out;
}
- if (ret != (SMB_OFF_T)smb_fname_src->st.st_ex_size) {
+ if (ret != (off_t)smb_fname_src->st.st_ex_size) {
status = NT_STATUS_DISK_FULL;
goto out;
}
diff --git a/source3/smbd/smb2_read.c b/source3/smbd/smb2_read.c
index 0b6e2ee461..53b0a9dc57 100644
--- a/source3/smbd/smb2_read.c
+++ b/source3/smbd/smb2_read.c
@@ -475,7 +475,7 @@ static struct tevent_req *smbd_smb2_read_send(TALLOC_CTX *mem_ctx,
fsp,
state,
&state->out_data,
- (SMB_OFF_T)in_offset,
+ (off_t)in_offset,
(size_t)in_length);
if (NT_STATUS_IS_OK(status)) {
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 40a1a5dc80..dcf771a5b9 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1028,7 +1028,7 @@ static void call_trans2open(connection_struct *conn,
uint32 open_size;
char *pname;
char *fname = NULL;
- SMB_OFF_T size=0;
+ off_t size=0;
int fattr=0,mtime=0;
SMB_INO_T inode = 0;
int smb_action = 0;
@@ -5670,7 +5670,7 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
files_struct *fsp,
const struct smb_filename *smb_fname,
const SMB_STRUCT_STAT *psbuf,
- SMB_OFF_T size,
+ off_t size,
bool fail_after_createfile)
{
NTSTATUS status = NT_STATUS_OK;
@@ -6755,14 +6755,14 @@ static NTSTATUS smb_set_file_end_of_file_info(connection_struct *conn,
const struct smb_filename *smb_fname,
bool fail_after_createfile)
{
- SMB_OFF_T size;
+ off_t size;
if (total_data < 8) {
return NT_STATUS_INVALID_PARAMETER;
}
size = IVAL(pdata,0);
- size |= (((SMB_OFF_T)IVAL(pdata,4)) << 32);
+ size |= (((off_t)IVAL(pdata,4)) << 32);
DEBUG(10,("smb_set_file_end_of_file_info: Set end of file info for "
"file %s to %.0f\n", smb_fname_str_dbg(smb_fname),
(double)size));
@@ -6874,7 +6874,7 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
struct smb_file_time ft;
uint32 raw_unixmode;
mode_t unixmode;
- SMB_OFF_T size = 0;
+ off_t size = 0;
uid_t set_owner = (uid_t)SMB_UID_NO_CHANGE;
gid_t set_grp = (uid_t)SMB_GID_NO_CHANGE;
NTSTATUS status = NT_STATUS_OK;
@@ -6895,7 +6895,7 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
if(IVAL(pdata, 0) != SMB_SIZE_NO_CHANGE_LO &&
IVAL(pdata, 4) != SMB_SIZE_NO_CHANGE_HI) {
size=IVAL(pdata,0); /* first 8 Bytes are size */
- size |= (((SMB_OFF_T)IVAL(pdata,4)) << 32);
+ size |= (((off_t)IVAL(pdata,4)) << 32);
}
ft.atime = interpret_long_date(pdata+24); /* access_time */
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index f8a4199470..b330c03bfc 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -360,7 +360,7 @@ ssize_t vfs_read_data(files_struct *fsp, char *buf, size_t byte_count)
}
ssize_t vfs_pread_data(files_struct *fsp, char *buf,
- size_t byte_count, SMB_OFF_T offset)
+ size_t byte_count, off_t offset)
{
size_t total=0;
@@ -400,7 +400,7 @@ ssize_t vfs_write_data(struct smb_request *req,
req->unread_bytes = 0;
return SMB_VFS_RECVFILE(req->sconn->sock,
fsp,
- (SMB_OFF_T)-1,
+ (off_t)-1,
N);
}
@@ -421,7 +421,7 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
files_struct *fsp,
const char *buffer,
size_t N,
- SMB_OFF_T offset)
+ off_t offset)
{
size_t total=0;
ssize_t ret;
@@ -471,7 +471,7 @@ int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
DEBUG(10,("vfs_allocate_file_space: file %s, len %.0f\n",
fsp_str_dbg(fsp), (double)len));
- if (((SMB_OFF_T)len) < 0) {
+ if (((off_t)len) < 0) {
DEBUG(0,("vfs_allocate_file_space: %s negative len "
"requested.\n", fsp_str_dbg(fsp)));
errno = EINVAL;
@@ -496,7 +496,7 @@ int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
contend_level2_oplocks_begin(fsp, LEVEL2_CONTEND_ALLOC_SHRINK);
flush_write_cache(fsp, SIZECHANGE_FLUSH);
- if ((ret = SMB_VFS_FTRUNCATE(fsp, (SMB_OFF_T)len)) != -1) {
+ if ((ret = SMB_VFS_FTRUNCATE(fsp, (off_t)len)) != -1) {
set_filelen_write_cache(fsp, len);
}
@@ -551,7 +551,7 @@ int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
Returns 0 on success, -1 on failure.
****************************************************************************/
-int vfs_set_filelen(files_struct *fsp, SMB_OFF_T len)
+int vfs_set_filelen(files_struct *fsp, off_t len)
{
int ret;
@@ -583,7 +583,7 @@ int vfs_set_filelen(files_struct *fsp, SMB_OFF_T len)
#define SPARSE_BUF_WRITE_SIZE (32*1024)
-int vfs_slow_fallocate(files_struct *fsp, SMB_OFF_T offset, SMB_OFF_T len)
+int vfs_slow_fallocate(files_struct *fsp, off_t offset, off_t len)
{
ssize_t pwrite_ret;
size_t total = 0;
@@ -619,11 +619,11 @@ int vfs_slow_fallocate(files_struct *fsp, SMB_OFF_T offset, SMB_OFF_T len)
Returns 0 on success, -1 on failure.
****************************************************************************/
-int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len)
+int vfs_fill_sparse(files_struct *fsp, off_t len)
{
int ret;
NTSTATUS status;
- SMB_OFF_T offset;
+ off_t offset;
size_t num_to_write;
status = vfs_stat_fsp(fsp);
@@ -708,7 +708,7 @@ static ssize_t vfs_write_fn(void *file, const void *buf, size_t len)
return SMB_VFS_WRITE(fsp, buf, len);
}
-SMB_OFF_T vfs_transfer_file(files_struct *in, files_struct *out, SMB_OFF_T n)
+off_t vfs_transfer_file(files_struct *in, files_struct *out, off_t n)
{
return transfer_file_internal((void *)in, (void *)out, n,
vfs_read_fn, vfs_write_fn);
@@ -1511,7 +1511,7 @@ ssize_t smb_vfs_call_read(struct vfs_handle_struct *handle,
ssize_t smb_vfs_call_pread(struct vfs_handle_struct *handle,
struct files_struct *fsp, void *data, size_t n,
- SMB_OFF_T offset)
+ off_t offset)
{
VFS_FIND(pread);
return handle->fns->pread_fn(handle, fsp, data, n, offset);
@@ -1527,14 +1527,14 @@ ssize_t smb_vfs_call_write(struct vfs_handle_struct *handle,
ssize_t smb_vfs_call_pwrite(struct vfs_handle_struct *handle,
struct files_struct *fsp, const void *data,
- size_t n, SMB_OFF_T offset)
+ size_t n, off_t offset)
{
VFS_FIND(pwrite);
return handle->fns->pwrite_fn(handle, fsp, data, n, offset);
}
-SMB_OFF_T smb_vfs_call_lseek(struct vfs_handle_struct *handle,
- struct files_struct *fsp, SMB_OFF_T offset,
+off_t smb_vfs_call_lseek(struct vfs_handle_struct *handle,
+ struct files_struct *fsp, off_t offset,
int whence)
{
VFS_FIND(lseek);
@@ -1543,7 +1543,7 @@ SMB_OFF_T smb_vfs_call_lseek(struct vfs_handle_struct *handle,
ssize_t smb_vfs_call_sendfile(struct vfs_handle_struct *handle, int tofd,
files_struct *fromfsp, const DATA_BLOB *header,
- SMB_OFF_T offset, size_t count)
+ off_t offset, size_t count)
{
VFS_FIND(sendfile);
return handle->fns->sendfile_fn(handle, tofd, fromfsp, header, offset,
@@ -1551,7 +1551,7 @@ ssize_t smb_vfs_call_sendfile(struct vfs_handle_struct *handle, int tofd,
}
ssize_t smb_vfs_call_recvfile(struct vfs_handle_struct *handle, int fromfd,
- files_struct *tofsp, SMB_OFF_T offset,
+ files_struct *tofsp, off_t offset,
size_t count)
{
VFS_FIND(recvfile);
@@ -1765,7 +1765,7 @@ int smb_vfs_call_ntimes(struct vfs_handle_struct *handle,
}
int smb_vfs_call_ftruncate(struct vfs_handle_struct *handle,
- struct files_struct *fsp, SMB_OFF_T offset)
+ struct files_struct *fsp, off_t offset)
{
VFS_FIND(ftruncate);
return handle->fns->ftruncate_fn(handle, fsp, offset);
@@ -1774,8 +1774,8 @@ int smb_vfs_call_ftruncate(struct vfs_handle_struct *handle,
int smb_vfs_call_fallocate(struct vfs_handle_struct *handle,
struct files_struct *fsp,
enum vfs_fallocate_mode mode,
- SMB_OFF_T offset,
- SMB_OFF_T len)
+ off_t offset,
+ off_t len)
{
VFS_FIND(fallocate);
return handle->fns->fallocate_fn(handle, fsp, mode, offset, len);