build: Remove SMB_OFF_T, replace with off_t
authorAndrew Bartlett <abartlet@samba.org>
Thu, 5 Apr 2012 04:53:08 +0000 (14:53 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 5 Apr 2012 23:47:43 +0000 (01:47 +0200)
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

63 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/client/client.c
source3/client/clitar.c
source3/include/includes.h
source3/include/libsmb_internal.h
source3/include/printing.h
source3/include/proto.h
source3/include/smb.h
source3/include/transfer_file.h
source3/include/vfs.h
source3/lib/recvfile.c
source3/lib/sendfile.c
source3/lib/system.c
source3/lib/util.c
source3/lib/util_transfer_file.c
source3/libsmb/clifile.c
source3/libsmb/clirap.c
source3/libsmb/clirap.h
source3/libsmb/clireadwrite.c
source3/libsmb/libsmb_dir.c
source3/libsmb/libsmb_file.c
source3/libsmb/libsmb_stat.c
source3/libsmb/libsmb_xattr.c
source3/libsmb/proto.h
source3/locking/posix.c
source3/modules/onefs.h
source3/modules/onefs_streams.c
source3/modules/onefs_system.c
source3/modules/vfs_aio_fork.c
source3/modules/vfs_cacheprime.c
source3/modules/vfs_commit.c
source3/modules/vfs_crossrename.c
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_gpfs_hsm_notify.c
source3/modules/vfs_onefs.c
source3/modules/vfs_prealloc.c
source3/modules/vfs_readahead.c
source3/modules/vfs_recycle.c
source3/modules/vfs_smb_traffic_analyzer.c
source3/modules/vfs_streams_depot.c
source3/modules/vfs_streams_xattr.c
source3/modules/vfs_time_audit.c
source3/modules/vfs_tsmsm.c
source3/passdb/pdb_smbpasswd.c
source3/printing/nt_printing.c
source3/printing/printspoolss.c
source3/smbd/aio.c
source3/smbd/close.c
source3/smbd/dir.c
source3/smbd/fileio.c
source3/smbd/nttrans.c
source3/smbd/proto.h
source3/smbd/reply.c
source3/smbd/smb2_read.c
source3/smbd/trans2.c
source3/smbd/vfs.c
source3/torture/cmd_vfs.c
source3/torture/test_posix_append.c
source3/torture/torture.c
source3/torture/utable.c

index 40691ed7f9c97dc057e722fc35d0e6c7c5f90397..1a44a39f2df1cd1bae0a7870c94bddb7145a6b33 100644 (file)
@@ -183,7 +183,7 @@ static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, void
        return -1;
 }
 
-static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
+static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, off_t offset)
 {
        errno = ENOSYS;
        return -1;
@@ -195,25 +195,25 @@ static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const vo
        return -1;
 }
 
-static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
+static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, off_t offset)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
+static off_t skel_lseek(vfs_handle_struct *handle, files_struct *fsp, off_t offset, int whence)
 {
        errno = ENOSYS;
-       return (SMB_OFF_T)-1;
+       return (off_t)-1;
 }
 
-static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n)
+static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, off_t offset, size_t n)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
+static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, off_t offset, size_t n)
 {
        errno = ENOSYS;
        return -1;
@@ -314,7 +314,7 @@ static int skel_ntimes(vfs_handle_struct *handle,
        return -1;
 }
 
-static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
+static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, off_t offset)
 {
        errno = ENOSYS;
        return -1;
@@ -322,13 +322,13 @@ static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_
 
 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
                        enum vfs_fallocate_mode mode,
-                       SMB_OFF_T offset, SMB_OFF_T len)
+                       off_t offset, off_t len)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, off_t offset, off_t count, int type)
 {
        errno = ENOSYS;
        return false;
@@ -346,7 +346,7 @@ static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_st
        return -1;
 }
 
-static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid)
 {
        errno = ENOSYS;
        return false;
index 2d5fcdd63b7236f76b9a52bd5e2057668823812d..ba7e898cf8387a094ee203af2891d33dc208dfca 100644 (file)
@@ -189,7 +189,7 @@ static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, void
        return SMB_VFS_NEXT_READ(handle, fsp, data, n);
 }
 
-static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
+static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, off_t offset)
 {
        return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
 }
@@ -199,22 +199,22 @@ static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const vo
        return SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
 }
 
-static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
+static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, off_t offset)
 {
        return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
 }
 
-static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
+static off_t skel_lseek(vfs_handle_struct *handle, files_struct *fsp, off_t offset, int whence)
 {
        return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence);
 }
 
-static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n)
+static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, off_t offset, size_t n)
 {
        return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n);
 }
 
-static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
+static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, off_t offset, size_t n)
 {
        return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
 }
@@ -299,20 +299,20 @@ static int skel_ntimes(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft);
 }
 
-static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
+static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, off_t offset)
 {
        return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
 }
 
 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
                        enum vfs_fallocate_mode mode,
-                       SMB_OFF_T offset,
-                       SMB_OFF_T len)
+                       off_t offset,
+                       off_t len)
 {
        return SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
 }
 
-static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, off_t offset, off_t count, int type)
 {
        return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type);
 }
@@ -327,7 +327,7 @@ static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_st
        return SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype);
 }
 
-static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid)
 {
        return SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid);
 }
index 3bfe8e94a7ef419f444907a9534c829af16a113b..a4a7ebdeabda9b3f8c2b65eb37457e6212adc1a2 100644 (file)
@@ -251,7 +251,7 @@ static int readfile(uint8_t *b, int n, XFILE *f)
 
 struct push_state {
        XFILE *f;
-       SMB_OFF_T nread;
+       off_t nread;
 };
 
 static size_t push_source(uint8_t *buf, size_t n, void *priv)
@@ -1070,9 +1070,9 @@ static int do_get(const char *rname, const char *lname_in, bool reget)
        bool newhandle = false;
        struct timespec tp_start;
        uint16 attr;
-       SMB_OFF_T size;
+       off_t size;
        off_t start = 0;
-       SMB_OFF_T nread = 0;
+       off_t nread = 0;
        int rc = 0;
        struct cli_state *targetcli = NULL;
        char *targetname = NULL;
@@ -1678,7 +1678,7 @@ static int do_allinfo(const char *name)
 {
        fstring altname;
        struct timespec b_time, a_time, m_time, c_time;
-       SMB_OFF_T size;
+       off_t size;
        uint16_t mode;
        SMB_INO_T ino;
        NTTIME tmp;
@@ -1838,7 +1838,7 @@ static int do_put(const char *rname, const char *lname, bool reput)
        TALLOC_CTX *ctx = talloc_tos();
        uint16_t fnum;
        XFILE *f;
-       SMB_OFF_T start = 0;
+       off_t start = 0;
        int rc = 0;
        struct timespec tp_start;
        struct cli_state *targetcli;
index 43311c13ae0907c5581c3470be0bd07ad1bd6e58..b02ada427e84032c2c2c01186fdc8154652d0c94 100644 (file)
@@ -45,7 +45,7 @@ static int clipfind(char **aret, int ret, char *tok);
 typedef struct file_info_struct file_info2;
 
 struct file_info_struct {
-       SMB_OFF_T size;
+       off_t size;
        uint16 mode;
        uid_t uid;
        gid_t gid;
index 8e5b1cd41fe1d8e9b0b586f3d752f17616311c64..7bdd20074a44e7c1fe464a8f97e952836681335e 100644 (file)
@@ -298,10 +298,6 @@ typedef sig_atomic_t volatile SIG_ATOMIC_T;
 #define INO_T_VAL(p, ofs) ((SMB_INO_T)(IVAL((p),(ofs))))
 #endif
 
-#ifndef SMB_OFF_T
-#    define SMB_OFF_T off_t
-#endif
-
 /* TODO: remove this macros */
 #define SBIG_UINT(p, ofs, v) SBVAL(p, ofs, v)
 #define BIG_UINT(p, ofs) BVAL(p, ofs)
@@ -310,7 +306,7 @@ typedef sig_atomic_t volatile SIG_ATOMIC_T;
 /* this should really be a 64 bit type if possible */
 typedef uint64_t br_off;
 
-#define SMB_OFF_T_BITS (sizeof(SMB_OFF_T)*8)
+#define SMB_OFF_T_BITS (sizeof(off_t)*8)
 
 /*
  * Set the define that tells us if we can do 64 bit
@@ -319,7 +315,7 @@ typedef uint64_t br_off;
 
 #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
 #define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,(v)&0xFFFFFFFF), SIVAL(p,ofs,(v)>>32))
-#define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF) )))
+#define IVAL_TO_SMB_OFF_T(buf,off) ((off_t)(( ((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF) )))
 
 #ifndef HAVE_BLKSIZE_T
 /* This is mainly for HP/UX which defines st_blksize as long */
index 7f16ab6859b10421fdd6b43bf76c728a6226699c..0c8d8ab2701901b462480155fadb3f6ac1284dd2 100644 (file)
@@ -40,7 +40,7 @@
  */
 typedef struct DOS_ATTR_DESC {
        int mode;
-       SMB_OFF_T size;
+       off_t size;
        time_t create_time;
        time_t access_time;
        time_t write_time;
@@ -96,7 +96,7 @@ struct smbc_dir_list {
 struct _SMBCFILE {
        int cli_fd; 
        char *fname;
-       SMB_OFF_T offset;
+       off_t offset;
        struct _SMBCSRV *srv;
        bool file;
        struct smbc_dir_list *dir_list, *dir_end, *dir_next;
@@ -368,7 +368,7 @@ SMBC_getatr(SMBCCTX * context,
             SMBCSRV *srv,
             const char *path,
             uint16 *mode,
-            SMB_OFF_T *size,
+            off_t *size,
             struct timespec *create_time_ts,
             struct timespec *access_time_ts,
             struct timespec *write_time_ts,
index debf63f5e09c50a5d27c639fc0159863c8fe3580..3551d8e62ad239c445e690e30fdf5a5bdfbe04f9 100644 (file)
@@ -179,7 +179,7 @@ NTSTATUS print_spool_open(files_struct *fsp,
                          uint16_t current_vuid);
 
 int print_spool_write(files_struct *fsp, const char *data, uint32_t size,
-                     SMB_OFF_T offset, uint32_t *written);
+                     off_t offset, uint32_t *written);
 
 void print_spool_end(files_struct *fsp, enum file_close_type close_type);
 
index 1d3dba6a839e9274ff64e80b174ca16b5b7ae87f..34c9fe8e53765dd2528925f1a6e4b6903614232c 100644 (file)
@@ -192,17 +192,17 @@ void pidfile_unlink(void);
 
 ssize_t sys_recvfile(int fromfd,
                        int tofd,
-                       SMB_OFF_T offset,
+                       off_t offset,
                        size_t count);
 ssize_t sys_recvfile(int fromfd,
                        int tofd,
-                       SMB_OFF_T offset,
+                       off_t offset,
                        size_t count);
 ssize_t drain_socket(int sockfd, size_t count);
 
 /* The following definitions come from lib/sendfile.c  */
 
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count);
 
 /* The following definitions come from lib/server_mutex.c  */
 
@@ -321,8 +321,8 @@ int sys_set_nfs_quota(const char *path, const char *bdev,
 ssize_t sys_read(int fd, void *buf, size_t count);
 ssize_t sys_write(int fd, const void *buf, size_t count);
 ssize_t sys_writev(int fd, const struct iovec *iov, int iovcnt);
-ssize_t sys_pread(int fd, void *buf, size_t count, SMB_OFF_T off);
-ssize_t sys_pwrite(int fd, const void *buf, size_t count, SMB_OFF_T off);
+ssize_t sys_pread(int fd, void *buf, size_t count, off_t off);
+ssize_t sys_pwrite(int fd, const void *buf, size_t count, off_t off);
 ssize_t sys_send(int s, const void *msg, size_t len, int flags);
 ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen);
 int sys_fcntl_ptr(int fd, int cmd, void *arg);
@@ -334,8 +334,8 @@ int sys_fstat(int fd, SMB_STRUCT_STAT *sbuf,
              bool fake_dir_create_times);
 int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf,
              bool fake_dir_create_times);
-int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len);
-int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, SMB_OFF_T len);
+int sys_posix_fallocate(int fd, off_t offset, off_t len);
+int sys_fallocate(int fd, enum vfs_fallocate_mode mode, off_t offset, off_t len);
 void kernel_flock(int fd, uint32 share_mode, uint32 access_mask);
 DIR *sys_fdopendir(int fd);
 int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev);
@@ -458,7 +458,7 @@ int set_message_bcc(char *buf,int num_bytes);
 ssize_t message_push_blob(uint8 **outbuf, DATA_BLOB blob);
 char *unix_clean_name(TALLOC_CTX *ctx, const char *s);
 char *clean_name(TALLOC_CTX *ctx, const char *s);
-ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, SMB_OFF_T pos);
+ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, off_t pos);
 int set_blocking(int fd, bool set);
 NTSTATUS init_before_fork(void);
 NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
@@ -487,8 +487,8 @@ const char *readdirname(DIR *p);
 bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive);
 void set_namearray(name_compare_entry **ppname_array, const char *namelist);
 void free_namearray(name_compare_entry *name_array);
-bool fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
-bool fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid);
+bool fcntl_lock(int fd, int op, off_t offset, off_t count, int type);
+bool fcntl_getlock(int fd, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid);
 bool is_myname(const char *s);
 void ra_lanman_string( const char *native_lanman );
 const char *get_remote_arch_str(void);
index ddf3227336b010d31ebb56c916cb1d457769c963..758ad9959d129d419564bccb989dd5283a3a53ec 100644 (file)
@@ -128,8 +128,8 @@ typedef union unid_t {
 #include "librpc/gen_ndr/security.h"
 
 typedef struct write_cache {
-       SMB_OFF_T file_size;
-       SMB_OFF_T offset;
+       off_t file_size;
+       off_t offset;
        size_t alloc_size;
        size_t data_size;
        char *data;
@@ -139,7 +139,7 @@ struct fd_handle {
        size_t ref_count;
        int fd;
        uint64_t position_information;
-       SMB_OFF_T pos;
+       off_t pos;
        uint32 private_options; /* NT Create options, but we only look at
                                 * NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and
                                 * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB and
@@ -340,8 +340,8 @@ struct trans_state {
  */
 
 struct stream_struct {
-       SMB_OFF_T size;
-       SMB_OFF_T alloc_size;
+       off_t size;
+       off_t alloc_size;
        char *name;
 };
 
index 79ad9c4c349374bad86917c4e25f11533d6551cb..546104f8f37b746181c343083e6c791950877134 100644 (file)
@@ -27,6 +27,6 @@ ssize_t transfer_file_internal(void *in_file,
                               ssize_t (*read_fn)(void *, void *, size_t),
                               ssize_t (*write_fn)(void *, const void *, size_t));
 
-SMB_OFF_T transfer_file(int infd, int outfd, SMB_OFF_T n);
+off_t transfer_file(int infd, int outfd, off_t n);
 
 #endif /* __TRANSFER_FILE_H__ */
index 48b0973fe5ae8fffd06cd89ff428a32a61245610..e858235a91fe72592f355507c014d99bc1641783 100644 (file)
 /* Leave at 29 - not yet releases. Add fsctl. Richard Sharpe */
 /* Leave at 29 - not yet released. add SMB_VFS_GET_DFS_REFERRAL() - metze */
 /* Leave at 29 - not yet released. Remove l{list,get,set,remove}xattr - abartlet */
+/* Leave at 29 - not yet released. move to plain off_t - abartlet */
 #define SMB_VFS_INTERFACE_VERSION 29
 
 /*
@@ -241,12 +242,12 @@ struct vfs_fn_pointers {
                                   int *pinfo);
        int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp);
        ssize_t (*read_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n);
-       ssize_t (*pread_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, SMB_OFF_T offset);
+       ssize_t (*pread_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, off_t offset);
        ssize_t (*write_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n);
-       ssize_t (*pwrite_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset);
-       SMB_OFF_T (*lseek_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset, int whence);
-       ssize_t (*sendfile_fn)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
-       ssize_t (*recvfile_fn)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t count);
+       ssize_t (*pwrite_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, off_t offset);
+       off_t (*lseek_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t offset, int whence);
+       ssize_t (*sendfile_fn)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, off_t offset, size_t count);
+       ssize_t (*recvfile_fn)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, off_t offset, size_t count);
        int (*rename_fn)(struct vfs_handle_struct *handle,
                         const struct smb_filename *smb_fname_src,
                         const struct smb_filename *smb_fname_dst);
@@ -267,17 +268,17 @@ struct vfs_fn_pointers {
        int (*ntimes_fn)(struct vfs_handle_struct *handle,
                         const struct smb_filename *smb_fname,
                         struct smb_file_time *ft);
-       int (*ftruncate_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset);
+       int (*ftruncate_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t offset);
        int (*fallocate_fn)(struct vfs_handle_struct *handle,
                            struct files_struct *fsp,
                            enum vfs_fallocate_mode mode,
-                           SMB_OFF_T offset,
-                           SMB_OFF_T len);
-       bool (*lock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
+                           off_t offset,
+                           off_t len);
+       bool (*lock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, off_t offset, off_t count, int type);
        int (*kernel_flock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp,
                               uint32 share_mode, uint32_t access_mask);
        int (*linux_setlease_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype);
-       bool (*getlock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid);
+       bool (*getlock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid);
        int (*symlink_fn)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath);
        int (*readlink_fn)(struct vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz);
        int (*link_fn)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath);
@@ -598,21 +599,21 @@ ssize_t smb_vfs_call_read(struct vfs_handle_struct *handle,
                          struct files_struct *fsp, void *data, size_t n);
 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);
 ssize_t smb_vfs_call_write(struct vfs_handle_struct *handle,
                           struct files_struct *fsp, const void *data,
                           size_t n);
 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);
-SMB_OFF_T smb_vfs_call_lseek(struct vfs_handle_struct *handle,
-                            struct files_struct *fsp, SMB_OFF_T offset,
+                           size_t n, off_t offset);
+off_t smb_vfs_call_lseek(struct vfs_handle_struct *handle,
+                            struct files_struct *fsp, off_t offset,
                             int whence);
 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);
 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);
 int smb_vfs_call_rename(struct vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname_src,
@@ -646,23 +647,23 @@ int smb_vfs_call_ntimes(struct vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname,
                        struct smb_file_time *ft);
 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);
 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);
 bool smb_vfs_call_lock(struct vfs_handle_struct *handle,
-                      struct files_struct *fsp, int op, SMB_OFF_T offset,
-                      SMB_OFF_T count, int type);
+                      struct files_struct *fsp, int op, off_t offset,
+                      off_t count, int type);
 int smb_vfs_call_kernel_flock(struct vfs_handle_struct *handle,
                              struct files_struct *fsp, uint32 share_mode,
                              uint32_t access_mask);
 int smb_vfs_call_linux_setlease(struct vfs_handle_struct *handle,
                                struct files_struct *fsp, int leasetype);
 bool smb_vfs_call_getlock(struct vfs_handle_struct *handle,
-                         struct files_struct *fsp, SMB_OFF_T *poffset,
-                         SMB_OFF_T *pcount, int *ptype, pid_t *ppid);
+                         struct files_struct *fsp, off_t *poffset,
+                         off_t *pcount, int *ptype, pid_t *ppid);
 int smb_vfs_call_symlink(struct vfs_handle_struct *handle, const char *oldpath,
                         const char *newpath);
 int smb_vfs_call_readlink(struct vfs_handle_struct *handle,
index 6c8a1a3b5779e14b261920a09977240372588e7a..c53ba77e5c4ceeca1ddb9bc1855e117ea88a25e5 100644 (file)
@@ -44,7 +44,7 @@
 
 static ssize_t default_sys_recvfile(int fromfd,
                        int tofd,
-                       SMB_OFF_T offset,
+                       off_t offset,
                        size_t count)
 {
        int saved_errno = 0;
@@ -62,7 +62,7 @@ static ssize_t default_sys_recvfile(int fromfd,
                return 0;
        }
 
-       if (tofd != -1 && offset != (SMB_OFF_T)-1) {
+       if (tofd != -1 && offset != (off_t)-1) {
                if (lseek(tofd, offset, SEEK_SET) == -1) {
                        if (errno != ESPIPE) {
                                return -1;
@@ -140,7 +140,7 @@ static ssize_t default_sys_recvfile(int fromfd,
 
 ssize_t sys_recvfile(int fromfd,
                        int tofd,
-                       SMB_OFF_T offset,
+                       off_t offset,
                        size_t count)
 {
        static int pipefd[2] = { -1, -1 };
@@ -230,7 +230,7 @@ ssize_t sys_recvfile(int fromfd,
 
 ssize_t sys_recvfile(int fromfd,
                        int tofd,
-                       SMB_OFF_T offset,
+                       off_t offset,
                        size_t count)
 {
        return default_sys_recvfile(fromfd, tofd, offset, count);
index 50b522ed195705040b287f612b08f284e9923624..a9607fa82594fe27de088ce758653165c37b4bf8 100644 (file)
@@ -33,7 +33,7 @@
 #define MSG_MORE 0x8000
 #endif
 
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
 {
        size_t total=0;
        ssize_t ret;
@@ -103,7 +103,7 @@ extern int32 sendfile (int out_fd, int in_fd, int32 *offset, uint32 count);
 #define MSG_MORE 0x8000
 #endif
 
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
 {
        size_t total=0;
        ssize_t ret;
@@ -118,7 +118,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
         * and uses a normal read. JRA.
         */
 
-       if ((sizeof(SMB_OFF_T) >= 8) && (offset + count > (SMB_OFF_T)0x7FFFFFFF)) {
+       if ((sizeof(off_t) >= 8) && (offset + count > (off_t)0x7FFFFFFF)) {
                errno = ENOSYS;
                return -1;
        }
@@ -184,7 +184,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
 
 #include <sys/sendfile.h>
 
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
 {
        int sfvcnt;
        size_t total, xferred;
@@ -270,7 +270,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
 #include <sys/socket.h>
 #include <sys/uio.h>
 
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
 {
        size_t total=0;
        struct iovec hdtrl[2];
@@ -341,7 +341,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
 #include <sys/socket.h>
 #include <sys/uio.h>
 
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
 {
        size_t total=0;
        struct sf_hdtr hdr;
@@ -364,7 +364,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
 
        total = count;
        while (total + hdtrl.iov_len) {
-               SMB_OFF_T nwritten;
+               off_t nwritten;
                int ret;
 
                /*
@@ -418,7 +418,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
 /* Contributed by William Jojo <jojowil@hvcc.edu> */
 #include <sys/socket.h>
 
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
 {
        struct sf_parms hdtrl;
 
@@ -472,7 +472,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
 
 #else /* No sendfile implementation. Return error. */
 
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
 {
        /* No sendfile syscall. */
        errno = ENOSYS;
index 8a381732cd0f143b7d5e9d5999b576141156c51b..8a0b0f154e83a6b29d4de547ca318e8c9d0091e4 100644 (file)
@@ -121,7 +121,7 @@ A pread wrapper that will deal with EINTR
 ********************************************************************/
 
 #if defined(HAVE_PREAD)
-ssize_t sys_pread(int fd, void *buf, size_t count, SMB_OFF_T off)
+ssize_t sys_pread(int fd, void *buf, size_t count, off_t off)
 {
        ssize_t ret;
 
@@ -137,7 +137,7 @@ A write wrapper that will deal with EINTR
 ********************************************************************/
 
 #if defined(HAVE_PWRITE)
-ssize_t sys_pwrite(int fd, const void *buf, size_t count, SMB_OFF_T off)
+ssize_t sys_pwrite(int fd, const void *buf, size_t count, off_t off)
 {
        ssize_t ret;
 
@@ -517,14 +517,14 @@ int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf,
 /*******************************************************************
  An posix_fallocate() wrapper.
 ********************************************************************/
-int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len)
+int sys_posix_fallocate(int fd, off_t offset, off_t len)
 {
 #if defined(HAVE_POSIX_FALLOCATE) && !defined(HAVE_BROKEN_POSIX_FALLOCATE)
        return posix_fallocate(fd, offset, len);
 #elif defined(F_RESVSP64)
        /* this handles XFS on IRIX */
        struct flock64 fl;
-       SMB_OFF_T new_len = offset + len;
+       off_t new_len = offset + len;
        int ret;
        struct stat64 sbuf;
 
@@ -559,7 +559,7 @@ int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len)
 #include <linux/falloc.h>
 #endif
 
-int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, SMB_OFF_T len)
+int sys_fallocate(int fd, enum vfs_fallocate_mode mode, off_t offset, off_t len)
 {
 #if defined(HAVE_LINUX_FALLOCATE64) || defined(HAVE_LINUX_FALLOCATE)
        int lmode;
index 22fc1e7abe6a4e60146427dd051ac34f2389822e..e43cfbbcb88137213ccf19d0c459ded41559ba8e 100644 (file)
@@ -320,12 +320,12 @@ char *clean_name(TALLOC_CTX *ctx, const char *s)
  Write data into an fd at a given offset. Ignore seek errors.
 ********************************************************************/
 
-ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, SMB_OFF_T pos)
+ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, off_t pos)
 {
        size_t total=0;
        ssize_t ret;
 
-       if (pos == (SMB_OFF_T)-1) {
+       if (pos == (off_t)-1) {
                return write_data(fd, buffer, N);
        }
 #if defined(HAVE_PWRITE) || defined(HAVE_PRWITE64)
@@ -1213,7 +1213,7 @@ void set_namearray(name_compare_entry **ppname_array, const char *namelist_in)
  F_UNLCK in *ptype if the region is unlocked). False if the call failed.
 ****************************************************************************/
 
-bool fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+bool fcntl_getlock(int fd, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid)
 {
        struct flock lock;
        int ret;
index 8303b2bfe1998c1738e4e3698d50f9a5dcb2d14d..37a7d6e248c61e3311dc4a5ca792cbfeb1cdae1b 100644 (file)
@@ -104,8 +104,8 @@ static ssize_t sys_write_fn(void *file, const void *buf, size_t len)
        return sys_write(*fd, buf, len);
 }
 
-SMB_OFF_T transfer_file(int infd, int outfd, SMB_OFF_T n)
+off_t transfer_file(int infd, int outfd, off_t n)
 {
-       return (SMB_OFF_T)transfer_file_internal(&infd, &outfd, (size_t)n,
+       return (off_t)transfer_file_internal(&infd, &outfd, (size_t)n,
                                                 sys_read_fn, sys_write_fn);
 }
index 1a67bcdd981b5fb02f3f10a85c3772c827f80e07..38b95e2457adeb06c50c304739d37e11d7b0c232 100644 (file)
@@ -3238,7 +3238,7 @@ struct cli_getattrE_state {
        uint16_t vwv[1];
        int zone_offset;
        uint16_t attr;
-       SMB_OFF_T size;
+       off_t size;
        time_t change_time;
        time_t access_time;
        time_t write_time;
@@ -3288,7 +3288,7 @@ static void cli_getattrE_done(struct tevent_req *subreq)
                return;
        }
 
-       state->size = (SMB_OFF_T)IVAL(vwv+6,0);
+       state->size = (off_t)IVAL(vwv+6,0);
        state->attr = SVAL(vwv+10,0);
        state->change_time = make_unix_date2(vwv+0, state->zone_offset);
        state->access_time = make_unix_date2(vwv+2, state->zone_offset);
@@ -3299,7 +3299,7 @@ static void cli_getattrE_done(struct tevent_req *subreq)
 
 NTSTATUS cli_getattrE_recv(struct tevent_req *req,
                        uint16_t *attr,
-                       SMB_OFF_T *size,
+                       off_t *size,
                        time_t *change_time,
                        time_t *access_time,
                        time_t *write_time)
@@ -3332,7 +3332,7 @@ NTSTATUS cli_getattrE_recv(struct tevent_req *req,
 NTSTATUS cli_getattrE(struct cli_state *cli,
                        uint16_t fnum,
                        uint16_t *attr,
-                       SMB_OFF_T *size,
+                       off_t *size,
                        time_t *change_time,
                        time_t *access_time,
                        time_t *write_time)
@@ -3388,7 +3388,7 @@ static void cli_getatr_done(struct tevent_req *subreq);
 struct cli_getatr_state {
        int zone_offset;
        uint16_t attr;
-       SMB_OFF_T size;
+       off_t size;
        time_t write_time;
 };
 
@@ -3449,7 +3449,7 @@ static void cli_getatr_done(struct tevent_req *subreq)
        }
 
        state->attr = SVAL(vwv+0,0);
-       state->size = (SMB_OFF_T)IVAL(vwv+3,0);
+       state->size = (off_t)IVAL(vwv+3,0);
        state->write_time = make_unix_date3(vwv+1, state->zone_offset);
 
        tevent_req_done(req);
@@ -3457,7 +3457,7 @@ static void cli_getatr_done(struct tevent_req *subreq)
 
 NTSTATUS cli_getatr_recv(struct tevent_req *req,
                        uint16_t *attr,
-                       SMB_OFF_T *size,
+                       off_t *size,
                        time_t *write_time)
 {
        struct cli_getatr_state *state = tevent_req_data(
@@ -3482,7 +3482,7 @@ NTSTATUS cli_getatr_recv(struct tevent_req *req,
 NTSTATUS cli_getatr(struct cli_state *cli,
                        const char *fname,
                        uint16_t *attr,
-                       SMB_OFF_T *size,
+                       off_t *size,
                        time_t *write_time)
 {
        TALLOC_CTX *frame = talloc_stackframe();
index b20d0893822a226a346b4c7d677e9a95e7c883d9..2815243f2fbd2201769b45016e3908e9dc7d858c 100644 (file)
@@ -620,7 +620,7 @@ NTSTATUS cli_qpathinfo1_recv(struct tevent_req *req,
                             time_t *change_time,
                             time_t *access_time,
                             time_t *write_time,
-                            SMB_OFF_T *size,
+                            off_t *size,
                             uint16 *mode)
 {
        struct cli_qpathinfo1_state *state = tevent_req_data(
@@ -662,7 +662,7 @@ NTSTATUS cli_qpathinfo1(struct cli_state *cli,
                        time_t *change_time,
                        time_t *access_time,
                        time_t *write_time,
-                       SMB_OFF_T *size,
+                       off_t *size,
                        uint16 *mode)
 {
        TALLOC_CTX *frame = talloc_stackframe();
@@ -797,7 +797,7 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req,
                             struct timespec *access_time,
                             struct timespec *write_time,
                             struct timespec *change_time,
-                            SMB_OFF_T *size, uint16 *mode,
+                            off_t *size, uint16 *mode,
                             SMB_INO_T *ino)
 {
        struct cli_qpathinfo2_state *state = tevent_req_data(
@@ -837,7 +837,7 @@ NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname,
                        struct timespec *access_time,
                        struct timespec *write_time,
                        struct timespec *change_time,
-                       SMB_OFF_T *size, uint16 *mode,
+                       off_t *size, uint16 *mode,
                        SMB_INO_T *ino)
 {
        TALLOC_CTX *frame = talloc_stackframe();
@@ -1114,7 +1114,7 @@ NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum,
 ****************************************************************************/
 
 NTSTATUS cli_qfileinfo_basic(struct cli_state *cli, uint16_t fnum,
-                            uint16 *mode, SMB_OFF_T *size,
+                            uint16 *mode, off_t *size,
                             struct timespec *create_time,
                             struct timespec *access_time,
                             struct timespec *write_time,
index de770dba7e2ffada9900518e95df8b12bd1fab10..32f1b11e1b6d64cbd16664cd0aa20c9b32a2357f 100644 (file)
@@ -49,14 +49,14 @@ NTSTATUS cli_qpathinfo1_recv(struct tevent_req *req,
                             time_t *change_time,
                             time_t *access_time,
                             time_t *write_time,
-                            SMB_OFF_T *size,
+                            off_t *size,
                             uint16 *mode);
 NTSTATUS cli_qpathinfo1(struct cli_state *cli,
                        const char *fname,
                        time_t *change_time,
                        time_t *access_time,
                        time_t *write_time,
-                       SMB_OFF_T *size,
+                       off_t *size,
                        uint16 *mode);
 NTSTATUS cli_setpathinfo_basic(struct cli_state *cli, const char *fname,
                               time_t create_time,
@@ -73,14 +73,14 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req,
                             struct timespec *access_time,
                             struct timespec *write_time,
                             struct timespec *change_time,
-                            SMB_OFF_T *size, uint16 *mode,
+                            off_t *size, uint16 *mode,
                             SMB_INO_T *ino);
 NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname,
                        struct timespec *create_time,
                        struct timespec *access_time,
                        struct timespec *write_time,
                        struct timespec *change_time,
-                       SMB_OFF_T *size, uint16 *mode,
+                       off_t *size, uint16 *mode,
                        SMB_INO_T *ino);
 struct tevent_req *cli_qpathinfo_streams_send(TALLOC_CTX *mem_ctx,
                                              struct tevent_context *ev,
@@ -97,7 +97,7 @@ NTSTATUS cli_qpathinfo_streams(struct cli_state *cli, const char *fname,
 NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum,
                       TALLOC_CTX *mem_ctx, char **name);
 NTSTATUS cli_qfileinfo_basic(struct cli_state *cli, uint16_t fnum,
-                            uint16 *mode, SMB_OFF_T *size,
+                            uint16 *mode, off_t *size,
                             struct timespec *create_time,
                             struct timespec *access_time,
                             struct timespec *write_time,
index 8e845ee637eaefb849e0f51138fa1bcbbcd8eec4..8f137c0e81ee6d443e9b305c8987c775ed8e7cec 100644 (file)
@@ -415,7 +415,7 @@ struct cli_pull_state {
        struct cli_state *cli;
        uint16_t fnum;
        off_t start_offset;
-       SMB_OFF_T size;
+       off_t size;
 
        NTSTATUS (*sink)(char *buf, size_t n, void *priv);
        void *priv;
@@ -432,7 +432,7 @@ struct cli_pull_state {
        /*
         * For how many bytes did we send requests already?
         */
-       SMB_OFF_T requested;
+       off_t requested;
 
        /*
         * Next request index to push into "sink". This walks around the "req"
@@ -446,7 +446,7 @@ struct cli_pull_state {
         * How many bytes did we push into "sink"?
         */
 
-       SMB_OFF_T pushed;
+       off_t pushed;
 };
 
 static char *cli_pull_print(struct tevent_req *req, TALLOC_CTX *mem_ctx)
@@ -475,7 +475,7 @@ struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
                                 struct event_context *ev,
                                 struct cli_state *cli,
                                 uint16_t fnum, off_t start_offset,
-                                SMB_OFF_T size, size_t window_size,
+                                off_t size, size_t window_size,
                                 NTSTATUS (*sink)(char *buf, size_t n,
                                                  void *priv),
                                 void *priv)
@@ -528,7 +528,7 @@ struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
 
        for (i=0; i<state->num_reqs; i++) {
                struct cli_pull_subreq *subreq = &state->reqs[i];
-               SMB_OFF_T size_left;
+               off_t size_left;
                size_t request_thistime;
 
                if (state->requested >= size) {
@@ -629,7 +629,7 @@ static void cli_pull_read_done(struct tevent_req *subreq)
 
                if (state->requested < state->size) {
                        struct tevent_req *new_req;
-                       SMB_OFF_T size_left;
+                       off_t size_left;
                        size_t request_thistime;
 
                        size_left = state->size - state->requested;
@@ -664,7 +664,7 @@ static void cli_pull_read_done(struct tevent_req *subreq)
        tevent_req_done(req);
 }
 
-NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received)
+NTSTATUS cli_pull_recv(struct tevent_req *req, off_t *received)
 {
        struct cli_pull_state *state = tevent_req_data(
                req, struct cli_pull_state);
@@ -678,9 +678,9 @@ NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received)
 }
 
 NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
-                 off_t start_offset, SMB_OFF_T size, size_t window_size,
+                 off_t start_offset, off_t size, size_t window_size,
                  NTSTATUS (*sink)(char *buf, size_t n, void *priv),
-                 void *priv, SMB_OFF_T *received)
+                 void *priv, off_t *received)
 {
        TALLOC_CTX *frame = talloc_stackframe();
        struct event_context *ev;
@@ -732,7 +732,7 @@ NTSTATUS cli_read(struct cli_state *cli, uint16_t fnum,
                 size_t *nread)
 {
        NTSTATUS status;
-       SMB_OFF_T ret;
+       off_t ret;
 
        status = cli_pull(cli, fnum, offset, size, size,
                          cli_read_sink, &buf, &ret);
index ef93dd064bd32322767f82180c57c1546c832e4b..61d1a726da80dc399076380812190394bc8f0e2a 100644 (file)
@@ -1818,7 +1818,7 @@ SMBC_unlink_ctx(SMBCCTX *context,
                if (errno == EACCES) { /* Check if the file is a directory */
 
                        int saverr = errno;
-                       SMB_OFF_T size = 0;
+                       off_t size = 0;
                        uint16 mode = 0;
                        struct timespec write_time_ts;
                         struct timespec access_time_ts;
index b5932c8164a9db13ad31823e17796e936dcbd787..c09011bb0ae6b5a0c1ad01a2bab682ebd67b3837 100644 (file)
@@ -489,7 +489,7 @@ SMBC_getatr(SMBCCTX * context,
             SMBCSRV *srv,
             const char *path,
             uint16 *mode,
-            SMB_OFF_T *size,
+            off_t *size,
             struct timespec *create_time_ts,
             struct timespec *access_time_ts,
             struct timespec *write_time_ts,
@@ -679,7 +679,7 @@ SMBC_lseek_ctx(SMBCCTX *context,
                off_t offset,
                int whence)
 {
-       SMB_OFF_T size;
+       off_t size;
        char *server = NULL, *share = NULL, *user = NULL, *password = NULL;
        char *path = NULL;
        char *targetpath = NULL;
@@ -745,7 +745,7 @@ SMBC_lseek_ctx(SMBCCTX *context,
                                             targetcli, file->cli_fd, NULL,
                                             &size, NULL, NULL, NULL, NULL,
                                             NULL))) {
-                        SMB_OFF_T b_size = size;
+                        off_t b_size = size;
                        if (!NT_STATUS_IS_OK(cli_getattrE(targetcli, file->cli_fd,
                                           NULL, &b_size, NULL, NULL, NULL))) {
                                 errno = EINVAL;
@@ -775,7 +775,7 @@ SMBC_ftruncate_ctx(SMBCCTX *context,
                    SMBCFILE *file,
                    off_t length)
 {
-       SMB_OFF_T size = length;
+       off_t size = length;
        char *server = NULL;
        char *share = NULL;
        char *user = NULL;
index 30b9291903a2a0175f2cd66522b27994ed3db0f3..2a08b30d70df38a1a310dcf16e654d87aa971da6 100644 (file)
@@ -54,7 +54,7 @@ static int
 setup_stat(SMBCCTX *context,
            struct stat *st,
            const char *fname,
-           SMB_OFF_T size,
+           off_t size,
            int mode)
 {
        TALLOC_CTX *frame = talloc_stackframe();
@@ -118,7 +118,7 @@ SMBC_stat_ctx(SMBCCTX *context,
        struct timespec write_time_ts;
         struct timespec access_time_ts;
         struct timespec change_time_ts;
-       SMB_OFF_T size = 0;
+       off_t size = 0;
        uint16 mode = 0;
        SMB_INO_T ino = 0;
        TALLOC_CTX *frame = talloc_stackframe();
@@ -204,7 +204,7 @@ SMBC_fstat_ctx(SMBCCTX *context,
        struct timespec change_time_ts;
         struct timespec access_time_ts;
         struct timespec write_time_ts;
-       SMB_OFF_T size;
+       off_t size;
        uint16 mode;
        char *server = NULL;
        char *share = NULL;
index 5ed38415bf62abfb5e40290a0c7b417eaf3904aa..199f2259754cd15f8b712dde981a8e76e18d5cde 100644 (file)
@@ -556,7 +556,7 @@ dos_attr_query(SMBCCTX *context,
         struct timespec write_time_ts;
         struct timespec access_time_ts;
         struct timespec change_time_ts;
-        SMB_OFF_T size = 0;
+        off_t size = 0;
         uint16 mode = 0;
        SMB_INO_T inode = 0;
         DOS_ATTR_DESC *ret;
@@ -651,7 +651,7 @@ dos_attr_parse(SMBCCTX *context,
                }
 
                if (strncasecmp_m(tok, "SIZE:", 5) == 0) {
-                        dad->size = (SMB_OFF_T)atof(tok+5);
+                        dad->size = (off_t)atof(tok+5);
                        continue;
                }
 
@@ -743,7 +743,7 @@ cacl_get(SMBCCTX *context,
        time_t write_time = (time_t)0;
         time_t access_time = (time_t)0;
         time_t change_time = (time_t)0;
-       SMB_OFF_T size = 0;
+       off_t size = 0;
        uint16 mode = 0;
        SMB_INO_T ino = 0;
        struct cli_state *cli = srv->cli;
index 336c95f07c0a79c7f1dfac0110b121ac0d8c85b3..735c36aeb6584b84c6da140d0855e5a12152b325 100644 (file)
@@ -465,14 +465,14 @@ struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
                                 uint16_t fnum);
 NTSTATUS cli_getattrE_recv(struct tevent_req *req,
                         uint16_t *attr,
-                        SMB_OFF_T *size,
+                        off_t *size,
                         time_t *change_time,
                         time_t *access_time,
                         time_t *write_time);
 NTSTATUS cli_getattrE(struct cli_state *cli,
                        uint16_t fnum,
                        uint16_t *attr,
-                       SMB_OFF_T *size,
+                       off_t *size,
                        time_t *change_time,
                        time_t *access_time,
                        time_t *write_time);
@@ -495,12 +495,12 @@ struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
                                const char *fname);
 NTSTATUS cli_getatr_recv(struct tevent_req *req,
                                uint16_t *attr,
-                               SMB_OFF_T *size,
+                               off_t *size,
                                time_t *write_time);
 NTSTATUS cli_getatr(struct cli_state *cli,
                        const char *fname,
                        uint16_t *attr,
-                       SMB_OFF_T *size,
+                       off_t *size,
                        time_t *write_time);
 struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
                                struct event_context *ev,
@@ -765,15 +765,15 @@ struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
                                 struct event_context *ev,
                                 struct cli_state *cli,
                                 uint16_t fnum, off_t start_offset,
-                                SMB_OFF_T size, size_t window_size,
+                                off_t size, size_t window_size,
                                 NTSTATUS (*sink)(char *buf, size_t n,
                                                  void *priv),
                                 void *priv);
-NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received);
+NTSTATUS cli_pull_recv(struct tevent_req *req, off_t *received);
 NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
-                 off_t start_offset, SMB_OFF_T size, size_t window_size,
+                 off_t start_offset, off_t size, size_t window_size,
                  NTSTATUS (*sink)(char *buf, size_t n, void *priv),
-                 void *priv, SMB_OFF_T *received);
+                 void *priv, off_t *received);
 NTSTATUS cli_read(struct cli_state *cli, uint16_t fnum,
                  char *buf, off_t offset, size_t size,
                  size_t *nread);
index b219c75fb3df5720dc1c98577d397f598b3d875f..463aa21fd82ecb310b5b109c81026cc894c359f3 100644 (file)
@@ -83,29 +83,29 @@ static const char *posix_lock_type_name(int lock_type)
  False if not.
 ****************************************************************************/
 
-static bool posix_lock_in_range(SMB_OFF_T *offset_out, SMB_OFF_T *count_out,
+static bool posix_lock_in_range(off_t *offset_out, off_t *count_out,
                                uint64_t u_offset, uint64_t u_count)
 {
-       SMB_OFF_T offset = (SMB_OFF_T)u_offset;
-       SMB_OFF_T count = (SMB_OFF_T)u_count;
+       off_t offset = (off_t)u_offset;
+       off_t count = (off_t)u_count;
 
        /*
         * For the type of system we are, attempt to
-        * find the maximum positive lock offset as an SMB_OFF_T.
+        * find the maximum positive lock offset as an off_t.
         */
 
 #if defined(MAX_POSITIVE_LOCK_OFFSET) /* Some systems have arbitrary limits. */
 
-       SMB_OFF_T max_positive_lock_offset = (MAX_POSITIVE_LOCK_OFFSET);
+       off_t max_positive_lock_offset = (MAX_POSITIVE_LOCK_OFFSET);
 #else
        /*
-        * In this case SMB_OFF_T is 64 bits,
+        * In this case off_t is 64 bits,
         * and the underlying system can handle 64 bit signed locks.
         */
 
-       SMB_OFF_T mask2 = ((SMB_OFF_T)0x4) << (SMB_OFF_T_BITS-4);
-       SMB_OFF_T mask = (mask2<<1);
-       SMB_OFF_T max_positive_lock_offset = ~mask;
+       off_t mask2 = ((off_t)0x4) << (SMB_OFF_T_BITS-4);
+       off_t mask = (mask2<<1);
+       off_t max_positive_lock_offset = ~mask;
 
 #endif
        /*
@@ -114,7 +114,7 @@ static bool posix_lock_in_range(SMB_OFF_T *offset_out, SMB_OFF_T *count_out,
         * any Win32 locks of length zero. JRA.
         */
 
-       if (count == (SMB_OFF_T)0) {
+       if (count == (off_t)0) {
                DEBUG(10,("posix_lock_in_range: count = 0, ignoring.\n"));
                return False;
        }
@@ -170,8 +170,8 @@ static bool posix_lock_in_range(SMB_OFF_T *offset_out, SMB_OFF_T *count_out,
 }
 
 bool smb_vfs_call_lock(struct vfs_handle_struct *handle,
-                      struct files_struct *fsp, int op, SMB_OFF_T offset,
-                      SMB_OFF_T count, int type)
+                      struct files_struct *fsp, int op, off_t offset,
+                      off_t count, int type)
 {
        VFS_FIND(lock);
        return handle->fns->lock_fn(handle, fsp, op, offset, count, type);
@@ -182,7 +182,7 @@ bool smb_vfs_call_lock(struct vfs_handle_struct *handle,
  broken NFS implementations.
 ****************************************************************************/
 
-static bool posix_fcntl_lock(files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+static bool posix_fcntl_lock(files_struct *fsp, int op, off_t offset, off_t count, int type)
 {
        bool ret;
 
@@ -202,12 +202,12 @@ static bool posix_fcntl_lock(files_struct *fsp, int op, SMB_OFF_T offset, SMB_OF
                 * 32 bit NFS mounted filesystems. Just ignore it.
                 */
 
-               if (offset & ~((SMB_OFF_T)0x7fffffff)) {
+               if (offset & ~((off_t)0x7fffffff)) {
                        DEBUG(0,("Offset greater than 31 bits. Returning success.\n"));
                        return True;
                }
 
-               if (count & ~((SMB_OFF_T)0x7fffffff)) {
+               if (count & ~((off_t)0x7fffffff)) {
                        /* 32 bit NFS file system, retry with smaller offset */
                        DEBUG(0,("Count greater than 31 bits - retrying with 31 bit truncated length.\n"));
                        errno = 0;
@@ -221,8 +221,8 @@ static bool posix_fcntl_lock(files_struct *fsp, int op, SMB_OFF_T offset, SMB_OF
 }
 
 bool smb_vfs_call_getlock(struct vfs_handle_struct *handle,
-                         struct files_struct *fsp, SMB_OFF_T *poffset,
-                         SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+                         struct files_struct *fsp, off_t *poffset,
+                         off_t *pcount, int *ptype, pid_t *ppid)
 {
        VFS_FIND(getlock);
        return handle->fns->getlock_fn(handle, fsp, poffset, pcount, ptype, 
@@ -234,7 +234,7 @@ bool smb_vfs_call_getlock(struct vfs_handle_struct *handle,
  broken NFS implementations.
 ****************************************************************************/
 
-static bool posix_fcntl_getlock(files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype)
+static bool posix_fcntl_getlock(files_struct *fsp, off_t *poffset, off_t *pcount, int *ptype)
 {
        pid_t pid;
        bool ret;
@@ -256,12 +256,12 @@ static bool posix_fcntl_getlock(files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T
                 * 32 bit NFS mounted filesystems. Just ignore it.
                 */
 
-               if (*poffset & ~((SMB_OFF_T)0x7fffffff)) {
+               if (*poffset & ~((off_t)0x7fffffff)) {
                        DEBUG(0,("Offset greater than 31 bits. Returning success.\n"));
                        return True;
                }
 
-               if (*pcount & ~((SMB_OFF_T)0x7fffffff)) {
+               if (*pcount & ~((off_t)0x7fffffff)) {
                        /* 32 bit NFS file system, retry with smaller offset */
                        DEBUG(0,("Count greater than 31 bits - retrying with 31 bit truncated length.\n"));
                        errno = 0;
@@ -285,8 +285,8 @@ bool is_posix_locked(files_struct *fsp,
                        enum brl_type *plock_type,
                        enum brl_flavour lock_flav)
 {
-       SMB_OFF_T offset;
-       SMB_OFF_T count;
+       off_t offset;
+       off_t count;
        int posix_lock_type = map_posix_lock_type(fsp,*plock_type);
 
        DEBUG(10,("is_posix_locked: File %s, offset = %.0f, count = %.0f, "
@@ -735,8 +735,8 @@ int fd_close_posix(struct files_struct *fsp)
 struct lock_list {
        struct lock_list *next;
        struct lock_list *prev;
-       SMB_OFF_T start;
-       SMB_OFF_T size;
+       off_t start;
+       off_t size;
 };
 
 /****************************************************************************
@@ -973,8 +973,8 @@ bool set_posix_lock_windows_flavour(files_struct *fsp,
                        int num_locks,
                        int *errno_ret)
 {
-       SMB_OFF_T offset;
-       SMB_OFF_T count;
+       off_t offset;
+       off_t count;
        int posix_lock_type = map_posix_lock_type(fsp,lock_type);
        bool ret = True;
        size_t lock_count;
@@ -1111,8 +1111,8 @@ bool release_posix_lock_windows_flavour(files_struct *fsp,
                                const struct lock_struct *plocks,
                                int num_locks)
 {
-       SMB_OFF_T offset;
-       SMB_OFF_T count;
+       off_t offset;
+       off_t count;
        bool ret = True;
        TALLOC_CTX *ul_ctx = NULL;
        struct lock_list *ulist = NULL;
@@ -1233,8 +1233,8 @@ bool set_posix_lock_posix_flavour(files_struct *fsp,
                        enum brl_type lock_type,
                        int *errno_ret)
 {
-       SMB_OFF_T offset;
-       SMB_OFF_T count;
+       off_t offset;
+       off_t count;
        int posix_lock_type = map_posix_lock_type(fsp,lock_type);
 
        DEBUG(5,("set_posix_lock_posix_flavour: File %s, offset = %.0f, count "
@@ -1277,8 +1277,8 @@ bool release_posix_lock_posix_flavour(files_struct *fsp,
                                int num_locks)
 {
        bool ret = True;
-       SMB_OFF_T offset;
-       SMB_OFF_T count;
+       off_t offset;
+       off_t count;
        TALLOC_CTX *ul_ctx = NULL;
        struct lock_list *ulist = NULL;
        struct lock_list *ul = NULL;
index 1f72a9f20704a0c0b7faafb1336e847208b93969..b12a67e36720a1f44cc1572918510a98b8b65bc4 100644 (file)
@@ -163,10 +163,10 @@ int onefs_sys_create_file(connection_struct *conn,
                          int *granted_oplock);
 
 ssize_t onefs_sys_sendfile(connection_struct *conn, int tofd, int fromfd,
-                          const DATA_BLOB *header, SMB_OFF_T offset,
+                          const DATA_BLOB *header, off_t offset,
                           size_t count);
 
-ssize_t onefs_sys_recvfile(int fromfd, int tofd, SMB_OFF_T offset,
+ssize_t onefs_sys_recvfile(int fromfd, int tofd, off_t offset,
                           size_t count);
 
 void init_stat_ex_from_onefs_stat(struct stat_ex *dst, const struct stat *src);
index c79619922ca0ce5a07a4b6768af695d008339834..0a1d98c809a9e2e53eb4e13cea1dbed1e7c7a24c 100644 (file)
@@ -547,8 +547,8 @@ struct streaminfo_state {
 
 static bool add_one_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
                           struct stream_struct **streams,
-                          const char *name, SMB_OFF_T size,
-                          SMB_OFF_T alloc_size)
+                          const char *name, off_t size,
+                          off_t alloc_size)
 {
        struct stream_struct *tmp;
 
index 05b033181ea9d5e4de84d680baea150fcb238ce3..07272cc86b5ffc9e9bf5d223079aceba224fbcab 100644 (file)
@@ -230,7 +230,7 @@ int onefs_sys_create_file(connection_struct *conn,
  * FreeBSD based sendfile implementation that allows for atomic semantics.
  */
 static ssize_t onefs_sys_do_sendfile(int tofd, int fromfd,
-    const DATA_BLOB *header, SMB_OFF_T offset, size_t count, bool atomic)
+    const DATA_BLOB *header, off_t offset, size_t count, bool atomic)
 {
        size_t total=0;
        struct sf_hdtr hdr;
@@ -258,7 +258,7 @@ static ssize_t onefs_sys_do_sendfile(int tofd, int fromfd,
 
        total = count;
        while (total + hdtrl.iov_len) {
-               SMB_OFF_T nwritten;
+               off_t nwritten;
                int ret;
 
                /*
@@ -330,7 +330,7 @@ static ssize_t onefs_sys_do_sendfile(int tofd, int fromfd,
  * Handles the subtleties of using sendfile with CIFS.
  */
 ssize_t onefs_sys_sendfile(connection_struct *conn, int tofd, int fromfd,
-                          const DATA_BLOB *header, SMB_OFF_T offset,
+                          const DATA_BLOB *header, off_t offset,
                           size_t count)
 {
        bool atomic = false;
@@ -536,7 +536,7 @@ static char *get_spill_buffer(size_t new_count)
  * from the socket into the buffer, the spill buffer is then written with a
  * standard pwrite.
  */
-ssize_t onefs_sys_recvfile(int fromfd, int tofd, SMB_OFF_T offset,
+ssize_t onefs_sys_recvfile(int fromfd, int tofd, off_t offset,
                           size_t count)
 {
        char *spill_buffer = NULL;
index fa3db933a3956773c9e533157c7b43d9fa68c250..0d928cb5222e6daaf98bfdaa1fea8a98a4edcd57 100644 (file)
@@ -78,7 +78,7 @@ fail:
 
 struct rw_cmd {
        size_t n;
-       SMB_OFF_T offset;
+       off_t offset;
        bool read_cmd;
 };
 
index bd11797f6b18d61aeadf90e484e95704141df25b..65e63e2b397ee49701a033da541ff10982acaee8 100644 (file)
@@ -49,13 +49,13 @@ static void * g_readbuf = NULL;
 static bool prime_cache(
             struct vfs_handle_struct *  handle,
                        files_struct *                  fsp,
-                       SMB_OFF_T                           offset,
+                       off_t                       offset,
                        size_t                              count)
 {
-        SMB_OFF_T * last;
+        off_t * last;
         ssize_t nread;
 
-        last = (SMB_OFF_T *)VFS_ADD_FSP_EXTENSION(handle, fsp, SMB_OFF_T, NULL);
+        last = (off_t *)VFS_ADD_FSP_EXTENSION(handle, fsp, off_t, NULL);
         if (!last) {
                 return False;
         }
@@ -134,7 +134,7 @@ static ssize_t cprime_sendfile(
                 int                         tofd,
                 files_struct *              fromfsp,
                 const DATA_BLOB *           header,
-                SMB_OFF_T                   offset,
+                off_t                   offset,
                 size_t                      count)
 {
         if (g_readbuf && offset == 0) {
@@ -151,7 +151,7 @@ static ssize_t cprime_read(
                 void *              data,
                 size_t              count)
 {
-        SMB_OFF_T offset;
+        off_t offset;
 
         offset = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
         if (offset >= 0 && g_readbuf)  {
@@ -167,7 +167,7 @@ static ssize_t cprime_pread(
                 files_struct *      fsp,
                 void *              data,
                        size_t              count,
-                SMB_OFF_T           offset)
+                off_t           offset)
 {
         if (g_readbuf) {
                 prime_cache(handle, fsp, offset, count);
index af1f98b20f7d7ec7cc7b5432bd243d7d97215907..865250a5d8a86a2d274107ff765e4cd608b8a272 100644 (file)
@@ -68,11 +68,11 @@ enum eof_mode
 struct commit_info
 {
         /* For chunk-based commits */
-        SMB_OFF_T dbytes;      /* Dirty (uncommitted) bytes */
-        SMB_OFF_T dthresh;     /* Dirty data threshold */
+        off_t dbytes;  /* Dirty (uncommitted) bytes */
+        off_t dthresh; /* Dirty data threshold */
         /* For commits on EOF */
         enum eof_mode on_eof;
-        SMB_OFF_T eof;         /* Expected file size */
+        off_t eof;             /* Expected file size */
 };
 
 static int commit_do(
@@ -121,7 +121,7 @@ static int commit_all(
 static int commit(
         struct vfs_handle_struct *     handle,
         files_struct *                 fsp,
-       SMB_OFF_T                       offset,
+       off_t                   offset,
         ssize_t                                last_write)
 {
         struct commit_info *c;
@@ -183,7 +183,7 @@ static int commit_open(
        int                 flags,
        mode_t              mode)
 {
-        SMB_OFF_T dthresh;
+        off_t dthresh;
        const char *eof_mode;
         struct commit_info *c = NULL;
         int fd;
@@ -261,7 +261,7 @@ static ssize_t commit_pwrite(
         files_struct *      fsp,
         const void *        data,
         size_t              count,
-       SMB_OFF_T           offset)
+       off_t       offset)
 {
         ssize_t ret;
 
@@ -287,7 +287,7 @@ static int commit_close(
 static int commit_ftruncate(
         vfs_handle_struct * handle,
         files_struct *      fsp,
-        SMB_OFF_T           len)
+        off_t           len)
 {
         int result;
 
index a38ae45948ae51d4918dff5b802bb19b798255fa..19a182c453cc0229f608374753c9354c12adf4f3 100644 (file)
@@ -22,7 +22,7 @@
 #include "smbprofile.h"
 
 #define MODULE "crossrename"
-static SMB_OFF_T module_sizelimit;
+static off_t module_sizelimit;
 
 static int crossrename_connect(
                 struct vfs_handle_struct *  handle,
@@ -35,7 +35,7 @@ static int crossrename_connect(
                return ret;
        }
 
-       module_sizelimit = (SMB_OFF_T) lp_parm_int(SNUM(handle->conn),
+       module_sizelimit = (off_t) lp_parm_int(SNUM(handle->conn),
                                        MODULE, "sizelimit", 20);
        /* convert from MiB to byte: */
        module_sizelimit *= 1048576;
index 9704f5edbb716076400807c94c5645a35cd211cc..cf2bdb05c520f56a59bc9ed0c2894ed05d5089a5 100644 (file)
@@ -534,7 +534,7 @@ static ssize_t vfswrap_read(vfs_handle_struct *handle, files_struct *fsp, void *
 }
 
 static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void *data,
-                       size_t n, SMB_OFF_T offset)
+                       size_t n, off_t offset)
 {
        ssize_t result;
 
@@ -550,7 +550,7 @@ static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void
        }
 
 #else /* HAVE_PREAD */
-       SMB_OFF_T   curr;
+       off_t   curr;
        int lerrno;
 
        curr = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
@@ -588,7 +588,7 @@ static ssize_t vfswrap_write(vfs_handle_struct *handle, files_struct *fsp, const
 }
 
 static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data,
-                       size_t n, SMB_OFF_T offset)
+                       size_t n, off_t offset)
 {
        ssize_t result;
 
@@ -603,7 +603,7 @@ static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, cons
        }
 
 #else /* HAVE_PWRITE */
-       SMB_OFF_T   curr;
+       off_t   curr;
        int         lerrno;
 
        curr = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
@@ -626,9 +626,9 @@ static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, cons
        return result;
 }
 
-static SMB_OFF_T vfswrap_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
+static off_t vfswrap_lseek(vfs_handle_struct *handle, files_struct *fsp, off_t offset, int whence)
 {
-       SMB_OFF_T result = 0;
+       off_t result = 0;
 
        START_PROFILE(syscall_lseek);
 
@@ -653,7 +653,7 @@ static SMB_OFF_T vfswrap_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB
 }
 
 static ssize_t vfswrap_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr,
-                       SMB_OFF_T offset, size_t n)
+                       off_t offset, size_t n)
 {
        ssize_t result;
 
@@ -666,7 +666,7 @@ static ssize_t vfswrap_sendfile(vfs_handle_struct *handle, int tofd, files_struc
 static ssize_t vfswrap_recvfile(vfs_handle_struct *handle,
                        int fromfd,
                        files_struct *tofsp,
-                       SMB_OFF_T offset,
+                       off_t offset,
                        size_t n)
 {
        ssize_t result;
@@ -1361,9 +1361,9 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
  allocate is set.
 **********************************************************************/
 
-static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T len)
+static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fsp, off_t len)
 {
-       SMB_OFF_T space_to_write;
+       off_t space_to_write;
        uint64_t space_avail;
        uint64_t bsize,dfree,dsize;
        int ret;
@@ -1428,7 +1428,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
        return 0;
 }
 
-static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T len)
+static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, off_t len)
 {
        int result = -1;
        SMB_STRUCT_STAT *pst;
@@ -1499,8 +1499,8 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_O
 static int vfswrap_fallocate(vfs_handle_struct *handle,
                        files_struct *fsp,
                        enum vfs_fallocate_mode mode,
-                       SMB_OFF_T offset,
-                       SMB_OFF_T len)
+                       off_t offset,
+                       off_t len)
 {
        int result;
 
@@ -1517,7 +1517,7 @@ static int vfswrap_fallocate(vfs_handle_struct *handle,
        return result;
 }
 
-static bool vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+static bool vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int op, off_t offset, off_t count, int type)
 {
        bool result;
 
@@ -1536,7 +1536,7 @@ static int vfswrap_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
        return 0;
 }
 
-static bool vfswrap_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+static bool vfswrap_getlock(vfs_handle_struct *handle, files_struct *fsp, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid)
 {
        bool result;
 
index 4457860d2e7417884e982db0d8a3be2317a46cc3..de4f7996bf805eeb99cd34971f40b751aca71e8c 100644 (file)
@@ -952,7 +952,7 @@ static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp,
-                          void *data, size_t n, SMB_OFF_T offset)
+                          void *data, size_t n, off_t offset)
 {
        ssize_t result;
 
@@ -979,7 +979,7 @@ static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp
 
 static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp,
                            const void *data, size_t n,
-                           SMB_OFF_T offset)
+                           off_t offset)
 {
        ssize_t result;
 
@@ -991,8 +991,8 @@ static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fs
        return result;
 }
 
-static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp,
-                            SMB_OFF_T offset, int whence)
+static off_t smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp,
+                            off_t offset, int whence)
 {
        ssize_t result;
 
@@ -1006,7 +1006,7 @@ static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *f
 
 static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd,
                              files_struct *fromfsp,
-                             const DATA_BLOB *hdr, SMB_OFF_T offset,
+                             const DATA_BLOB *hdr, off_t offset,
                              size_t n)
 {
        ssize_t result;
@@ -1021,7 +1021,7 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd,
 
 static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd,
                      files_struct *tofsp,
-                             SMB_OFF_T offset,
+                             off_t offset,
                              size_t n)
 {
        ssize_t result;
@@ -1229,7 +1229,7 @@ static int smb_full_audit_ntimes(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
-                          SMB_OFF_T len)
+                          off_t len)
 {
        int result;
 
@@ -1243,8 +1243,8 @@ static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp
 
 static int smb_full_audit_fallocate(vfs_handle_struct *handle, files_struct *fsp,
                           enum vfs_fallocate_mode mode,
-                          SMB_OFF_T offset,
-                          SMB_OFF_T len)
+                          off_t offset,
+                          off_t len)
 {
        int result;
 
@@ -1257,7 +1257,7 @@ static int smb_full_audit_fallocate(vfs_handle_struct *handle, files_struct *fsp
 }
 
 static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp,
-                      int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+                      int op, off_t offset, off_t count, int type)
 {
        bool result;
 
@@ -1296,7 +1296,7 @@ static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct
 }
 
 static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp,
-                      SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+                      off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid)
 {
        bool result;
 
index fce1b28c6403b1ecfec1e2a19062c476259fddee..80f6d6e653d8d1286777fc65b08a06041ca9b217 100644 (file)
@@ -1261,7 +1261,7 @@ static int vfs_gpfs_ntimes(struct vfs_handle_struct *handle,
 
 static int vfs_gpfs_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)
 {
        int ret;
        struct gpfs_config_data *config;
@@ -1296,7 +1296,7 @@ static int vfs_gpfs_fallocate(struct vfs_handle_struct *handle,
 }
 
 static int vfs_gpfs_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
-                               SMB_OFF_T len)
+                               off_t len)
 {
        int result;
        struct gpfs_config_data *config;
@@ -1368,7 +1368,7 @@ static bool vfs_gpfs_aio_force(struct vfs_handle_struct *handle,
 
 static ssize_t vfs_gpfs_sendfile(vfs_handle_struct *handle, int tofd,
                                 files_struct *fsp, const DATA_BLOB *hdr,
-                                SMB_OFF_T offset, size_t n)
+                                off_t offset, size_t n)
 {
        if ((fsp->fsp_name->st.vfs_private & GPFS_WINATTR_OFFLINE) != 0) {
                errno = ENOSYS;
index 7ff5355c95fb4a5dbcfa593a02c127b85658bc6a..d53363c4604183178a2c2715ff95cc2c8e5ed80a 100644 (file)
@@ -34,7 +34,7 @@
 #include "vfs_gpfs.h"
 
 static ssize_t vfs_gpfs_hsm_notify_pread(vfs_handle_struct *handle, files_struct *fsp,
-                             void *data, size_t n, SMB_OFF_T offset)
+                             void *data, size_t n, off_t offset)
 {
        ssize_t ret;
 
@@ -56,7 +56,7 @@ static ssize_t vfs_gpfs_hsm_notify_pread(vfs_handle_struct *handle, files_struct
 
 static ssize_t vfs_gpfs_hsm_notify_pwrite(struct vfs_handle_struct *handle,
                               struct files_struct *fsp,
-                              const void *data, size_t n, SMB_OFF_T offset)
+                              const void *data, size_t n, off_t offset)
 {
        ssize_t ret;
 
index 5866eb49c89bfa96a883810248fa69f65ef54136..619e3874a3fdf538ac9d9805828ace4d7edbc15d 100644 (file)
@@ -64,7 +64,7 @@ static int onefs_open(vfs_handle_struct *handle,
 
 static ssize_t onefs_sendfile(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)
 {
        ssize_t result;
 
@@ -76,7 +76,7 @@ static ssize_t onefs_sendfile(vfs_handle_struct *handle, int tofd,
 }
 
 static ssize_t onefs_recvfile(vfs_handle_struct *handle, int fromfd,
-                             files_struct *tofsp, SMB_OFF_T offset,
+                             files_struct *tofsp, off_t offset,
                              size_t count)
 {
        ssize_t result;
index 15be7d121bcbd3a1ee663e511945694fb924bbf6..f67cefbe2f3000d204bc423928fea2724f62ad1c 100644 (file)
@@ -56,7 +56,7 @@
 #define MODULE "prealloc"
 static int module_debug;
 
-static int preallocate_space(int fd, SMB_OFF_T size)
+static int preallocate_space(int fd, off_t size)
 {
        int err;
 #ifndef HAVE_GPFS
@@ -170,9 +170,9 @@ static int prealloc_open(vfs_handle_struct* handle,
         * truncate calls specially.
         */
        if ((flags & O_CREAT) || (flags & O_TRUNC)) {
-               SMB_OFF_T * psize;
+               off_t * psize;
 
-               psize = VFS_ADD_FSP_EXTENSION(handle, fsp, SMB_OFF_T, NULL);
+               psize = VFS_ADD_FSP_EXTENSION(handle, fsp, off_t, NULL);
                if (psize == NULL || *psize == -1) {
                        return fd;
                }
@@ -201,9 +201,9 @@ normal_open:
 
 static int prealloc_ftruncate(vfs_handle_struct * handle,
                        files_struct *  fsp,
-                       SMB_OFF_T       offset)
+                       off_t   offset)
 {
-       SMB_OFF_T *psize;
+       off_t *psize;
        int ret = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
 
        /* Maintain the allocated space even in the face of truncates. */
index b48d95faa96224439dc65763501bb6ea6e282c02..8cb85c756144a29ca5693fa4750b3e7ea75baf3a 100644 (file)
@@ -24,8 +24,8 @@ ssize_t readahead(int fd, off_t offset, size_t count);
 #endif
 
 struct readahead_data {
-       SMB_OFF_T off_bound;
-       SMB_OFF_T len;
+       off_t off_bound;
+       off_t len;
        bool didmsg;
 };
 
@@ -43,7 +43,7 @@ static ssize_t readahead_sendfile(struct vfs_handle_struct *handle,
                                        int tofd,
                                        files_struct *fromfsp,
                                        const DATA_BLOB *header,
-                                       SMB_OFF_T offset,
+                                       off_t offset,
                                        size_t count)
 {
        struct readahead_data *rhd = (struct readahead_data *)handle->data;
@@ -86,7 +86,7 @@ static ssize_t readahead_pread(vfs_handle_struct *handle,
                                files_struct *fsp,
                                void *data,
                                size_t count,
-                               SMB_OFF_T offset)
+                               off_t offset)
 {
        struct readahead_data *rhd = (struct readahead_data *)handle->data;
 
index 80332523ed922b4f999c127944ed41f777130b71..37d930f79377b37d68af8207fbb2f84d74f1302d 100644 (file)
@@ -126,9 +126,9 @@ static const char **recycle_noversions(vfs_handle_struct *handle)
        return tmp_lp;
 }
 
-static SMB_OFF_T recycle_maxsize(vfs_handle_struct *handle)
+static off_t recycle_maxsize(vfs_handle_struct *handle)
 {
-       SMB_OFF_T maxsize;
+       off_t maxsize;
 
        maxsize = conv_str_size(lp_parm_const_string(SNUM(handle->conn),
                                            "recycle", "maxsize", NULL));
@@ -138,9 +138,9 @@ static SMB_OFF_T recycle_maxsize(vfs_handle_struct *handle)
        return maxsize;
 }
 
-static SMB_OFF_T recycle_minsize(vfs_handle_struct *handle)
+static off_t recycle_minsize(vfs_handle_struct *handle)
 {
-       SMB_OFF_T minsize;
+       off_t minsize;
 
        minsize = conv_str_size(lp_parm_const_string(SNUM(handle->conn),
                                            "recycle", "minsize", NULL));
@@ -225,23 +225,23 @@ static bool recycle_file_exist(vfs_handle_struct *handle,
  * @param fname file name
  * @return size in bytes
  **/
-static SMB_OFF_T recycle_get_file_size(vfs_handle_struct *handle,
+static off_t recycle_get_file_size(vfs_handle_struct *handle,
                                       const struct smb_filename *smb_fname)
 {
        struct smb_filename *smb_fname_tmp = NULL;
        NTSTATUS status;
-       SMB_OFF_T size;
+       off_t size;
 
        status = copy_smb_filename(talloc_tos(), smb_fname, &smb_fname_tmp);
        if (!NT_STATUS_IS_OK(status)) {
-               size = (SMB_OFF_T)0;
+               size = (off_t)0;
                goto out;
        }
 
        if (SMB_VFS_STAT(handle->conn, smb_fname_tmp) != 0) {
                DEBUG(0,("recycle: stat for %s returned %s\n",
                         smb_fname_str_dbg(smb_fname_tmp), strerror(errno)));
-               size = (SMB_OFF_T)0;
+               size = (off_t)0;
                goto out;
        }
 
@@ -442,8 +442,8 @@ static int recycle_unlink(vfs_handle_struct *handle,
        const char *base;
        char *repository = NULL;
        int i = 1;
-       SMB_OFF_T maxsize, minsize;
-       SMB_OFF_T file_size; /* space_avail;    */
+       off_t maxsize, minsize;
+       off_t file_size; /* space_avail;        */
        bool exist;
        NTSTATUS status;
        int rc = -1;
index 025fbbda90bf39e70e2a2e2bebd29c422cba2161..c728e7d5e954618a12e614c9552ccd4bc475f1a8 100644 (file)
@@ -769,7 +769,7 @@ static ssize_t smb_traffic_analyzer_sendfile(vfs_handle_struct *handle,
                                int tofd,
                                files_struct *fromfsp,
                                const DATA_BLOB *hdr,
-                               SMB_OFF_T offset,
+                               off_t offset,
                                size_t n)
 {
        struct rw_data s_data;
@@ -787,7 +787,7 @@ static ssize_t smb_traffic_analyzer_sendfile(vfs_handle_struct *handle,
 static ssize_t smb_traffic_analyzer_recvfile(vfs_handle_struct *handle,
                                int fromfd,
                                files_struct *tofsp,
-                               SMB_OFF_T offset,
+                               off_t offset,
                                size_t n)
 {
        struct rw_data s_data;
@@ -820,7 +820,7 @@ static ssize_t smb_traffic_analyzer_read(vfs_handle_struct *handle, \
 
 
 static ssize_t smb_traffic_analyzer_pread(vfs_handle_struct *handle, \
-               files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
+               files_struct *fsp, void *data, size_t n, off_t offset)
 {
        struct rw_data s_data;
 
@@ -853,7 +853,7 @@ static ssize_t smb_traffic_analyzer_write(vfs_handle_struct *handle, \
 }
 
 static ssize_t smb_traffic_analyzer_pwrite(vfs_handle_struct *handle, \
-            files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
+            files_struct *fsp, const void *data, size_t n, off_t offset)
 {
        struct rw_data s_data;
 
index 172a0c634d392442d8dd743f57a2e629dbf9b225..f984f75e9f25018bfab4626c74e9aec0576e4e3e 100644 (file)
@@ -748,8 +748,8 @@ done:
 
 static bool add_one_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
                           struct stream_struct **streams,
-                          const char *name, SMB_OFF_T size,
-                          SMB_OFF_T alloc_size)
+                          const char *name, off_t size,
+                          off_t alloc_size)
 {
        struct stream_struct *tmp;
 
index 2ac0491f283034457741cf455b364060088e469d..291531e59aae01744706b5ed46106405272f09d6 100644 (file)
@@ -726,8 +726,8 @@ static NTSTATUS walk_xattr_streams(connection_struct *conn, files_struct *fsp,
 
 static bool add_one_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
                           struct stream_struct **streams,
-                          const char *name, SMB_OFF_T size,
-                          SMB_OFF_T alloc_size)
+                          const char *name, off_t size,
+                          off_t alloc_size)
 {
        struct stream_struct *tmp;
 
@@ -843,7 +843,7 @@ static uint32_t streams_xattr_fs_capabilities(struct vfs_handle_struct *handle,
 
 static ssize_t streams_xattr_pwrite(vfs_handle_struct *handle,
                                    files_struct *fsp, const void *data,
-                                   size_t n, SMB_OFF_T offset)
+                                   size_t n, off_t offset)
 {
         struct stream_io *sio =
                (struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
@@ -906,7 +906,7 @@ static ssize_t streams_xattr_pwrite(vfs_handle_struct *handle,
 
 static ssize_t streams_xattr_pread(vfs_handle_struct *handle,
                                   files_struct *fsp, void *data,
-                                  size_t n, SMB_OFF_T offset)
+                                  size_t n, off_t offset)
 {
         struct stream_io *sio =
                (struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
@@ -950,7 +950,7 @@ static ssize_t streams_xattr_pread(vfs_handle_struct *handle,
 
 static int streams_xattr_ftruncate(struct vfs_handle_struct *handle,
                                        struct files_struct *fsp,
-                                       SMB_OFF_T offset)
+                                       off_t offset)
 {
        int ret;
        uint8 *tmp;
@@ -1018,8 +1018,8 @@ static int streams_xattr_ftruncate(struct vfs_handle_struct *handle,
 static int streams_xattr_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)
 {
         struct stream_io *sio =
                (struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
index ac96893cc4680ede7e59dc4f369153e457a78cbb..a5ca407673ad258201051aaf74e056914f79874b 100644 (file)
@@ -501,7 +501,7 @@ static ssize_t smb_time_audit_read(vfs_handle_struct *handle,
 
 static ssize_t smb_time_audit_pread(vfs_handle_struct *handle,
                                    files_struct *fsp,
-                                   void *data, size_t n, SMB_OFF_T offset)
+                                   void *data, size_t n, off_t offset)
 {
        ssize_t result;
        struct timespec ts1,ts2;
@@ -542,7 +542,7 @@ static ssize_t smb_time_audit_write(vfs_handle_struct *handle,
 static ssize_t smb_time_audit_pwrite(vfs_handle_struct *handle,
                                     files_struct *fsp,
                                     const void *data, size_t n,
-                                    SMB_OFF_T offset)
+                                    off_t offset)
 {
        ssize_t result;
        struct timespec ts1,ts2;
@@ -560,11 +560,11 @@ static ssize_t smb_time_audit_pwrite(vfs_handle_struct *handle,
        return result;
 }
 
-static SMB_OFF_T smb_time_audit_lseek(vfs_handle_struct *handle,
+static off_t smb_time_audit_lseek(vfs_handle_struct *handle,
                                      files_struct *fsp,
-                                     SMB_OFF_T offset, int whence)
+                                     off_t offset, int whence)
 {
-       SMB_OFF_T result;
+       off_t result;
        struct timespec ts1,ts2;
        double timediff;
 
@@ -582,7 +582,7 @@ static SMB_OFF_T smb_time_audit_lseek(vfs_handle_struct *handle,
 
 static ssize_t smb_time_audit_sendfile(vfs_handle_struct *handle, int tofd,
                                       files_struct *fromfsp,
-                                      const DATA_BLOB *hdr, SMB_OFF_T offset,
+                                      const DATA_BLOB *hdr, off_t offset,
                                       size_t n)
 {
        ssize_t result;
@@ -603,7 +603,7 @@ static ssize_t smb_time_audit_sendfile(vfs_handle_struct *handle, int tofd,
 
 static ssize_t smb_time_audit_recvfile(vfs_handle_struct *handle, int fromfd,
                                       files_struct *tofsp,
-                                      SMB_OFF_T offset,
+                                      off_t offset,
                                       size_t n)
 {
        ssize_t result;
@@ -909,7 +909,7 @@ static int smb_time_audit_ntimes(vfs_handle_struct *handle,
 
 static int smb_time_audit_ftruncate(vfs_handle_struct *handle,
                                    files_struct *fsp,
-                                   SMB_OFF_T len)
+                                   off_t len)
 {
        int result;
        struct timespec ts1,ts2;
@@ -930,8 +930,8 @@ static int smb_time_audit_ftruncate(vfs_handle_struct *handle,
 static int smb_time_audit_fallocate(vfs_handle_struct *handle,
                                    files_struct *fsp,
                                    enum vfs_fallocate_mode mode,
-                                   SMB_OFF_T offset,
-                                   SMB_OFF_T len)
+                                   off_t offset,
+                                   off_t len)
 {
        int result;
        struct timespec ts1,ts2;
@@ -950,7 +950,7 @@ static int smb_time_audit_fallocate(vfs_handle_struct *handle,
 }
 
 static bool smb_time_audit_lock(vfs_handle_struct *handle, files_struct *fsp,
-                               int op, SMB_OFF_T offset, SMB_OFF_T count,
+                               int op, off_t offset, off_t count,
                                int type)
 {
        bool result;
@@ -1012,7 +1012,7 @@ static int smb_time_audit_linux_setlease(vfs_handle_struct *handle,
 
 static bool smb_time_audit_getlock(vfs_handle_struct *handle,
                                   files_struct *fsp,
-                                  SMB_OFF_T *poffset, SMB_OFF_T *pcount,
+                                  off_t *poffset, off_t *pcount,
                                   int *ptype, pid_t *ppid)
 {
        bool result;
index d7cc050024bf05a95fcadbd309b4d4d6f1b26a26..8b138d385c71bbc7c74667127fd29c82839a1b16 100644 (file)
@@ -298,7 +298,7 @@ static ssize_t tsmsm_aio_return(struct vfs_handle_struct *handle, struct files_s
 }
 
 static ssize_t tsmsm_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, const DATA_BLOB *hdr,
-                             SMB_OFF_T offset, size_t n)
+                             off_t offset, size_t n)
 {
        bool file_offline = tsmsm_aio_force(handle, fsp);
 
@@ -314,7 +314,7 @@ static ssize_t tsmsm_sendfile(vfs_handle_struct *handle, int tofd, files_struct
 /* We do overload pread to allow notification when file becomes online after offline status */
 /* We don't intercept SMB_VFS_READ here because all file I/O now goes through SMB_VFS_PREAD instead */
 static ssize_t tsmsm_pread(struct vfs_handle_struct *handle, struct files_struct *fsp, 
-                          void *data, size_t n, SMB_OFF_T offset) {
+                          void *data, size_t n, off_t offset) {
        ssize_t result;
        bool notify_online = tsmsm_aio_force(handle, fsp);
 
@@ -332,7 +332,7 @@ static ssize_t tsmsm_pread(struct vfs_handle_struct *handle, struct files_struct
 }
 
 static ssize_t tsmsm_pwrite(struct vfs_handle_struct *handle, struct files_struct *fsp, 
-                           const void *data, size_t n, SMB_OFF_T offset) {
+                           const void *data, size_t n, off_t offset) {
        ssize_t result;
        bool notify_online = tsmsm_aio_force(handle, fsp);
 
index 9146ed281c2a02ddedb72fa9d4eb85f875ff31d5..99b275de4068118d20b9de82e18d4afa2de28137 100644 (file)
@@ -642,7 +642,7 @@ static NTSTATUS add_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state,
        int fd;
        size_t new_entry_length;
        char *new_entry;
-       SMB_OFF_T offpos;
+       off_t offpos;
  
        /* Open the smbpassword file - for update. */
        fp = startsmbfilepwent(pfile, PWF_UPDATE, &smbpasswd_state->pw_file_lock_depth);
@@ -750,7 +750,7 @@ static bool mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con
        bool found_entry = False;
        bool got_pass_last_set_time = False;
 
-       SMB_OFF_T pwd_seekpos = 0;
+       off_t pwd_seekpos = 0;
 
        int i;
        int wr_len;
index 92aa320b718c0b42af35a28b73451479225a507a..96947f199bc05198c9dfdd4da4c05aecf3da0bc9 100644 (file)
@@ -199,7 +199,7 @@ static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32
        }
 
        /* Skip OEM header (if any) and the DOS stub to start of Windows header */
-       if (SMB_VFS_LSEEK(fsp, SVAL(buf,DOS_HEADER_LFANEW_OFFSET), SEEK_SET) == (SMB_OFF_T)-1) {
+       if (SMB_VFS_LSEEK(fsp, SVAL(buf,DOS_HEADER_LFANEW_OFFSET), SEEK_SET) == (off_t)-1) {
                DEBUG(3,("get_file_version: File [%s] too short, errno = %d\n",
                                fname, errno));
                /* Assume this isn't an error... the file just looks sort of like a PE/NE file */
@@ -222,7 +222,7 @@ static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32
                /* Just skip over optional header to get to section table */
                if (SMB_VFS_LSEEK(fsp,
                                SVAL(buf,PE_HEADER_OPTIONAL_HEADER_SIZE)-(NE_HEADER_SIZE-PE_HEADER_SIZE),
-                               SEEK_CUR) == (SMB_OFF_T)-1) {
+                               SEEK_CUR) == (off_t)-1) {
                        DEBUG(3,("get_file_version: File [%s] Windows optional header too short, errno = %d\n",
                                fname, errno));
                        goto error_exit;
@@ -266,7 +266,7 @@ static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32
                                }
 
                                /* Seek to the start of the .rsrc section info */
-                               if (SMB_VFS_LSEEK(fsp, section_pos, SEEK_SET) == (SMB_OFF_T)-1) {
+                               if (SMB_VFS_LSEEK(fsp, section_pos, SEEK_SET) == (off_t)-1) {
                                        DEBUG(3,("get_file_version: PE file [%s] too short for section info, errno = %d\n",
                                                        fname, errno));
                                        goto error_exit;
index 32f33c6348256e6ea0c558f3dca0c936b0c5d120..2cb805d146789679d0a5d046b9089c2178647579 100644 (file)
@@ -223,7 +223,7 @@ done:
 
 int print_spool_write(files_struct *fsp,
                      const char *data, uint32_t size,
-                     SMB_OFF_T offset, uint32_t *written)
+                     off_t offset, uint32_t *written)
 {
        SMB_STRUCT_STAT st;
        ssize_t n;
index 44081f69a0148720272ecb843bc542400a2711f6..000206a9852e571157a91c71e598b570c71028f8 100644 (file)
@@ -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;
index da6d8483a182c214e487de95b146d4c6f8265ed3..dc6df47ee657ab6371d7f82c622e9124c84e539b 100644 (file)
@@ -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);
index 79a0f8bf18f0a3519ffe999e0f623da0ea075ed1..cb27110f26b4b2f70d629f96f4fd7e59d4e89827 100644 (file)
@@ -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,
index 85d879d8c576d25fc10caec5e8b901c309c72942..8bdb66bcfeb4b3f65f14c3723a9ba88522f4f139 100644 (file)
 #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. */
index 20379ac6d9b36910c3607f1a44299dc88f790a8e..168ef56553cd65f29dc0a4742daa4d309b4b5001 100644 (file)
@@ -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;
        }
index 1af07882b5981cbafcbadb591336b29f7f912e78..ca267a05008b3736f98fb49c4ab6b7a30cda2ea4 100644 (file)
@@ -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);
index 8cefba0dfcf435c643cd5262bcdf7a45f66628bd..dc4310639b8a04049bbf2ac92afdf50ad2784420 100644 (file)
@@ -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;
        }
index 0b6e2ee4618b8749c442b98291237c31d7c1c2c2..53b0a9dc571f143e5ba275387a695e07283ef1df 100644 (file)
@@ -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)) {
index 40a1a5dc80f24454c441f1d171dfa37030e7348a..dcf771a5b9ea3b6180d2f17c4863e3d234f9c0d1 100644 (file)
@@ -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 */
index f8a4199470565637e81e62261ce823caa6d4b0fb..b330c03bfc7e2a4a29fd79aa2522e9f8684ccfe6 100644 (file)
@@ -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);
index b845048ebe65d4771efe554d09f820ced1ae3839..b6cc716a6150ec200bc12010cf78f2ad7ff0c462 100644 (file)
@@ -490,7 +490,7 @@ static NTSTATUS cmd_write(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
 static NTSTATUS cmd_lseek(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
 {
        int fd, offset, whence;
-       SMB_OFF_T pos;
+       off_t pos;
 
        if (argc != 4) {
                printf("Usage: lseek <fd> <offset> <whence>\n...where whence is 1 => SEEK_SET, 2 => SEEK_CUR, 3 => SEEK_END\n");
@@ -507,7 +507,7 @@ static NTSTATUS cmd_lseek(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
        }
 
        pos = SMB_VFS_LSEEK(vfs->files[fd], offset, whence);
-       if (pos == (SMB_OFF_T)-1) {
+       if (pos == (off_t)-1) {
                printf("lseek: error=%d (%s)\n", errno, strerror(errno));
                return NT_STATUS_UNSUCCESSFUL;
        }
@@ -936,7 +936,7 @@ static NTSTATUS cmd_utime(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
 static NTSTATUS cmd_ftruncate(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
 {
        int fd;
-       SMB_OFF_T off;
+       off_t off;
        if (argc != 3) {
                printf("Usage: ftruncate <fd> <length>\n");
                return NT_STATUS_OK;
index 2f562633e502d93c477f76fa5e3cf48714873ab5..d4784e8e7c29f1779f272fc09f08309a53d8c47e 100644 (file)
@@ -33,7 +33,7 @@ bool run_posix_append(int dummy)
        const char *fname = "append";
        NTSTATUS status;
        uint16_t fnum;
-       SMB_OFF_T size;
+       off_t size;
        uint8_t c = '\0';
        bool ret = false;
 
index 1e9e59b2805ff0094a62ec375d58a66f64f40847..5214e1319d1cfd9d7dfdf6af2f6bf6e18b8ad96f 100644 (file)
@@ -984,7 +984,7 @@ static bool run_readwritelarge_internal(void)
        static struct cli_state *cli1;
        uint16_t fnum1;
        const char *lockfname = "\\large.dat";
-       SMB_OFF_T fsize;
+       off_t fsize;
        char buf[126*1024];
        bool correct = True;
        NTSTATUS status;
@@ -3281,7 +3281,7 @@ static bool run_trans2test(int dummy)
 {
        struct cli_state *cli;
        uint16_t fnum;
-       SMB_OFF_T size;
+       off_t size;
        time_t c_time, a_time, m_time;
        struct timespec c_time_ts, a_time_ts, m_time_ts, w_time_ts, m_time2_ts;
        const char *fname = "\\trans2.tst";
@@ -4851,7 +4851,7 @@ static bool run_opentest(int dummy)
        const char *fname = "\\readonly.file";
        uint16_t fnum1, fnum2;
        char buf[20];
-       SMB_OFF_T fsize;
+       off_t fsize;
        bool correct = True;
        char *tmp_path;
        NTSTATUS status;
@@ -7016,7 +7016,7 @@ static bool run_mangle1(int dummy)
        fstring alt_name;
        NTSTATUS status;
        time_t change_time, access_time, write_time;
-       SMB_OFF_T size;
+       off_t size;
        uint16_t mode;
 
        printf("starting mangle1 test\n");
@@ -7586,7 +7586,7 @@ static bool run_streamerror(int dummy)
                "testdir:{4c8cc155-6c1e-11d1-8e41-00c04fb9386d}:$DATA";
        NTSTATUS status;
        time_t change_time, access_time, write_time;
-       SMB_OFF_T size;
+       off_t size;
        uint16_t mode, fnum;
        bool ret = true;
 
index 2a56f085fed0ce759e203a5975e50143aed742c9..a2db3ba0fea934a26a708d785554df2a3fdeed79 100644 (file)
@@ -153,7 +153,7 @@ bool torture_casetable(int dummy)
        }
 
        for (c=1; c < 0x10000; c++) {
-               SMB_OFF_T size;
+               off_t size;
 
                if (c == '.' || c == '\\') continue;