mirror of
https://github.com/samba-team/samba.git
synced 2025-03-24 10:50:22 +03:00
Use {u,}int64_t instead of SMB_BIG_{U,}INT.
This commit is contained in:
parent
abe443a65e
commit
4746f79d50
@ -84,9 +84,9 @@ static struct sockaddr_storage dest_ss;
|
||||
static bool abort_mget = true;
|
||||
|
||||
/* timing globals */
|
||||
SMB_BIG_UINT get_total_size = 0;
|
||||
uint64_t get_total_size = 0;
|
||||
unsigned int get_total_time_ms = 0;
|
||||
static SMB_BIG_UINT put_total_size = 0;
|
||||
static uint64_t put_total_size = 0;
|
||||
static unsigned int put_total_time_ms = 0;
|
||||
|
||||
/* totals globals */
|
||||
@ -2555,7 +2555,7 @@ static int cmd_lock(void)
|
||||
{
|
||||
TALLOC_CTX *ctx = talloc_tos();
|
||||
char *buf = NULL;
|
||||
SMB_BIG_UINT start, len;
|
||||
uint64_t start, len;
|
||||
enum brl_type lock_type;
|
||||
int fnum;
|
||||
|
||||
@ -2584,14 +2584,14 @@ static int cmd_lock(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
start = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16);
|
||||
start = (uint64_t)strtol(buf, (char **)NULL, 16);
|
||||
|
||||
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
|
||||
d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
len = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16);
|
||||
len = (uint64_t)strtol(buf, (char **)NULL, 16);
|
||||
|
||||
if (!cli_posix_lock(cli, fnum, start, len, true, lock_type)) {
|
||||
d_printf("lock failed %d: %s\n", fnum, cli_errstr(cli));
|
||||
@ -2604,7 +2604,7 @@ static int cmd_unlock(void)
|
||||
{
|
||||
TALLOC_CTX *ctx = talloc_tos();
|
||||
char *buf = NULL;
|
||||
SMB_BIG_UINT start, len;
|
||||
uint64_t start, len;
|
||||
int fnum;
|
||||
|
||||
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
|
||||
@ -2618,14 +2618,14 @@ static int cmd_unlock(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
start = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16);
|
||||
start = (uint64_t)strtol(buf, (char **)NULL, 16);
|
||||
|
||||
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
|
||||
d_printf("unlock <fnum> <hex-start> <hex-len>\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
len = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16);
|
||||
len = (uint64_t)strtol(buf, (char **)NULL, 16);
|
||||
|
||||
if (!cli_posix_unlock(cli, fnum, start, len)) {
|
||||
d_printf("unlock failed %d: %s\n", fnum, cli_errstr(cli));
|
||||
|
@ -112,11 +112,11 @@ extern int get_total_size;
|
||||
static int blocksize=20;
|
||||
static int tarhandle;
|
||||
|
||||
static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t mtime,
|
||||
static void writetarheader(int f, const char *aname, uint64_t size, time_t mtime,
|
||||
const char *amode, unsigned char ftype);
|
||||
static void do_atar(const char *rname_in,char *lname,file_info *finfo1);
|
||||
static void do_tar(file_info *finfo, const char *dir);
|
||||
static void oct_it(SMB_BIG_UINT value, int ndgs, char *p);
|
||||
static void oct_it(uint64_t value, int ndgs, char *p);
|
||||
static void fixtarname(char *tptr, const char *fp, size_t l);
|
||||
static int dotarbuf(int f, char *b, int n);
|
||||
static void dozerobuf(int f, int n);
|
||||
@ -154,7 +154,7 @@ static char *string_create_s(int size)
|
||||
Write a tar header to buffer
|
||||
****************************************************************************/
|
||||
|
||||
static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t mtime,
|
||||
static void writetarheader(int f, const char *aname, uint64_t size, time_t mtime,
|
||||
const char *amode, unsigned char ftype)
|
||||
{
|
||||
union hblock hb;
|
||||
@ -195,10 +195,10 @@ static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t m
|
||||
|
||||
hb.dbuf.name[NAMSIZ-1]='\0';
|
||||
safe_strcpy(hb.dbuf.mode, amode, sizeof(hb.dbuf.mode)-1);
|
||||
oct_it((SMB_BIG_UINT)0, 8, hb.dbuf.uid);
|
||||
oct_it((SMB_BIG_UINT)0, 8, hb.dbuf.gid);
|
||||
oct_it((SMB_BIG_UINT) size, 13, hb.dbuf.size);
|
||||
if (size > (SMB_BIG_UINT)077777777777LL) {
|
||||
oct_it((uint64_t)0, 8, hb.dbuf.uid);
|
||||
oct_it((uint64_t)0, 8, hb.dbuf.gid);
|
||||
oct_it((uint64_t) size, 13, hb.dbuf.size);
|
||||
if (size > (uint64_t)077777777777LL) {
|
||||
/* This is a non-POSIX compatible extention to store files
|
||||
greater than 8GB. */
|
||||
|
||||
@ -207,7 +207,7 @@ static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t m
|
||||
for (i = 8, jp=(char*)&size; i; i--)
|
||||
hb.dbuf.size[i+3] = *(jp++);
|
||||
}
|
||||
oct_it((SMB_BIG_UINT) mtime, 13, hb.dbuf.mtime);
|
||||
oct_it((uint64_t) mtime, 13, hb.dbuf.mtime);
|
||||
memcpy(hb.dbuf.chksum, " ", sizeof(hb.dbuf.chksum));
|
||||
memset(hb.dbuf.linkname, 0, NAMSIZ);
|
||||
hb.dbuf.linkflag=ftype;
|
||||
@ -215,7 +215,7 @@ static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t m
|
||||
for (chk=0, i=sizeof(hb.dummy), jp=hb.dummy; --i>=0;)
|
||||
chk+=(0xFF & *jp++);
|
||||
|
||||
oct_it((SMB_BIG_UINT) chk, 8, hb.dbuf.chksum);
|
||||
oct_it((uint64_t) chk, 8, hb.dbuf.chksum);
|
||||
hb.dbuf.chksum[6] = '\0';
|
||||
|
||||
(void) dotarbuf(f, hb.dummy, sizeof(hb.dummy));
|
||||
@ -431,7 +431,7 @@ static void fixtarname(char *tptr, const char *fp, size_t l)
|
||||
Convert from decimal to octal string
|
||||
****************************************************************************/
|
||||
|
||||
static void oct_it (SMB_BIG_UINT value, int ndgs, char *p)
|
||||
static void oct_it (uint64_t value, int ndgs, char *p)
|
||||
{
|
||||
/* Converts long to octal string, pads with leading zeros */
|
||||
|
||||
@ -567,7 +567,7 @@ static bool ensurepath(const char *fname)
|
||||
return True;
|
||||
}
|
||||
|
||||
static int padit(char *buf, SMB_BIG_UINT bufsize, SMB_BIG_UINT padsize)
|
||||
static int padit(char *buf, uint64_t bufsize, uint64_t padsize)
|
||||
{
|
||||
int berr= 0;
|
||||
int bytestowrite;
|
||||
@ -607,7 +607,7 @@ append one remote file to the tar file
|
||||
static void do_atar(const char *rname_in,char *lname,file_info *finfo1)
|
||||
{
|
||||
int fnum = -1;
|
||||
SMB_BIG_UINT nread=0;
|
||||
uint64_t nread=0;
|
||||
char ftype;
|
||||
file_info2 finfo;
|
||||
bool shallitime=True;
|
||||
@ -738,7 +738,7 @@ static void do_atar(const char *rname_in,char *lname,file_info *finfo1)
|
||||
if (nread < finfo.size) {
|
||||
DEBUG(0, ("Didn't get entire file. size=%.0f, nread=%d\n",
|
||||
(double)finfo.size, (int)nread));
|
||||
if (padit(data, (SMB_BIG_UINT)sizeof(data), finfo.size - nread))
|
||||
if (padit(data, (uint64_t)sizeof(data), finfo.size - nread))
|
||||
DEBUG(0,("Error writing tar file - %s\n", strerror(errno)));
|
||||
}
|
||||
|
||||
@ -992,7 +992,7 @@ static int skip_file(int skipsize)
|
||||
static int get_file(file_info2 finfo)
|
||||
{
|
||||
int fnum = -1, pos = 0, dsize = 0, bpos = 0;
|
||||
SMB_BIG_UINT rsize = 0;
|
||||
uint64_t rsize = 0;
|
||||
|
||||
DEBUG(5, ("get_file: file: %s, size %.0f\n", finfo.name, (double)finfo.size));
|
||||
|
||||
|
@ -232,7 +232,7 @@ struct cli_state {
|
||||
|
||||
typedef struct file_info {
|
||||
struct cli_state *cli;
|
||||
SMB_BIG_UINT size;
|
||||
uint64_t size;
|
||||
uint16 mode;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
|
@ -426,7 +426,7 @@ typedef int VOLATILE SIG_ATOMIC_T;
|
||||
|
||||
#ifdef LARGE_SMB_DEV_T
|
||||
#define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32))
|
||||
#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(((SMB_BIG_UINT)(IVAL((p),(ofs))))| (((SMB_BIG_UINT)(IVAL((p),(ofs)+4))) << 32)))
|
||||
#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(((uint64_t)(IVAL((p),(ofs))))| (((uint64_t)(IVAL((p),(ofs)+4))) << 32)))
|
||||
#else
|
||||
#define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),v),SIVAL((p),(ofs)+4,0))
|
||||
#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(IVAL((p),(ofs))))
|
||||
@ -452,7 +452,7 @@ typedef int VOLATILE SIG_ATOMIC_T;
|
||||
|
||||
#ifdef LARGE_SMB_INO_T
|
||||
#define SINO_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32))
|
||||
#define INO_T_VAL(p, ofs) ((SMB_INO_T)(((SMB_BIG_UINT)(IVAL(p,ofs)))| (((SMB_BIG_UINT)(IVAL(p,(ofs)+4))) << 32)))
|
||||
#define INO_T_VAL(p, ofs) ((SMB_INO_T)(((uint64_t)(IVAL(p,ofs)))| (((uint64_t)(IVAL(p,(ofs)+4))) << 32)))
|
||||
#else
|
||||
#define SINO_T_VAL(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
|
||||
#define INO_T_VAL(p, ofs) ((SMB_INO_T)(IVAL((p),(ofs))))
|
||||
@ -466,20 +466,13 @@ typedef int VOLATILE SIG_ATOMIC_T;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LONGLONG)
|
||||
#define SMB_BIG_UINT unsigned long long
|
||||
#define SMB_BIG_INT long long
|
||||
#define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
|
||||
#else
|
||||
#define SMB_BIG_UINT unsigned long
|
||||
#define SMB_BIG_INT long
|
||||
#define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
|
||||
#endif
|
||||
#define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF)) | \
|
||||
(( ((uint64_t)(IVAL((buf),(off+4)))) & ((uint64_t)0xFFFFFFFF) ) << 32 ) )
|
||||
|
||||
#define SMB_BIG_UINT_BITS (sizeof(SMB_BIG_UINT)*8)
|
||||
|
||||
/* this should really be a 64 bit type if possible */
|
||||
#define br_off SMB_BIG_UINT
|
||||
typedef uint64_t br_off;
|
||||
|
||||
#define SMB_OFF_T_BITS (sizeof(SMB_OFF_T)*8)
|
||||
|
||||
@ -497,15 +490,11 @@ typedef int VOLATILE SIG_ATOMIC_T;
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
#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)(( ((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF) )))
|
||||
#define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF)) | \
|
||||
(( ((SMB_BIG_UINT)(IVAL((buf),(off+4)))) & ((SMB_BIG_UINT)0xFFFFFFFF) ) << 32 ) )
|
||||
#define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF) )))
|
||||
#else
|
||||
#define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
|
||||
#define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,v),SIVAL(p,ofs,0))
|
||||
#define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint32)(IVAL((buf),(off)))) & 0xFFFFFFFF )))
|
||||
#define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF)) | \
|
||||
(( ((SMB_BIG_UINT)(IVAL((buf),(off+4)))) & ((SMB_BIG_UINT)0xFFFFFFFF) ) << 32 ) )
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -208,7 +208,7 @@ struct nmb_data {
|
||||
time_t death_time; /* The time the record must be removed (do not remove if 0). */
|
||||
time_t refresh_time; /* The time the record should be refreshed. */
|
||||
|
||||
SMB_BIG_UINT id; /* unique id */
|
||||
uint64_t id; /* unique id */
|
||||
struct in_addr wins_ip; /* the adress of the wins server this record comes from */
|
||||
|
||||
int wins_flags; /* similar to the netbios flags but different ! */
|
||||
@ -606,7 +606,7 @@ typedef struct _WINS_RECORD {
|
||||
char type;
|
||||
int nb_flags;
|
||||
int wins_flags;
|
||||
SMB_BIG_UINT id;
|
||||
uint64_t id;
|
||||
int num_ips;
|
||||
struct in_addr ip[25];
|
||||
struct in_addr wins_ip;
|
||||
|
@ -47,16 +47,16 @@
|
||||
#define QUOTAS_4000 0x4000
|
||||
#define QUOTAS_8000 0x8000
|
||||
|
||||
#define SMB_NTQUOTAS_NO_LIMIT ((SMB_BIG_UINT)(-1))
|
||||
#define SMB_NTQUOTAS_NO_ENTRY ((SMB_BIG_UINT)(-2))
|
||||
#define SMB_NTQUOTAS_NO_SPACE ((SMB_BIG_UINT)(0))
|
||||
#define SMB_NTQUOTAS_1_B (SMB_BIG_UINT)0x0000000000000001
|
||||
#define SMB_NTQUOTAS_1KB (SMB_BIG_UINT)0x0000000000000400
|
||||
#define SMB_NTQUOTAS_1MB (SMB_BIG_UINT)0x0000000000100000
|
||||
#define SMB_NTQUOTAS_1GB (SMB_BIG_UINT)0x0000000040000000
|
||||
#define SMB_NTQUOTAS_1TB (SMB_BIG_UINT)0x0000010000000000
|
||||
#define SMB_NTQUOTAS_1PB (SMB_BIG_UINT)0x0004000000000000
|
||||
#define SMB_NTQUOTAS_1EB (SMB_BIG_UINT)0x1000000000000000
|
||||
#define SMB_NTQUOTAS_NO_LIMIT ((uint64_t)(-1))
|
||||
#define SMB_NTQUOTAS_NO_ENTRY ((uint64_t)(-2))
|
||||
#define SMB_NTQUOTAS_NO_SPACE ((uint64_t)(0))
|
||||
#define SMB_NTQUOTAS_1_B (uint64_t)0x0000000000000001
|
||||
#define SMB_NTQUOTAS_1KB (uint64_t)0x0000000000000400
|
||||
#define SMB_NTQUOTAS_1MB (uint64_t)0x0000000000100000
|
||||
#define SMB_NTQUOTAS_1GB (uint64_t)0x0000000040000000
|
||||
#define SMB_NTQUOTAS_1TB (uint64_t)0x0000010000000000
|
||||
#define SMB_NTQUOTAS_1PB (uint64_t)0x0004000000000000
|
||||
#define SMB_NTQUOTAS_1EB (uint64_t)0x1000000000000000
|
||||
|
||||
enum SMB_QUOTA_TYPE {
|
||||
SMB_INVALID_QUOTA_TYPE = -1,
|
||||
@ -68,9 +68,9 @@ enum SMB_QUOTA_TYPE {
|
||||
|
||||
typedef struct _SMB_NTQUOTA_STRUCT {
|
||||
enum SMB_QUOTA_TYPE qtype;
|
||||
SMB_BIG_UINT usedspace;
|
||||
SMB_BIG_UINT softlim;
|
||||
SMB_BIG_UINT hardlim;
|
||||
uint64_t usedspace;
|
||||
uint64_t softlim;
|
||||
uint64_t hardlim;
|
||||
uint32 qflags;
|
||||
DOM_SID sid;
|
||||
} SMB_NTQUOTA_STRUCT;
|
||||
|
@ -557,7 +557,7 @@ void pull_file_id_16(char *buf, struct file_id *id);
|
||||
|
||||
/* The following definitions come from lib/fsusage.c */
|
||||
|
||||
int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
|
||||
int sys_fsusage(const char *path, uint64_t *dfree, uint64_t *dsize);
|
||||
|
||||
/* The following definitions come from lib/gencache.c */
|
||||
|
||||
@ -1676,7 +1676,7 @@ void rfc1738_unescape(char *buf);
|
||||
DATA_BLOB base64_decode_data_blob(const char *s);
|
||||
void base64_decode_inplace(char *s);
|
||||
char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data);
|
||||
SMB_BIG_UINT STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr);
|
||||
uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr);
|
||||
SMB_OFF_T conv_str_size(const char * str);
|
||||
void string_append(char **left, const char *right);
|
||||
bool add_string_to_array(TALLOC_CTX *mem_ctx,
|
||||
@ -4248,13 +4248,13 @@ bool cli_lock(struct cli_state *cli, int fnum,
|
||||
uint32 offset, uint32 len, int timeout, enum brl_type lock_type);
|
||||
bool cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len);
|
||||
bool cli_lock64(struct cli_state *cli, int fnum,
|
||||
SMB_BIG_UINT offset, SMB_BIG_UINT len, int timeout, enum brl_type lock_type);
|
||||
bool cli_unlock64(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_UINT len);
|
||||
uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type);
|
||||
bool cli_unlock64(struct cli_state *cli, int fnum, uint64_t offset, uint64_t len);
|
||||
bool cli_posix_lock(struct cli_state *cli, int fnum,
|
||||
SMB_BIG_UINT offset, SMB_BIG_UINT len,
|
||||
uint64_t offset, uint64_t len,
|
||||
bool wait_lock, enum brl_type lock_type);
|
||||
bool cli_posix_unlock(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_UINT len);
|
||||
bool cli_posix_getlock(struct cli_state *cli, int fnum, SMB_BIG_UINT *poffset, SMB_BIG_UINT *plen);
|
||||
bool cli_posix_unlock(struct cli_state *cli, int fnum, uint64_t offset, uint64_t len);
|
||||
bool cli_posix_getlock(struct cli_state *cli, int fnum, uint64_t *poffset, uint64_t *plen);
|
||||
bool cli_getattrE(struct cli_state *cli, int fd,
|
||||
uint16 *attr, SMB_OFF_T *size,
|
||||
time_t *change_time,
|
||||
@ -5106,20 +5106,20 @@ const char *lock_type_name(enum brl_type lock_type);
|
||||
const char *lock_flav_name(enum brl_flavour lock_flav);
|
||||
bool is_locked(files_struct *fsp,
|
||||
uint32 smbpid,
|
||||
SMB_BIG_UINT count,
|
||||
SMB_BIG_UINT offset,
|
||||
uint64_t count,
|
||||
uint64_t offset,
|
||||
enum brl_type lock_type);
|
||||
NTSTATUS query_lock(files_struct *fsp,
|
||||
uint32 *psmbpid,
|
||||
SMB_BIG_UINT *pcount,
|
||||
SMB_BIG_UINT *poffset,
|
||||
uint64_t *pcount,
|
||||
uint64_t *poffset,
|
||||
enum brl_type *plock_type,
|
||||
enum brl_flavour lock_flav);
|
||||
struct byte_range_lock *do_lock(struct messaging_context *msg_ctx,
|
||||
files_struct *fsp,
|
||||
uint32 lock_pid,
|
||||
SMB_BIG_UINT count,
|
||||
SMB_BIG_UINT offset,
|
||||
uint64_t count,
|
||||
uint64_t offset,
|
||||
enum brl_type lock_type,
|
||||
enum brl_flavour lock_flav,
|
||||
bool blocking_lock,
|
||||
@ -5128,13 +5128,13 @@ struct byte_range_lock *do_lock(struct messaging_context *msg_ctx,
|
||||
NTSTATUS do_unlock(struct messaging_context *msg_ctx,
|
||||
files_struct *fsp,
|
||||
uint32 lock_pid,
|
||||
SMB_BIG_UINT count,
|
||||
SMB_BIG_UINT offset,
|
||||
uint64_t count,
|
||||
uint64_t offset,
|
||||
enum brl_flavour lock_flav);
|
||||
NTSTATUS do_lock_cancel(files_struct *fsp,
|
||||
uint32 lock_pid,
|
||||
SMB_BIG_UINT count,
|
||||
SMB_BIG_UINT offset,
|
||||
uint64_t count,
|
||||
uint64_t offset,
|
||||
enum brl_flavour lock_flav);
|
||||
void locking_close_file(struct messaging_context *msg_ctx,
|
||||
files_struct *fsp);
|
||||
@ -5186,8 +5186,8 @@ int share_mode_forall(void (*fn)(const struct share_mode_entry *, const char *,
|
||||
/* The following definitions come from locking/posix.c */
|
||||
|
||||
bool is_posix_locked(files_struct *fsp,
|
||||
SMB_BIG_UINT *pu_offset,
|
||||
SMB_BIG_UINT *pu_count,
|
||||
uint64_t *pu_offset,
|
||||
uint64_t *pu_count,
|
||||
enum brl_type *plock_type,
|
||||
enum brl_flavour lock_flav);
|
||||
bool posix_locking_init(bool read_only);
|
||||
@ -5195,28 +5195,28 @@ bool posix_locking_end(void);
|
||||
void reduce_windows_lock_ref_count(files_struct *fsp, unsigned int dcount);
|
||||
int fd_close_posix(struct files_struct *fsp);
|
||||
bool set_posix_lock_windows_flavour(files_struct *fsp,
|
||||
SMB_BIG_UINT u_offset,
|
||||
SMB_BIG_UINT u_count,
|
||||
uint64_t u_offset,
|
||||
uint64_t u_count,
|
||||
enum brl_type lock_type,
|
||||
const struct lock_context *lock_ctx,
|
||||
const struct lock_struct *plocks,
|
||||
int num_locks,
|
||||
int *errno_ret);
|
||||
bool release_posix_lock_windows_flavour(files_struct *fsp,
|
||||
SMB_BIG_UINT u_offset,
|
||||
SMB_BIG_UINT u_count,
|
||||
uint64_t u_offset,
|
||||
uint64_t u_count,
|
||||
enum brl_type deleted_lock_type,
|
||||
const struct lock_context *lock_ctx,
|
||||
const struct lock_struct *plocks,
|
||||
int num_locks);
|
||||
bool set_posix_lock_posix_flavour(files_struct *fsp,
|
||||
SMB_BIG_UINT u_offset,
|
||||
SMB_BIG_UINT u_count,
|
||||
uint64_t u_offset,
|
||||
uint64_t u_count,
|
||||
enum brl_type lock_type,
|
||||
int *errno_ret);
|
||||
bool release_posix_lock_posix_flavour(files_struct *fsp,
|
||||
SMB_BIG_UINT u_offset,
|
||||
SMB_BIG_UINT u_count,
|
||||
uint64_t u_offset,
|
||||
uint64_t u_count,
|
||||
const struct lock_context *lock_ctx,
|
||||
const struct lock_struct *plocks,
|
||||
int num_locks);
|
||||
@ -9322,16 +9322,16 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
|
||||
uint32 lock_pid,
|
||||
enum brl_type lock_type,
|
||||
enum brl_flavour lock_flav,
|
||||
SMB_BIG_UINT offset,
|
||||
SMB_BIG_UINT count,
|
||||
uint64_t offset,
|
||||
uint64_t count,
|
||||
uint32 blocking_pid);
|
||||
void cancel_pending_lock_requests_by_fid(files_struct *fsp, struct byte_range_lock *br_lck);
|
||||
void remove_pending_lock_requests_by_mid(int mid);
|
||||
bool blocking_lock_was_deferred(int mid);
|
||||
bool blocking_lock_cancel(files_struct *fsp,
|
||||
uint32 lock_pid,
|
||||
SMB_BIG_UINT offset,
|
||||
SMB_BIG_UINT count,
|
||||
uint64_t offset,
|
||||
uint64_t count,
|
||||
enum brl_flavour lock_flav,
|
||||
unsigned char locktype,
|
||||
NTSTATUS err);
|
||||
@ -9397,14 +9397,14 @@ bool register_message_flags(bool doreg, uint32 msg_flags);
|
||||
|
||||
/* The following definitions come from smbd/dfree.c */
|
||||
|
||||
SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small_query,
|
||||
SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize);
|
||||
SMB_BIG_UINT get_dfree_info(connection_struct *conn,
|
||||
uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_query,
|
||||
uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
|
||||
uint64_t get_dfree_info(connection_struct *conn,
|
||||
const char *path,
|
||||
bool small_query,
|
||||
SMB_BIG_UINT *bsize,
|
||||
SMB_BIG_UINT *dfree,
|
||||
SMB_BIG_UINT *dsize);
|
||||
uint64_t *bsize,
|
||||
uint64_t *dfree,
|
||||
uint64_t *dsize);
|
||||
|
||||
/* The following definitions come from smbd/dir.c */
|
||||
|
||||
@ -9806,7 +9806,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
SMB_BIG_UINT allocation_size,
|
||||
uint64_t allocation_size,
|
||||
struct security_descriptor *sd,
|
||||
struct ea_list *ea_list,
|
||||
|
||||
@ -9823,7 +9823,7 @@ NTSTATUS create_file(connection_struct *conn,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
SMB_BIG_UINT allocation_size,
|
||||
uint64_t allocation_size,
|
||||
struct security_descriptor *sd,
|
||||
struct ea_list *ea_list,
|
||||
|
||||
@ -9950,18 +9950,18 @@ void smbd_process(void);
|
||||
|
||||
/* The following definitions come from smbd/quotas.c */
|
||||
|
||||
bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
|
||||
bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
|
||||
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
|
||||
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
|
||||
bool disk_quotas(const char *path,
|
||||
SMB_BIG_UINT *bsize,
|
||||
SMB_BIG_UINT *dfree,
|
||||
SMB_BIG_UINT *dsize);
|
||||
bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
|
||||
bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
|
||||
bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
|
||||
bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
|
||||
bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize);
|
||||
bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize);
|
||||
uint64_t *bsize,
|
||||
uint64_t *dfree,
|
||||
uint64_t *dsize);
|
||||
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
|
||||
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
|
||||
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
|
||||
bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
|
||||
bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
|
||||
bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
|
||||
|
||||
/* The following definitions come from smbd/reply.c */
|
||||
|
||||
@ -10071,8 +10071,8 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
|
||||
bool target_is_directory);
|
||||
void reply_copy(struct smb_request *req);
|
||||
uint32 get_lock_pid( char *data, int data_offset, bool large_file_format);
|
||||
SMB_BIG_UINT get_lock_count( char *data, int data_offset, bool large_file_format);
|
||||
SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err);
|
||||
uint64_t get_lock_count( char *data, int data_offset, bool large_file_format);
|
||||
uint64_t get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err);
|
||||
void reply_lockingX(struct smb_request *req);
|
||||
void reply_readbmpx(struct smb_request *req);
|
||||
void reply_readbs(struct smb_request *req);
|
||||
@ -10190,8 +10190,8 @@ int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf);
|
||||
|
||||
/* The following definitions come from smbd/trans2.c */
|
||||
|
||||
SMB_BIG_UINT smb_roundup(connection_struct *conn, SMB_BIG_UINT val);
|
||||
SMB_BIG_UINT get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf);
|
||||
uint64_t smb_roundup(connection_struct *conn, uint64_t val);
|
||||
uint64_t get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf);
|
||||
NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
|
||||
files_struct *fsp, const char *fname,
|
||||
const char *ea_name, struct ea_struct *pea);
|
||||
@ -10275,7 +10275,7 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
|
||||
const char *buffer,
|
||||
size_t N,
|
||||
SMB_OFF_T offset);
|
||||
int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len);
|
||||
int vfs_allocate_file_space(files_struct *fsp, uint64_t len);
|
||||
int vfs_set_filelen(files_struct *fsp, 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);
|
||||
|
@ -360,7 +360,7 @@ typedef struct {
|
||||
struct fd_handle {
|
||||
size_t ref_count;
|
||||
int fd;
|
||||
SMB_BIG_UINT position_information;
|
||||
uint64_t position_information;
|
||||
SMB_OFF_T pos;
|
||||
uint32 private_options; /* NT Create options, but we only look at
|
||||
* NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and
|
||||
@ -436,7 +436,7 @@ typedef struct files_struct {
|
||||
unsigned int num_smb_operations;
|
||||
uint16 rap_print_jobid;
|
||||
struct file_id file_id;
|
||||
SMB_BIG_UINT initial_allocation_size; /* Faked up initial allocation on disk. */
|
||||
uint64_t initial_allocation_size; /* Faked up initial allocation on disk. */
|
||||
mode_t mode;
|
||||
uint16 file_pid;
|
||||
uint16 vuid;
|
||||
@ -547,10 +547,10 @@ struct stream_struct {
|
||||
|
||||
struct dfree_cached_info {
|
||||
time_t last_dfree_time;
|
||||
SMB_BIG_UINT dfree_ret;
|
||||
SMB_BIG_UINT bsize;
|
||||
SMB_BIG_UINT dfree;
|
||||
SMB_BIG_UINT dsize;
|
||||
uint64_t dfree_ret;
|
||||
uint64_t bsize;
|
||||
uint64_t dfree;
|
||||
uint64_t dsize;
|
||||
};
|
||||
|
||||
struct dptr_struct;
|
||||
|
@ -782,7 +782,7 @@ extern bool do_profile_times;
|
||||
|
||||
extern clockid_t __profile_clock;
|
||||
|
||||
static inline SMB_BIG_UINT profile_timestamp(void)
|
||||
static inline uint64_t profile_timestamp(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
@ -797,7 +797,7 @@ static inline SMB_BIG_UINT profile_timestamp(void)
|
||||
|
||||
#else
|
||||
|
||||
static inline SMB_BIG_UINT profile_timestamp(void)
|
||||
static inline uint64_t profile_timestamp(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
GetTimeOfDay(&tv);
|
||||
@ -830,14 +830,14 @@ static inline SMB_BIG_UINT profile_timestamp(void)
|
||||
}
|
||||
|
||||
#define START_PROFILE(x) \
|
||||
SMB_BIG_UINT __profstamp_##x = 0; \
|
||||
uint64_t __profstamp_##x = 0; \
|
||||
if (do_profile_flag) { \
|
||||
__profstamp_##x = do_profile_times ? profile_timestamp() : 0;\
|
||||
INC_PROFILE_COUNT(x##_count); \
|
||||
}
|
||||
|
||||
#define START_PROFILE_BYTES(x,n) \
|
||||
SMB_BIG_UINT __profstamp_##x = 0; \
|
||||
uint64_t __profstamp_##x = 0; \
|
||||
if (do_profile_flag) { \
|
||||
__profstamp_##x = do_profile_times ? profile_timestamp() : 0;\
|
||||
INC_PROFILE_COUNT(x##_count); \
|
||||
|
@ -37,8 +37,8 @@
|
||||
Some stuff for the sys_quota api.
|
||||
**************************************************/
|
||||
|
||||
#define SMB_QUOTAS_NO_LIMIT ((SMB_BIG_UINT)(0))
|
||||
#define SMB_QUOTAS_NO_SPACE ((SMB_BIG_UINT)(1))
|
||||
#define SMB_QUOTAS_NO_LIMIT ((uint64_t)(0))
|
||||
#define SMB_QUOTAS_NO_SPACE ((uint64_t)(1))
|
||||
|
||||
#define SMB_QUOTAS_SET_NO_LIMIT(dp) \
|
||||
{\
|
||||
@ -58,14 +58,14 @@
|
||||
|
||||
typedef struct _SMB_DISK_QUOTA {
|
||||
enum SMB_QUOTA_TYPE qtype;
|
||||
SMB_BIG_UINT bsize;
|
||||
SMB_BIG_UINT hardlimit; /* In bsize units. */
|
||||
SMB_BIG_UINT softlimit; /* In bsize units. */
|
||||
SMB_BIG_UINT curblocks; /* In bsize units. */
|
||||
SMB_BIG_UINT ihardlimit; /* inode hard limit. */
|
||||
SMB_BIG_UINT isoftlimit; /* inode soft limit. */
|
||||
SMB_BIG_UINT curinodes; /* Current used inodes. */
|
||||
uint32 qflags;
|
||||
uint64_t bsize;
|
||||
uint64_t hardlimit; /* In bsize units. */
|
||||
uint64_t softlimit; /* In bsize units. */
|
||||
uint64_t curblocks; /* In bsize units. */
|
||||
uint64_t ihardlimit; /* inode hard limit. */
|
||||
uint64_t isoftlimit; /* inode soft limit. */
|
||||
uint64_t curinodes; /* Current used inodes. */
|
||||
uint32_t qflags;
|
||||
} SMB_DISK_QUOTA;
|
||||
|
||||
#ifndef QUOTABLOCK_SIZE
|
||||
|
@ -282,8 +282,8 @@ struct vfs_ops {
|
||||
|
||||
int (*connect_fn)(struct vfs_handle_struct *handle, const char *service, const char *user);
|
||||
void (*disconnect)(struct vfs_handle_struct *handle);
|
||||
SMB_BIG_UINT (*disk_free)(struct vfs_handle_struct *handle, const char *path, bool small_query, SMB_BIG_UINT *bsize,
|
||||
SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
|
||||
uint64_t (*disk_free)(struct vfs_handle_struct *handle, const char *path, bool small_query, uint64_t *bsize,
|
||||
uint64_t *dfree, uint64_t *dsize);
|
||||
int (*get_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt);
|
||||
int (*set_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt);
|
||||
int (*get_shadow_copy_data)(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels);
|
||||
@ -625,14 +625,14 @@ typedef struct vfs_statvfs_struct {
|
||||
if no distinction is made return the same value in each.
|
||||
*/
|
||||
|
||||
SMB_BIG_UINT TotalBlocks;
|
||||
SMB_BIG_UINT BlocksAvail; /* bfree */
|
||||
SMB_BIG_UINT UserBlocksAvail; /* bavail */
|
||||
uint64_t TotalBlocks;
|
||||
uint64_t BlocksAvail; /* bfree */
|
||||
uint64_t UserBlocksAvail; /* bavail */
|
||||
|
||||
/* For undefined Node fields or FSID return -1 */
|
||||
SMB_BIG_UINT TotalFileNodes;
|
||||
SMB_BIG_UINT FreeFileNodes;
|
||||
SMB_BIG_UINT FsIdentifier; /* fsid */
|
||||
uint64_t TotalFileNodes;
|
||||
uint64_t FreeFileNodes;
|
||||
uint64_t FsIdentifier; /* fsid */
|
||||
/* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */
|
||||
/* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
/* Return the number of TOSIZE-byte blocks used by
|
||||
BLOCKS FROMSIZE-byte blocks, rounding away from zero.
|
||||
*/
|
||||
static SMB_BIG_UINT adjust_blocks(SMB_BIG_UINT blocks, SMB_BIG_UINT fromsize, SMB_BIG_UINT tosize)
|
||||
static uint64_t adjust_blocks(uint64_t blocks, uint64_t fromsize, uint64_t tosize)
|
||||
{
|
||||
if (fromsize == tosize) { /* e.g., from 512 to 512 */
|
||||
return blocks;
|
||||
@ -44,10 +44,10 @@ static SMB_BIG_UINT adjust_blocks(SMB_BIG_UINT blocks, SMB_BIG_UINT fromsize, SM
|
||||
|
||||
results are returned in *dfree and *dsize, in 512 byte units
|
||||
*/
|
||||
int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
int sys_fsusage(const char *path, uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
#ifdef STAT_STATFS3_OSF1
|
||||
#define CONVERT_BLOCKS(B) adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)fsd.f_fsize, (SMB_BIG_UINT)512)
|
||||
#define CONVERT_BLOCKS(B) adjust_blocks ((uint64_t)(B), (uint64_t)fsd.f_fsize, (uint64_t)512)
|
||||
struct statfs fsd;
|
||||
|
||||
if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
|
||||
@ -55,7 +55,7 @@ int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
#endif /* STAT_STATFS3_OSF1 */
|
||||
|
||||
#ifdef STAT_STATFS2_FS_DATA /* Ultrix */
|
||||
#define CONVERT_BLOCKS(B) adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)1024, (SMB_BIG_UINT)512)
|
||||
#define CONVERT_BLOCKS(B) adjust_blocks ((uint64_t)(B), (uint64_t)1024, (uint64_t)512)
|
||||
struct fs_data fsd;
|
||||
|
||||
if (statfs (path, &fsd) != 1)
|
||||
@ -66,7 +66,7 @@ int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
#endif /* STAT_STATFS2_FS_DATA */
|
||||
|
||||
#ifdef STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX */
|
||||
#define CONVERT_BLOCKS(B) adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)fsd.f_bsize, (SMB_BIG_UINT)512)
|
||||
#define CONVERT_BLOCKS(B) adjust_blocks ((uint64_t)(B), (uint64_t)fsd.f_bsize, (uint64_t)512)
|
||||
struct statfs fsd;
|
||||
|
||||
if (statfs (path, &fsd) < 0)
|
||||
@ -88,7 +88,7 @@ int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
|
||||
|
||||
#ifdef STAT_STATFS2_FSIZE /* 4.4BSD */
|
||||
#define CONVERT_BLOCKS(B) adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)fsd.f_fsize, (SMB_BIG_UINT)512)
|
||||
#define CONVERT_BLOCKS(B) adjust_blocks ((uint64_t)(B), (uint64_t)fsd.f_fsize, (uint64_t)512)
|
||||
|
||||
struct statfs fsd;
|
||||
|
||||
@ -98,12 +98,12 @@ int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
|
||||
#ifdef STAT_STATFS4 /* SVR3, Dynix, Irix, AIX */
|
||||
# if _AIX || defined(_CRAY)
|
||||
# define CONVERT_BLOCKS(B) adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)fsd.f_bsize, (SMB_BIG_UINT)512)
|
||||
# define CONVERT_BLOCKS(B) adjust_blocks ((uint64_t)(B), (uint64_t)fsd.f_bsize, (uint64_t)512)
|
||||
# ifdef _CRAY
|
||||
# define f_bavail f_bfree
|
||||
# endif
|
||||
# else
|
||||
# define CONVERT_BLOCKS(B) ((SMB_BIG_UINT)B)
|
||||
# define CONVERT_BLOCKS(B) ((uint64_t)B)
|
||||
# ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx */
|
||||
# ifndef DOLPHIN /* DOLPHIN 3.8.alfa/7.18 has f_bavail */
|
||||
# define f_bavail f_bfree
|
||||
@ -124,10 +124,10 @@ int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
#if defined(STAT_STATVFS) || defined(STAT_STATVFS64) /* SVR4 */
|
||||
#if defined HAVE_FRSIZE
|
||||
# define CONVERT_BLOCKS(B) \
|
||||
adjust_blocks ((SMB_BIG_UINT)(B), fsd.f_frsize ? (SMB_BIG_UINT)fsd.f_frsize : (SMB_BIG_UINT)fsd.f_bsize, (SMB_BIG_UINT)512)
|
||||
adjust_blocks ((uint64_t)(B), fsd.f_frsize ? (uint64_t)fsd.f_frsize : (uint64_t)fsd.f_bsize, (uint64_t)512)
|
||||
#else
|
||||
# define CONVERT_BLOCKS(B) \
|
||||
adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)fsd.f_bsize, (SMB_BIG_UINT)512)
|
||||
adjust_blocks ((uint64_t)(B), (uint64_t)fsd.f_bsize, (uint64_t)512)
|
||||
#endif
|
||||
|
||||
#ifdef STAT_STATVFS64
|
||||
|
@ -161,7 +161,7 @@ int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorf
|
||||
errorfds_buf = *errorfds;
|
||||
if (ptval && (errno == EINTR)) {
|
||||
struct timeval now_time;
|
||||
SMB_BIG_INT tdif;
|
||||
int64_t tdif;
|
||||
|
||||
GetTimeOfDay(&now_time);
|
||||
tdif = usec_time_diff(&end_time, &now_time);
|
||||
|
@ -1211,7 +1211,7 @@ static int smbldap_search_ext(struct smbldap_state *ldap_state,
|
||||
|
||||
if (ldap_state->last_rebind.tv_sec > 0) {
|
||||
struct timeval tval;
|
||||
SMB_BIG_INT tdiff = 0;
|
||||
int64_t tdiff = 0;
|
||||
int sleep_time = 0;
|
||||
|
||||
ZERO_STRUCT(tval);
|
||||
|
@ -89,7 +89,7 @@ int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
|
||||
int ret = -1;
|
||||
uint32 qflags = 0;
|
||||
struct dqblk D;
|
||||
SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
|
||||
ZERO_STRUCT(D);
|
||||
ZERO_STRUCT(*dp);
|
||||
@ -162,12 +162,12 @@ int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
|
||||
}
|
||||
|
||||
dp->bsize = bsize;
|
||||
dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
|
||||
dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
|
||||
dp->curblocks = (SMB_BIG_UINT)D.dqb_curblocks;
|
||||
dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
|
||||
dp->curinodes = (uint64_t)D.dqb_curinodes;
|
||||
dp->curblocks = (uint64_t)D.dqb_curblocks;
|
||||
|
||||
|
||||
dp->qflags = qflags;
|
||||
@ -184,7 +184,7 @@ int sys_set_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
|
||||
uint32 qflags = 0;
|
||||
uint32 oldqflags = 0;
|
||||
struct dqblk D;
|
||||
SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
|
||||
ZERO_STRUCT(D);
|
||||
|
||||
|
@ -41,7 +41,7 @@ static int sys_get_linux_v1_quota(const char *path, const char *bdev, enum SMB_Q
|
||||
int ret = -1;
|
||||
uint32 qflags = 0;
|
||||
struct v1_kern_dqblk D;
|
||||
SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
|
||||
ZERO_STRUCT(D);
|
||||
|
||||
@ -88,12 +88,12 @@ static int sys_get_linux_v1_quota(const char *path, const char *bdev, enum SMB_Q
|
||||
}
|
||||
|
||||
dp->bsize = bsize;
|
||||
dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
|
||||
dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
|
||||
dp->curblocks = (SMB_BIG_UINT)D.dqb_curblocks;
|
||||
dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
|
||||
dp->curinodes = (uint64_t)D.dqb_curinodes;
|
||||
dp->curblocks = (uint64_t)D.dqb_curblocks;
|
||||
|
||||
|
||||
dp->qflags = qflags;
|
||||
@ -110,7 +110,7 @@ static int sys_set_linux_v1_quota(const char *path, const char *bdev, enum SMB_Q
|
||||
uint32 qflags = 0;
|
||||
uint32 oldqflags = 0;
|
||||
struct v1_kern_dqblk D;
|
||||
SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
|
||||
ZERO_STRUCT(D);
|
||||
|
||||
@ -175,7 +175,7 @@ static int sys_get_linux_v2_quota(const char *path, const char *bdev, enum SMB_Q
|
||||
int ret = -1;
|
||||
uint32 qflags = 0;
|
||||
struct v2_kern_dqblk D;
|
||||
SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
|
||||
ZERO_STRUCT(D);
|
||||
|
||||
@ -222,12 +222,12 @@ static int sys_get_linux_v2_quota(const char *path, const char *bdev, enum SMB_Q
|
||||
}
|
||||
|
||||
dp->bsize = bsize;
|
||||
dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
|
||||
dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
|
||||
dp->curblocks = (SMB_BIG_UINT)D.dqb_curspace/bsize;
|
||||
dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
|
||||
dp->curinodes = (uint64_t)D.dqb_curinodes;
|
||||
dp->curblocks = (uint64_t)D.dqb_curspace/bsize;
|
||||
|
||||
|
||||
dp->qflags = qflags;
|
||||
@ -244,7 +244,7 @@ static int sys_set_linux_v2_quota(const char *path, const char *bdev, enum SMB_Q
|
||||
uint32 qflags = 0;
|
||||
uint32 oldqflags = 0;
|
||||
struct v2_kern_dqblk D;
|
||||
SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
|
||||
ZERO_STRUCT(D);
|
||||
|
||||
@ -309,7 +309,7 @@ static int sys_get_linux_gen_quota(const char *path, const char *bdev, enum SMB_
|
||||
int ret = -1;
|
||||
uint32 qflags = 0;
|
||||
struct if_dqblk D;
|
||||
SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
|
||||
ZERO_STRUCT(D);
|
||||
|
||||
@ -356,12 +356,12 @@ static int sys_get_linux_gen_quota(const char *path, const char *bdev, enum SMB_
|
||||
}
|
||||
|
||||
dp->bsize = bsize;
|
||||
dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
|
||||
dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
|
||||
dp->curblocks = (SMB_BIG_UINT)D.dqb_curspace/bsize;
|
||||
dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
|
||||
dp->curinodes = (uint64_t)D.dqb_curinodes;
|
||||
dp->curblocks = (uint64_t)D.dqb_curspace/bsize;
|
||||
|
||||
|
||||
dp->qflags = qflags;
|
||||
@ -378,7 +378,7 @@ static int sys_set_linux_gen_quota(const char *path, const char *bdev, enum SMB_
|
||||
uint32 qflags = 0;
|
||||
uint32 oldqflags = 0;
|
||||
struct if_dqblk D;
|
||||
SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
|
||||
ZERO_STRUCT(D);
|
||||
|
||||
|
@ -76,7 +76,7 @@ int sys_get_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
|
||||
{
|
||||
int ret = -1;
|
||||
uint32 qflags = 0;
|
||||
SMB_BIG_UINT bsize = (SMB_BIG_UINT)BBSIZE;
|
||||
uint64_t bsize = (uint64_t)BBSIZE;
|
||||
struct fs_disk_quota D;
|
||||
struct fs_quota_stat F;
|
||||
ZERO_STRUCT(D);
|
||||
@ -145,12 +145,12 @@ int sys_get_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
|
||||
}
|
||||
|
||||
dp->bsize = bsize;
|
||||
dp->softlimit = (SMB_BIG_UINT)D.d_blk_softlimit;
|
||||
dp->hardlimit = (SMB_BIG_UINT)D.d_blk_hardlimit;
|
||||
dp->ihardlimit = (SMB_BIG_UINT)D.d_ino_hardlimit;
|
||||
dp->isoftlimit = (SMB_BIG_UINT)D.d_ino_softlimit;
|
||||
dp->curinodes = (SMB_BIG_UINT)D.d_icount;
|
||||
dp->curblocks = (SMB_BIG_UINT)D.d_bcount;
|
||||
dp->softlimit = (uint64_t)D.d_blk_softlimit;
|
||||
dp->hardlimit = (uint64_t)D.d_blk_hardlimit;
|
||||
dp->ihardlimit = (uint64_t)D.d_ino_hardlimit;
|
||||
dp->isoftlimit = (uint64_t)D.d_ino_softlimit;
|
||||
dp->curinodes = (uint64_t)D.d_icount;
|
||||
dp->curblocks = (uint64_t)D.d_bcount;
|
||||
dp->qflags = qflags;
|
||||
|
||||
return ret;
|
||||
@ -163,7 +163,7 @@ int sys_set_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
|
||||
{
|
||||
int ret = -1;
|
||||
uint32 qflags = 0;
|
||||
SMB_BIG_UINT bsize = (SMB_BIG_UINT)BBSIZE;
|
||||
uint64_t bsize = (uint64_t)BBSIZE;
|
||||
struct fs_disk_quota D;
|
||||
struct fs_quota_stat F;
|
||||
int q_on = 0;
|
||||
|
@ -2279,10 +2279,10 @@ char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data)
|
||||
}
|
||||
|
||||
/* read a SMB_BIG_UINT from a string */
|
||||
SMB_BIG_UINT STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr)
|
||||
uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr)
|
||||
{
|
||||
|
||||
SMB_BIG_UINT val = -1;
|
||||
uint64_t val = -1;
|
||||
const char *p = nptr;
|
||||
|
||||
if (!p) {
|
||||
@ -2295,11 +2295,7 @@ SMB_BIG_UINT STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr)
|
||||
while (*p && isspace(*p))
|
||||
p++;
|
||||
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
sscanf(p,"%llu",&val);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
sscanf(p,"%lu",&val);
|
||||
#endif /* LARGE_SMB_OFF_T */
|
||||
sscanf(p,"%"PRIu64,&val);
|
||||
if (entptr) {
|
||||
while (*p && isdigit(*p))
|
||||
p++;
|
||||
|
@ -1234,7 +1234,7 @@ bool cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len)
|
||||
****************************************************************************/
|
||||
|
||||
bool cli_lock64(struct cli_state *cli, int fnum,
|
||||
SMB_BIG_UINT offset, SMB_BIG_UINT len, int timeout, enum brl_type lock_type)
|
||||
uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type)
|
||||
{
|
||||
char *p;
|
||||
int saved_timeout = cli->timeout;
|
||||
@ -1294,7 +1294,7 @@ bool cli_lock64(struct cli_state *cli, int fnum,
|
||||
Unlock a file with 64 bit offsets.
|
||||
****************************************************************************/
|
||||
|
||||
bool cli_unlock64(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_UINT len)
|
||||
bool cli_unlock64(struct cli_state *cli, int fnum, uint64_t offset, uint64_t len)
|
||||
{
|
||||
char *p;
|
||||
|
||||
@ -1341,7 +1341,7 @@ bool cli_unlock64(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_
|
||||
****************************************************************************/
|
||||
|
||||
static bool cli_posix_lock_internal(struct cli_state *cli, int fnum,
|
||||
SMB_BIG_UINT offset, SMB_BIG_UINT len, bool wait_lock, enum brl_type lock_type)
|
||||
uint64_t offset, uint64_t len, bool wait_lock, enum brl_type lock_type)
|
||||
{
|
||||
unsigned int param_len = 4;
|
||||
unsigned int data_len = POSIX_LOCK_DATA_SIZE;
|
||||
@ -1412,7 +1412,7 @@ static bool cli_posix_lock_internal(struct cli_state *cli, int fnum,
|
||||
****************************************************************************/
|
||||
|
||||
bool cli_posix_lock(struct cli_state *cli, int fnum,
|
||||
SMB_BIG_UINT offset, SMB_BIG_UINT len,
|
||||
uint64_t offset, uint64_t len,
|
||||
bool wait_lock, enum brl_type lock_type)
|
||||
{
|
||||
if (lock_type != READ_LOCK && lock_type != WRITE_LOCK) {
|
||||
@ -1425,7 +1425,7 @@ bool cli_posix_lock(struct cli_state *cli, int fnum,
|
||||
POSIX Unlock a file.
|
||||
****************************************************************************/
|
||||
|
||||
bool cli_posix_unlock(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_UINT len)
|
||||
bool cli_posix_unlock(struct cli_state *cli, int fnum, uint64_t offset, uint64_t len)
|
||||
{
|
||||
return cli_posix_lock_internal(cli, fnum, offset, len, False, UNLOCK_LOCK);
|
||||
}
|
||||
@ -1434,7 +1434,7 @@ bool cli_posix_unlock(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_
|
||||
POSIX Get any lock covering a file.
|
||||
****************************************************************************/
|
||||
|
||||
bool cli_posix_getlock(struct cli_state *cli, int fnum, SMB_BIG_UINT *poffset, SMB_BIG_UINT *plen)
|
||||
bool cli_posix_getlock(struct cli_state *cli, int fnum, uint64_t *poffset, uint64_t *plen)
|
||||
{
|
||||
return True;
|
||||
}
|
||||
|
@ -78,10 +78,10 @@ static bool parse_user_quota_record(const char *rdata, unsigned int rdata_count,
|
||||
* maybe its the change time in NTTIME
|
||||
*/
|
||||
|
||||
/* the used space 8 bytes (SMB_BIG_UINT)*/
|
||||
qt.usedspace = (SMB_BIG_UINT)IVAL(rdata,16);
|
||||
/* the used space 8 bytes (uint64_t)*/
|
||||
qt.usedspace = (uint64_t)IVAL(rdata,16);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
qt.usedspace |= (((SMB_BIG_UINT)IVAL(rdata,20)) << 32);
|
||||
qt.usedspace |= (((uint64_t)IVAL(rdata,20)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if ((IVAL(rdata,20) != 0)&&
|
||||
((qt.usedspace != 0xFFFFFFFF)||
|
||||
@ -91,10 +91,10 @@ static bool parse_user_quota_record(const char *rdata, unsigned int rdata_count,
|
||||
}
|
||||
#endif /* LARGE_SMB_OFF_T */
|
||||
|
||||
/* the soft quotas 8 bytes (SMB_BIG_UINT)*/
|
||||
qt.softlim = (SMB_BIG_UINT)IVAL(rdata,24);
|
||||
/* the soft quotas 8 bytes (uint64_t)*/
|
||||
qt.softlim = (uint64_t)IVAL(rdata,24);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
qt.softlim |= (((SMB_BIG_UINT)IVAL(rdata,28)) << 32);
|
||||
qt.softlim |= (((uint64_t)IVAL(rdata,28)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if ((IVAL(rdata,28) != 0)&&
|
||||
((qt.softlim != 0xFFFFFFFF)||
|
||||
@ -104,10 +104,10 @@ static bool parse_user_quota_record(const char *rdata, unsigned int rdata_count,
|
||||
}
|
||||
#endif /* LARGE_SMB_OFF_T */
|
||||
|
||||
/* the hard quotas 8 bytes (SMB_BIG_UINT)*/
|
||||
qt.hardlim = (SMB_BIG_UINT)IVAL(rdata,32);
|
||||
/* the hard quotas 8 bytes (uint64_t)*/
|
||||
qt.hardlim = (uint64_t)IVAL(rdata,32);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
qt.hardlim |= (((SMB_BIG_UINT)IVAL(rdata,36)) << 32);
|
||||
qt.hardlim |= (((uint64_t)IVAL(rdata,36)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if ((IVAL(rdata,36) != 0)&&
|
||||
((qt.hardlim != 0xFFFFFFFF)||
|
||||
@ -216,7 +216,7 @@ bool cli_set_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUC
|
||||
sid_len = ndr_size_dom_sid(&pqt->sid, 0);
|
||||
SIVAL(data,0,0);
|
||||
SIVAL(data,4,sid_len);
|
||||
SBIG_UINT(data, 8,(SMB_BIG_UINT)0);
|
||||
SBIG_UINT(data, 8,(uint64_t)0);
|
||||
SBIG_UINT(data,16,pqt->usedspace);
|
||||
SBIG_UINT(data,24,pqt->softlim);
|
||||
SBIG_UINT(data,32,pqt->hardlim);
|
||||
@ -458,10 +458,10 @@ bool cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_ST
|
||||
|
||||
/* unknown_1 24 NULL bytes in pdata*/
|
||||
|
||||
/* the soft quotas 8 bytes (SMB_BIG_UINT)*/
|
||||
qt.softlim = (SMB_BIG_UINT)IVAL(rdata,24);
|
||||
/* the soft quotas 8 bytes (uint64_t)*/
|
||||
qt.softlim = (uint64_t)IVAL(rdata,24);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
qt.softlim |= (((SMB_BIG_UINT)IVAL(rdata,28)) << 32);
|
||||
qt.softlim |= (((uint64_t)IVAL(rdata,28)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if ((IVAL(rdata,28) != 0)&&
|
||||
((qt.softlim != 0xFFFFFFFF)||
|
||||
@ -471,10 +471,10 @@ bool cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_ST
|
||||
}
|
||||
#endif /* LARGE_SMB_OFF_T */
|
||||
|
||||
/* the hard quotas 8 bytes (SMB_BIG_UINT)*/
|
||||
qt.hardlim = (SMB_BIG_UINT)IVAL(rdata,32);
|
||||
/* the hard quotas 8 bytes (uint64_t)*/
|
||||
qt.hardlim = (uint64_t)IVAL(rdata,32);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
qt.hardlim |= (((SMB_BIG_UINT)IVAL(rdata,36)) << 32);
|
||||
qt.hardlim |= (((uint64_t)IVAL(rdata,36)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if ((IVAL(rdata,36) != 0)&&
|
||||
((qt.hardlim != 0xFFFFFFFF)||
|
||||
@ -562,18 +562,14 @@ cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const char *quota_str_static(SMB_BIG_UINT val, bool special, bool _numeric)
|
||||
static const char *quota_str_static(uint64_t val, bool special, bool _numeric)
|
||||
{
|
||||
const char *result;
|
||||
|
||||
if (!_numeric&&special&&(val == SMB_NTQUOTAS_NO_LIMIT)) {
|
||||
return "NO LIMIT";
|
||||
}
|
||||
#if defined(HAVE_LONGLONG)
|
||||
result = talloc_asprintf(talloc_tos(), "%llu", val);
|
||||
#else
|
||||
result = talloc_asprintf(talloc_tos(), "%lu", val);
|
||||
#endif
|
||||
result = talloc_asprintf(talloc_tos(), "%"PRIu64, val);
|
||||
SMB_ASSERT(result != NULL);
|
||||
return result;
|
||||
}
|
||||
|
@ -70,10 +70,10 @@ struct async_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
|
||||
SSVAL(vwv + 8, 0, 0);
|
||||
SSVAL(vwv + 9, 0, 0);
|
||||
|
||||
if ((SMB_BIG_UINT)offset >> 32) {
|
||||
if ((uint64_t)offset >> 32) {
|
||||
bigoffset = True;
|
||||
SIVAL(vwv + 10, 0,
|
||||
(((SMB_BIG_UINT)offset)>>32) & 0xffffffff);
|
||||
(((uint64_t)offset)>>32) & 0xffffffff);
|
||||
wct += 2;
|
||||
}
|
||||
|
||||
@ -543,7 +543,7 @@ static bool cli_issue_write(struct cli_state *cli,
|
||||
smb_buf(cli->outbuf) - smb_base(cli->outbuf) + 1);
|
||||
|
||||
if (large_writex) {
|
||||
SIVAL(cli->outbuf,smb_vwv12,(((SMB_BIG_UINT)offset)>>32) & 0xffffffff);
|
||||
SIVAL(cli->outbuf,smb_vwv12,(((uint64_t)offset)>>32) & 0xffffffff);
|
||||
}
|
||||
|
||||
p = smb_base(cli->outbuf) + SVAL(cli->outbuf,smb_vwv11) -1;
|
||||
|
@ -77,8 +77,8 @@ const char *lock_flav_name(enum brl_flavour lock_flav)
|
||||
|
||||
bool is_locked(files_struct *fsp,
|
||||
uint32 smbpid,
|
||||
SMB_BIG_UINT count,
|
||||
SMB_BIG_UINT offset,
|
||||
uint64_t count,
|
||||
uint64_t offset,
|
||||
enum brl_type lock_type)
|
||||
{
|
||||
int strict_locking = lp_strict_locking(fsp->conn->params);
|
||||
@ -144,8 +144,8 @@ bool is_locked(files_struct *fsp,
|
||||
|
||||
NTSTATUS query_lock(files_struct *fsp,
|
||||
uint32 *psmbpid,
|
||||
SMB_BIG_UINT *pcount,
|
||||
SMB_BIG_UINT *poffset,
|
||||
uint64_t *pcount,
|
||||
uint64_t *poffset,
|
||||
enum brl_type *plock_type,
|
||||
enum brl_flavour lock_flav)
|
||||
{
|
||||
@ -184,8 +184,8 @@ NTSTATUS query_lock(files_struct *fsp,
|
||||
struct byte_range_lock *do_lock(struct messaging_context *msg_ctx,
|
||||
files_struct *fsp,
|
||||
uint32 lock_pid,
|
||||
SMB_BIG_UINT count,
|
||||
SMB_BIG_UINT offset,
|
||||
uint64_t count,
|
||||
uint64_t offset,
|
||||
enum brl_type lock_type,
|
||||
enum brl_flavour lock_flav,
|
||||
bool blocking_lock,
|
||||
@ -251,8 +251,8 @@ struct byte_range_lock *do_lock(struct messaging_context *msg_ctx,
|
||||
NTSTATUS do_unlock(struct messaging_context *msg_ctx,
|
||||
files_struct *fsp,
|
||||
uint32 lock_pid,
|
||||
SMB_BIG_UINT count,
|
||||
SMB_BIG_UINT offset,
|
||||
uint64_t count,
|
||||
uint64_t offset,
|
||||
enum brl_flavour lock_flav)
|
||||
{
|
||||
bool ok = False;
|
||||
@ -304,8 +304,8 @@ NTSTATUS do_unlock(struct messaging_context *msg_ctx,
|
||||
|
||||
NTSTATUS do_lock_cancel(files_struct *fsp,
|
||||
uint32 lock_pid,
|
||||
SMB_BIG_UINT count,
|
||||
SMB_BIG_UINT offset,
|
||||
uint64_t count,
|
||||
uint64_t offset,
|
||||
enum brl_flavour lock_flav)
|
||||
{
|
||||
bool ok = False;
|
||||
|
@ -79,7 +79,7 @@ static const char *posix_lock_type_name(int lock_type)
|
||||
****************************************************************************/
|
||||
|
||||
static bool posix_lock_in_range(SMB_OFF_T *offset_out, SMB_OFF_T *count_out,
|
||||
SMB_BIG_UINT u_offset, SMB_BIG_UINT u_count)
|
||||
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;
|
||||
@ -132,9 +132,9 @@ static bool posix_lock_in_range(SMB_OFF_T *offset_out, SMB_OFF_T *count_out,
|
||||
* ignore this lock.
|
||||
*/
|
||||
|
||||
if (u_offset & ~((SMB_BIG_UINT)max_positive_lock_offset)) {
|
||||
if (u_offset & ~((uint64_t)max_positive_lock_offset)) {
|
||||
DEBUG(10,("posix_lock_in_range: (offset = %.0f) offset > %.0f and we cannot handle this. Ignoring lock.\n",
|
||||
(double)u_offset, (double)((SMB_BIG_UINT)max_positive_lock_offset) ));
|
||||
(double)u_offset, (double)((uint64_t)max_positive_lock_offset) ));
|
||||
return False;
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ static bool posix_lock_in_range(SMB_OFF_T *offset_out, SMB_OFF_T *count_out,
|
||||
* We must truncate the count to less than max_positive_lock_offset.
|
||||
*/
|
||||
|
||||
if (u_count & ~((SMB_BIG_UINT)max_positive_lock_offset)) {
|
||||
if (u_count & ~((uint64_t)max_positive_lock_offset)) {
|
||||
count = max_positive_lock_offset;
|
||||
}
|
||||
|
||||
@ -271,8 +271,8 @@ static bool posix_fcntl_getlock(files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T
|
||||
****************************************************************************/
|
||||
|
||||
bool is_posix_locked(files_struct *fsp,
|
||||
SMB_BIG_UINT *pu_offset,
|
||||
SMB_BIG_UINT *pu_count,
|
||||
uint64_t *pu_offset,
|
||||
uint64_t *pu_count,
|
||||
enum brl_type *plock_type,
|
||||
enum brl_flavour lock_flav)
|
||||
{
|
||||
@ -302,8 +302,8 @@ bool is_posix_locked(files_struct *fsp,
|
||||
|
||||
if (lock_flav == POSIX_LOCK) {
|
||||
/* Only POSIX lock queries need to know the details. */
|
||||
*pu_offset = (SMB_BIG_UINT)offset;
|
||||
*pu_count = (SMB_BIG_UINT)count;
|
||||
*pu_offset = (uint64_t)offset;
|
||||
*pu_count = (uint64_t)count;
|
||||
*plock_type = (posix_lock_type == F_RDLCK) ? READ_LOCK : WRITE_LOCK;
|
||||
}
|
||||
return True;
|
||||
@ -929,8 +929,8 @@ lock: start = %.0f, size = %.0f", (double)l_curr->start, (double)l_curr->size, (
|
||||
****************************************************************************/
|
||||
|
||||
bool set_posix_lock_windows_flavour(files_struct *fsp,
|
||||
SMB_BIG_UINT u_offset,
|
||||
SMB_BIG_UINT u_count,
|
||||
uint64_t u_offset,
|
||||
uint64_t u_count,
|
||||
enum brl_type lock_type,
|
||||
const struct lock_context *lock_ctx,
|
||||
const struct lock_struct *plocks,
|
||||
@ -1066,8 +1066,8 @@ bool set_posix_lock_windows_flavour(files_struct *fsp,
|
||||
****************************************************************************/
|
||||
|
||||
bool release_posix_lock_windows_flavour(files_struct *fsp,
|
||||
SMB_BIG_UINT u_offset,
|
||||
SMB_BIG_UINT u_count,
|
||||
uint64_t u_offset,
|
||||
uint64_t u_count,
|
||||
enum brl_type deleted_lock_type,
|
||||
const struct lock_context *lock_ctx,
|
||||
const struct lock_struct *plocks,
|
||||
@ -1189,8 +1189,8 @@ bool release_posix_lock_windows_flavour(files_struct *fsp,
|
||||
****************************************************************************/
|
||||
|
||||
bool set_posix_lock_posix_flavour(files_struct *fsp,
|
||||
SMB_BIG_UINT u_offset,
|
||||
SMB_BIG_UINT u_count,
|
||||
uint64_t u_offset,
|
||||
uint64_t u_count,
|
||||
enum brl_type lock_type,
|
||||
int *errno_ret)
|
||||
{
|
||||
@ -1229,8 +1229,8 @@ bool set_posix_lock_posix_flavour(files_struct *fsp,
|
||||
****************************************************************************/
|
||||
|
||||
bool release_posix_lock_posix_flavour(files_struct *fsp,
|
||||
SMB_BIG_UINT u_offset,
|
||||
SMB_BIG_UINT u_count,
|
||||
uint64_t u_offset,
|
||||
uint64_t u_count,
|
||||
const struct lock_context *lock_ctx,
|
||||
const struct lock_struct *plocks,
|
||||
int num_locks)
|
||||
|
@ -28,15 +28,15 @@
|
||||
static char *capencode(TALLOC_CTX *ctx, const char *from);
|
||||
static char *capdecode(TALLOC_CTX *ctx, const char *from);
|
||||
|
||||
static SMB_BIG_UINT cap_disk_free(vfs_handle_struct *handle, const char *path,
|
||||
bool small_query, SMB_BIG_UINT *bsize,
|
||||
SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
static uint64_t cap_disk_free(vfs_handle_struct *handle, const char *path,
|
||||
bool small_query, uint64_t *bsize,
|
||||
uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
char *cappath = capencode(talloc_tos(), path);
|
||||
|
||||
if (!cappath) {
|
||||
errno = ENOMEM;
|
||||
return (SMB_BIG_UINT)-1;
|
||||
return (uint64_t)-1;
|
||||
}
|
||||
return SMB_VFS_NEXT_DISK_FREE(handle, cappath, small_query, bsize,
|
||||
dfree, dsize);
|
||||
|
@ -40,10 +40,10 @@ static void vfswrap_disconnect(vfs_handle_struct *handle)
|
||||
|
||||
/* Disk operations */
|
||||
|
||||
static SMB_BIG_UINT vfswrap_disk_free(vfs_handle_struct *handle, const char *path, bool small_query, SMB_BIG_UINT *bsize,
|
||||
SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
static uint64_t vfswrap_disk_free(vfs_handle_struct *handle, const char *path, bool small_query, uint64_t *bsize,
|
||||
uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
SMB_BIG_UINT result;
|
||||
uint64_t result;
|
||||
|
||||
result = sys_disk_free(handle->conn, path, small_query, bsize, dfree, dsize);
|
||||
return result;
|
||||
|
@ -74,10 +74,10 @@ struct vfs_full_audit_private_data {
|
||||
static int smb_full_audit_connect(vfs_handle_struct *handle,
|
||||
const char *svc, const char *user);
|
||||
static void smb_full_audit_disconnect(vfs_handle_struct *handle);
|
||||
static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle,
|
||||
static uint64_t smb_full_audit_disk_free(vfs_handle_struct *handle,
|
||||
const char *path,
|
||||
bool small_query, SMB_BIG_UINT *bsize,
|
||||
SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
|
||||
bool small_query, uint64_t *bsize,
|
||||
uint64_t *dfree, uint64_t *dsize);
|
||||
static int smb_full_audit_get_quota(struct vfs_handle_struct *handle,
|
||||
enum SMB_QUOTA_TYPE qtype, unid_t id,
|
||||
SMB_DISK_QUOTA *qt);
|
||||
@ -910,12 +910,12 @@ static void smb_full_audit_disconnect(vfs_handle_struct *handle)
|
||||
return;
|
||||
}
|
||||
|
||||
static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle,
|
||||
static uint64_t smb_full_audit_disk_free(vfs_handle_struct *handle,
|
||||
const char *path,
|
||||
bool small_query, SMB_BIG_UINT *bsize,
|
||||
SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
bool small_query, uint64_t *bsize,
|
||||
uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
SMB_BIG_UINT result;
|
||||
uint64_t result;
|
||||
|
||||
result = SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
|
||||
dfree, dsize);
|
||||
|
@ -124,7 +124,7 @@ static struct name_record *wins_record_to_name_record(TDB_DATA key, TDB_DATA dat
|
||||
namerec->data.refresh_time = (time_t)refresh_time;
|
||||
namerec->data.id = id_low;
|
||||
#if defined(HAVE_LONGLONG)
|
||||
namerec->data.id |= ((SMB_BIG_UINT)id_high << 32);
|
||||
namerec->data.id |= ((uint64_t)id_high << 32);
|
||||
#endif
|
||||
namerec->data.wins_ip.s_addr = saddr;
|
||||
namerec->data.wins_flags = wins_flags,
|
||||
@ -412,14 +412,14 @@ static void update_wins_flag(struct name_record *namerec, int flags)
|
||||
Return the general ID value and increase it if requested.
|
||||
*****************************************************************************/
|
||||
|
||||
static void get_global_id_and_update(SMB_BIG_UINT *current_id, bool update)
|
||||
static void get_global_id_and_update(uint64_t *current_id, bool update)
|
||||
{
|
||||
/*
|
||||
* it's kept as a static here, to prevent people from messing
|
||||
* with the value directly
|
||||
*/
|
||||
|
||||
static SMB_BIG_UINT general_id = 1;
|
||||
static uint64_t general_id = 1;
|
||||
|
||||
DEBUG(5,("get_global_id_and_update: updating version ID: %d\n", (int)general_id));
|
||||
|
||||
|
@ -2389,9 +2389,9 @@ uint32 print_job_start(struct auth_serversupplied_info *server_info, int snum,
|
||||
|
||||
/* see if we have sufficient disk space */
|
||||
if (lp_minprintspace(snum)) {
|
||||
SMB_BIG_UINT dspace, dsize;
|
||||
uint64_t dspace, dsize;
|
||||
if (sys_fsusage(path, &dspace, &dsize) == 0 &&
|
||||
dspace < 2*(SMB_BIG_UINT)lp_minprintspace(snum)) {
|
||||
dspace < 2*(uint64_t)lp_minprintspace(snum)) {
|
||||
DEBUG(3, ("print_job_start: disk space check failed.\n"));
|
||||
release_print_db(pdb);
|
||||
errno = ENOSPC;
|
||||
|
@ -450,7 +450,7 @@ static uint32 _reg_perfcount_get_size_field(uint32 CounterType)
|
||||
/*********************************************************************
|
||||
*********************************************************************/
|
||||
|
||||
static uint32 _reg_perfcount_compute_scale(SMB_BIG_INT data)
|
||||
static uint32 _reg_perfcount_compute_scale(int64_t data)
|
||||
{
|
||||
int scale = 0;
|
||||
if(data == 0)
|
||||
@ -482,7 +482,7 @@ static bool _reg_perfcount_get_counter_info(PERF_DATA_BLOCK *block,
|
||||
char buf[PERFCOUNT_MAX_LEN];
|
||||
size_t dsize, padding;
|
||||
long int data32, dbuf[2];
|
||||
SMB_BIG_INT data64;
|
||||
int64_t data64;
|
||||
uint32 counter_size;
|
||||
|
||||
obj->counters[obj->NumCounters].DefaultScale = 0;
|
||||
@ -521,7 +521,7 @@ static bool _reg_perfcount_get_counter_info(PERF_DATA_BLOCK *block,
|
||||
memcpy(buf, data.dptr, data.dsize);
|
||||
data32 = strtol(buf, NULL, 0);
|
||||
if((obj->counters[obj->NumCounters].CounterType & 0x00000F00) == PERF_TYPE_NUMBER)
|
||||
obj->counters[obj->NumCounters].DefaultScale = _reg_perfcount_compute_scale((SMB_BIG_INT)data32);
|
||||
obj->counters[obj->NumCounters].DefaultScale = _reg_perfcount_compute_scale((int64_t)data32);
|
||||
else
|
||||
obj->counters[obj->NumCounters].DefaultScale = 0;
|
||||
dbuf[0] = data32;
|
||||
@ -823,7 +823,7 @@ static int _reg_perfcount_assemble_global(PERF_DATA_BLOCK *block,
|
||||
/*********************************************************************
|
||||
*********************************************************************/
|
||||
|
||||
static bool _reg_perfcount_get_64(SMB_BIG_UINT *retval,
|
||||
static bool _reg_perfcount_get_64(uint64_t *retval,
|
||||
TDB_CONTEXT *tdb,
|
||||
int key_part1,
|
||||
const char *key_part2)
|
||||
@ -855,7 +855,7 @@ static bool _reg_perfcount_get_64(SMB_BIG_UINT *retval,
|
||||
static bool _reg_perfcount_init_data_block_perf(PERF_DATA_BLOCK *block,
|
||||
TDB_CONTEXT *names)
|
||||
{
|
||||
SMB_BIG_UINT PerfFreq, PerfTime, PerfTime100nSec;
|
||||
uint64_t PerfFreq, PerfTime, PerfTime100nSec;
|
||||
TDB_CONTEXT *counters;
|
||||
bool status = False;
|
||||
const char *fname = counters_directory( DATA_DB );
|
||||
|
@ -33,10 +33,10 @@ typedef struct _blocking_lock_record {
|
||||
files_struct *fsp;
|
||||
struct timeval expire_time;
|
||||
int lock_num;
|
||||
SMB_BIG_UINT offset;
|
||||
SMB_BIG_UINT count;
|
||||
uint32 lock_pid;
|
||||
uint32 blocking_pid; /* PID that blocks us. */
|
||||
uint64_t offset;
|
||||
uint64_t count;
|
||||
uint32_t lock_pid;
|
||||
uint32_t blocking_pid; /* PID that blocks us. */
|
||||
enum brl_flavour lock_flav;
|
||||
enum brl_type lock_type;
|
||||
char *inbuf;
|
||||
@ -154,12 +154,12 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
|
||||
files_struct *fsp,
|
||||
int lock_timeout,
|
||||
int lock_num,
|
||||
uint32 lock_pid,
|
||||
uint32_t lock_pid,
|
||||
enum brl_type lock_type,
|
||||
enum brl_flavour lock_flav,
|
||||
SMB_BIG_UINT offset,
|
||||
SMB_BIG_UINT count,
|
||||
uint32 blocking_pid)
|
||||
uint64_t offset,
|
||||
uint64_t count,
|
||||
uint32_t blocking_pid)
|
||||
{
|
||||
static bool set_lock_msg;
|
||||
size_t length = smb_len(req->inbuf)+4;
|
||||
@ -331,7 +331,7 @@ static void reply_lockingX_error(blocking_lock_record *blr, NTSTATUS status)
|
||||
char *inbuf = blr->inbuf;
|
||||
files_struct *fsp = blr->fsp;
|
||||
uint16 num_ulocks = SVAL(inbuf,smb_vwv6);
|
||||
SMB_BIG_UINT count = (SMB_BIG_UINT)0, offset = (SMB_BIG_UINT) 0;
|
||||
uint64_t count = (uint64_t)0, offset = (uint64_t) 0;
|
||||
uint32 lock_pid;
|
||||
unsigned char locktype = CVAL(inbuf,smb_vwv3);
|
||||
bool large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
|
||||
@ -420,7 +420,7 @@ static bool process_lockingX(blocking_lock_record *blr)
|
||||
files_struct *fsp = blr->fsp;
|
||||
uint16 num_ulocks = SVAL(inbuf,smb_vwv6);
|
||||
uint16 num_locks = SVAL(inbuf,smb_vwv7);
|
||||
SMB_BIG_UINT count = (SMB_BIG_UINT)0, offset = (SMB_BIG_UINT)0;
|
||||
uint64_t count = (uint64_t)0, offset = (uint64_t)0;
|
||||
uint32 lock_pid;
|
||||
bool large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
|
||||
char *data;
|
||||
@ -874,8 +874,8 @@ static void process_blocking_lock_cancel_message(struct messaging_context *ctx,
|
||||
|
||||
bool blocking_lock_cancel(files_struct *fsp,
|
||||
uint32 lock_pid,
|
||||
SMB_BIG_UINT offset,
|
||||
SMB_BIG_UINT count,
|
||||
uint64_t offset,
|
||||
uint64_t count,
|
||||
enum brl_flavour lock_flav,
|
||||
unsigned char locktype,
|
||||
NTSTATUS err)
|
||||
|
@ -23,10 +23,10 @@
|
||||
Normalise for DOS usage.
|
||||
****************************************************************************/
|
||||
|
||||
static void disk_norm(bool small_query, SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
|
||||
static void disk_norm(bool small_query, uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
|
||||
{
|
||||
/* check if the disk is beyond the max disk size */
|
||||
SMB_BIG_UINT maxdisksize = lp_maxdisksize();
|
||||
uint64_t maxdisksize = lp_maxdisksize();
|
||||
if (maxdisksize) {
|
||||
/* convert to blocks - and don't overflow */
|
||||
maxdisksize = ((maxdisksize*1024)/(*bsize))*1024;
|
||||
@ -62,13 +62,13 @@ static void disk_norm(bool small_query, SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,
|
||||
Return number of 1K blocks available on a path and total number.
|
||||
****************************************************************************/
|
||||
|
||||
SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small_query,
|
||||
SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
|
||||
uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_query,
|
||||
uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
|
||||
{
|
||||
SMB_BIG_UINT dfree_retval;
|
||||
SMB_BIG_UINT dfree_q = 0;
|
||||
SMB_BIG_UINT bsize_q = 0;
|
||||
SMB_BIG_UINT dsize_q = 0;
|
||||
uint64_t dfree_retval;
|
||||
uint64_t dfree_q = 0;
|
||||
uint64_t bsize_q = 0;
|
||||
uint64_t dsize_q = 0;
|
||||
const char *dfree_command;
|
||||
|
||||
(*dfree) = (*dsize) = 0;
|
||||
@ -90,7 +90,7 @@ SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small
|
||||
path);
|
||||
|
||||
if (!syscmd) {
|
||||
return (SMB_BIG_UINT)-1;
|
||||
return (uint64_t)-1;
|
||||
}
|
||||
|
||||
DEBUG (3, ("disk_free: Running command %s\n", syscmd));
|
||||
@ -126,14 +126,14 @@ SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small
|
||||
if (sys_fsusage(path, dfree, dsize) != 0) {
|
||||
DEBUG (0, ("disk_free: sys_fsusage() failed. Error was : %s\n",
|
||||
strerror(errno) ));
|
||||
return (SMB_BIG_UINT)-1;
|
||||
return (uint64_t)-1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (sys_fsusage(path, dfree, dsize) != 0) {
|
||||
DEBUG (0, ("disk_free: sys_fsusage() failed. Error was : %s\n",
|
||||
strerror(errno) ));
|
||||
return (SMB_BIG_UINT)-1;
|
||||
return (uint64_t)-1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,16 +174,16 @@ SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small
|
||||
Potentially returned cached dfree info.
|
||||
****************************************************************************/
|
||||
|
||||
SMB_BIG_UINT get_dfree_info(connection_struct *conn,
|
||||
uint64_t get_dfree_info(connection_struct *conn,
|
||||
const char *path,
|
||||
bool small_query,
|
||||
SMB_BIG_UINT *bsize,
|
||||
SMB_BIG_UINT *dfree,
|
||||
SMB_BIG_UINT *dsize)
|
||||
uint64_t *bsize,
|
||||
uint64_t *dfree,
|
||||
uint64_t *dsize)
|
||||
{
|
||||
int dfree_cache_time = lp_dfree_cache_time(SNUM(conn));
|
||||
struct dfree_cached_info *dfc = conn->dfree_info;
|
||||
SMB_BIG_UINT dfree_ret;
|
||||
uint64_t dfree_ret;
|
||||
|
||||
if (!dfree_cache_time) {
|
||||
return SMB_VFS_DISK_FREE(conn,path,small_query,bsize,dfree,dsize);
|
||||
@ -199,7 +199,7 @@ SMB_BIG_UINT get_dfree_info(connection_struct *conn,
|
||||
|
||||
dfree_ret = SMB_VFS_DISK_FREE(conn,path,small_query,bsize,dfree,dsize);
|
||||
|
||||
if (dfree_ret == (SMB_BIG_UINT)-1) {
|
||||
if (dfree_ret == (uint64_t)-1) {
|
||||
/* Don't cache bad data. */
|
||||
return dfree_ret;
|
||||
}
|
||||
|
@ -23,14 +23,14 @@
|
||||
* Needed for auto generation of proto.h.
|
||||
*/
|
||||
|
||||
bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
|
||||
bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
|
||||
{
|
||||
(*bsize) = 512; /* This value should be ignored */
|
||||
|
||||
/* And just to be sure we set some values that hopefully */
|
||||
/* will be larger that any possible real-world value */
|
||||
(*dfree) = (SMB_BIG_UINT)-1;
|
||||
(*dsize) = (SMB_BIG_UINT)-1;
|
||||
(*dfree) = (uint64_t)-1;
|
||||
(*dsize) = (uint64_t)-1;
|
||||
|
||||
/* As we have select not to use quotas, allways fail */
|
||||
return False;
|
||||
|
@ -22,14 +22,14 @@
|
||||
#undef DBGC_CLASS
|
||||
#define DBGC_CLASS DBGC_QUOTA
|
||||
|
||||
static SMB_BIG_UINT limit_nt2unix(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
|
||||
static uint64_t limit_nt2unix(uint64_t in, uint64_t bsize)
|
||||
{
|
||||
SMB_BIG_UINT ret = (SMB_BIG_UINT)0;
|
||||
uint64_t ret = (uint64_t)0;
|
||||
|
||||
ret = (SMB_BIG_UINT)(in/bsize);
|
||||
ret = (uint64_t)(in/bsize);
|
||||
if (in>0 && ret==0) {
|
||||
/* we have to make sure that a overflow didn't set NO_LIMIT */
|
||||
ret = (SMB_BIG_UINT)1;
|
||||
ret = (uint64_t)1;
|
||||
}
|
||||
|
||||
if (in == SMB_NTQUOTAS_NO_LIMIT)
|
||||
@ -42,11 +42,11 @@ static SMB_BIG_UINT limit_nt2unix(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static SMB_BIG_UINT limit_unix2nt(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
|
||||
static uint64_t limit_unix2nt(uint64_t in, uint64_t bsize)
|
||||
{
|
||||
SMB_BIG_UINT ret = (SMB_BIG_UINT)0;
|
||||
uint64_t ret = (uint64_t)0;
|
||||
|
||||
ret = (SMB_BIG_UINT)(in*bsize);
|
||||
ret = (uint64_t)(in*bsize);
|
||||
|
||||
if (ret < in) {
|
||||
/* we overflow */
|
||||
@ -59,14 +59,14 @@ static SMB_BIG_UINT limit_unix2nt(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static SMB_BIG_UINT limit_blk2inodes(SMB_BIG_UINT in)
|
||||
static uint64_t limit_blk2inodes(uint64_t in)
|
||||
{
|
||||
SMB_BIG_UINT ret = (SMB_BIG_UINT)0;
|
||||
uint64_t ret = (uint64_t)0;
|
||||
|
||||
ret = (SMB_BIG_UINT)(in/2);
|
||||
ret = (uint64_t)(in/2);
|
||||
|
||||
if (ret == 0 && in != 0)
|
||||
ret = (SMB_BIG_UINT)1;
|
||||
ret = (uint64_t)1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -100,7 +100,7 @@ int vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid,
|
||||
return ret;
|
||||
}
|
||||
|
||||
qt->usedspace = (SMB_BIG_UINT)D.curblocks*D.bsize;
|
||||
qt->usedspace = (uint64_t)D.curblocks*D.bsize;
|
||||
qt->softlim = limit_unix2nt(D.softlimit, D.bsize);
|
||||
qt->hardlim = limit_unix2nt(D.hardlimit, D.bsize);
|
||||
qt->qflags = D.qflags;
|
||||
@ -121,7 +121,7 @@ int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid,
|
||||
|
||||
id.uid = -1;
|
||||
|
||||
D.bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
D.bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
|
||||
D.softlimit = limit_nt2unix(qt->softlim,D.bsize);
|
||||
D.hardlimit = limit_nt2unix(qt->hardlim,D.bsize);
|
||||
|
@ -386,7 +386,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
|
||||
uint32 create_disposition;
|
||||
uint32 create_options;
|
||||
uint16 root_dir_fid;
|
||||
SMB_BIG_UINT allocation_size;
|
||||
uint64_t allocation_size;
|
||||
/* Breakout the oplock request bits so we can set the
|
||||
reply bits separately. */
|
||||
uint32 fattr=0;
|
||||
@ -418,10 +418,10 @@ void reply_ntcreate_and_X(struct smb_request *req)
|
||||
create_options = IVAL(req->inbuf,smb_ntcreate_CreateOptions);
|
||||
root_dir_fid = (uint16)IVAL(req->inbuf,smb_ntcreate_RootDirectoryFid);
|
||||
|
||||
allocation_size = (SMB_BIG_UINT)IVAL(req->inbuf,
|
||||
allocation_size = (uint64_t)IVAL(req->inbuf,
|
||||
smb_ntcreate_AllocationSize);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
allocation_size |= (((SMB_BIG_UINT)IVAL(
|
||||
allocation_size |= (((uint64_t)IVAL(
|
||||
req->inbuf,
|
||||
smb_ntcreate_AllocationSize + 4)) << 32);
|
||||
#endif
|
||||
@ -814,7 +814,7 @@ static void call_nt_transact_create(connection_struct *conn,
|
||||
struct ea_list *ea_list = NULL;
|
||||
NTSTATUS status;
|
||||
size_t param_len;
|
||||
SMB_BIG_UINT allocation_size;
|
||||
uint64_t allocation_size;
|
||||
int oplock_request;
|
||||
uint8_t oplock_granted;
|
||||
TALLOC_CTX *ctx = talloc_tos();
|
||||
@ -857,9 +857,9 @@ static void call_nt_transact_create(connection_struct *conn,
|
||||
sd_len = IVAL(params,36);
|
||||
ea_len = IVAL(params,40);
|
||||
root_dir_fid = (uint16)IVAL(params,4);
|
||||
allocation_size = (SMB_BIG_UINT)IVAL(params,12);
|
||||
allocation_size = (uint64_t)IVAL(params,12);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
allocation_size |= (((SMB_BIG_UINT)IVAL(params,16)) << 32);
|
||||
allocation_size |= (((uint64_t)IVAL(params,16)) << 32);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -2127,16 +2127,16 @@ static void call_nt_transact_get_user_quota(connection_struct *conn,
|
||||
/* then the len of the SID 4 bytes */
|
||||
SIVAL(entry,4,sid_len);
|
||||
|
||||
/* unknown data 8 bytes SMB_BIG_UINT */
|
||||
SBIG_UINT(entry,8,(SMB_BIG_UINT)0); /* this is not 0 in windows...-metze*/
|
||||
/* unknown data 8 bytes uint64_t */
|
||||
SBIG_UINT(entry,8,(uint64_t)0); /* this is not 0 in windows...-metze*/
|
||||
|
||||
/* the used disk space 8 bytes SMB_BIG_UINT */
|
||||
/* the used disk space 8 bytes uint64_t */
|
||||
SBIG_UINT(entry,16,tmp_list->quotas->usedspace);
|
||||
|
||||
/* the soft quotas 8 bytes SMB_BIG_UINT */
|
||||
/* the soft quotas 8 bytes uint64_t */
|
||||
SBIG_UINT(entry,24,tmp_list->quotas->softlim);
|
||||
|
||||
/* the hard quotas 8 bytes SMB_BIG_UINT */
|
||||
/* the hard quotas 8 bytes uint64_t */
|
||||
SBIG_UINT(entry,32,tmp_list->quotas->hardlim);
|
||||
|
||||
/* and now the SID */
|
||||
@ -2225,16 +2225,16 @@ static void call_nt_transact_get_user_quota(connection_struct *conn,
|
||||
/* then the len of the SID 4 bytes */
|
||||
SIVAL(entry,4,sid_len);
|
||||
|
||||
/* unknown data 8 bytes SMB_BIG_UINT */
|
||||
SBIG_UINT(entry,8,(SMB_BIG_UINT)0); /* this is not 0 in windows...-mezte*/
|
||||
/* unknown data 8 bytes uint64_t */
|
||||
SBIG_UINT(entry,8,(uint64_t)0); /* this is not 0 in windows...-mezte*/
|
||||
|
||||
/* the used disk space 8 bytes SMB_BIG_UINT */
|
||||
/* the used disk space 8 bytes uint64_t */
|
||||
SBIG_UINT(entry,16,qt.usedspace);
|
||||
|
||||
/* the soft quotas 8 bytes SMB_BIG_UINT */
|
||||
/* the soft quotas 8 bytes uint64_t */
|
||||
SBIG_UINT(entry,24,qt.softlim);
|
||||
|
||||
/* the hard quotas 8 bytes SMB_BIG_UINT */
|
||||
/* the hard quotas 8 bytes uint64_t */
|
||||
SBIG_UINT(entry,32,qt.hardlim);
|
||||
|
||||
/* and now the SID */
|
||||
@ -2328,10 +2328,10 @@ static void call_nt_transact_set_user_quota(connection_struct *conn,
|
||||
* maybe its the change time in NTTIME
|
||||
*/
|
||||
|
||||
/* the used space 8 bytes (SMB_BIG_UINT)*/
|
||||
qt.usedspace = (SMB_BIG_UINT)IVAL(pdata,16);
|
||||
/* the used space 8 bytes (uint64_t)*/
|
||||
qt.usedspace = (uint64_t)IVAL(pdata,16);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
qt.usedspace |= (((SMB_BIG_UINT)IVAL(pdata,20)) << 32);
|
||||
qt.usedspace |= (((uint64_t)IVAL(pdata,20)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if ((IVAL(pdata,20) != 0)&&
|
||||
((qt.usedspace != 0xFFFFFFFF)||
|
||||
@ -2342,10 +2342,10 @@ static void call_nt_transact_set_user_quota(connection_struct *conn,
|
||||
}
|
||||
#endif /* LARGE_SMB_OFF_T */
|
||||
|
||||
/* the soft quotas 8 bytes (SMB_BIG_UINT)*/
|
||||
qt.softlim = (SMB_BIG_UINT)IVAL(pdata,24);
|
||||
/* the soft quotas 8 bytes (uint64_t)*/
|
||||
qt.softlim = (uint64_t)IVAL(pdata,24);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
qt.softlim |= (((SMB_BIG_UINT)IVAL(pdata,28)) << 32);
|
||||
qt.softlim |= (((uint64_t)IVAL(pdata,28)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if ((IVAL(pdata,28) != 0)&&
|
||||
((qt.softlim != 0xFFFFFFFF)||
|
||||
@ -2356,10 +2356,10 @@ static void call_nt_transact_set_user_quota(connection_struct *conn,
|
||||
}
|
||||
#endif /* LARGE_SMB_OFF_T */
|
||||
|
||||
/* the hard quotas 8 bytes (SMB_BIG_UINT)*/
|
||||
qt.hardlim = (SMB_BIG_UINT)IVAL(pdata,32);
|
||||
/* the hard quotas 8 bytes (uint64_t)*/
|
||||
qt.hardlim = (uint64_t)IVAL(pdata,32);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
qt.hardlim |= (((SMB_BIG_UINT)IVAL(pdata,36)) << 32);
|
||||
qt.hardlim |= (((uint64_t)IVAL(pdata,36)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if ((IVAL(pdata,36) != 0)&&
|
||||
((qt.hardlim != 0xFFFFFFFF)||
|
||||
|
@ -2533,7 +2533,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
SMB_BIG_UINT allocation_size,
|
||||
uint64_t allocation_size,
|
||||
struct security_descriptor *sd,
|
||||
struct ea_list *ea_list,
|
||||
|
||||
@ -2809,7 +2809,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
|
||||
}
|
||||
} else {
|
||||
fsp->initial_allocation_size = smb_roundup(
|
||||
fsp->conn, (SMB_BIG_UINT)sbuf.st_size);
|
||||
fsp->conn, (uint64_t)sbuf.st_size);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2863,7 +2863,7 @@ NTSTATUS create_file(connection_struct *conn,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
SMB_BIG_UINT allocation_size,
|
||||
uint64_t allocation_size,
|
||||
struct security_descriptor *sd,
|
||||
struct ea_list *ea_list,
|
||||
|
||||
|
@ -743,7 +743,7 @@ static NTSTATUS receive_message_or_smb(TALLOC_CTX *mem_ctx, char **buffer,
|
||||
pop_message = True;
|
||||
} else {
|
||||
struct timeval tv;
|
||||
SMB_BIG_INT tdif;
|
||||
int64_t tdif;
|
||||
|
||||
GetTimeOfDay(&tv);
|
||||
tdif = usec_time_diff(&msg->end_time, &tv);
|
||||
|
@ -45,7 +45,7 @@
|
||||
* Declare here, define at end: reduces likely "include" interaction problems.
|
||||
* David Lee <T.D.Lee@durham.ac.uk>
|
||||
*/
|
||||
bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
|
||||
bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
|
||||
|
||||
#endif /* VXFS_QUOTA */
|
||||
|
||||
@ -63,13 +63,13 @@ bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG
|
||||
#include "samba_linux_quota.h"
|
||||
|
||||
typedef struct _LINUX_SMB_DISK_QUOTA {
|
||||
SMB_BIG_UINT bsize;
|
||||
SMB_BIG_UINT hardlimit; /* In bsize units. */
|
||||
SMB_BIG_UINT softlimit; /* In bsize units. */
|
||||
SMB_BIG_UINT curblocks; /* In bsize units. */
|
||||
SMB_BIG_UINT ihardlimit; /* inode hard limit. */
|
||||
SMB_BIG_UINT isoftlimit; /* inode soft limit. */
|
||||
SMB_BIG_UINT curinodes; /* Current used inodes. */
|
||||
uint64_t bsize;
|
||||
uint64_t hardlimit; /* In bsize units. */
|
||||
uint64_t softlimit; /* In bsize units. */
|
||||
uint64_t curblocks; /* In bsize units. */
|
||||
uint64_t ihardlimit; /* inode hard limit. */
|
||||
uint64_t isoftlimit; /* inode soft limit. */
|
||||
uint64_t curinodes; /* Current used inodes. */
|
||||
} LINUX_SMB_DISK_QUOTA;
|
||||
|
||||
|
||||
@ -95,13 +95,13 @@ static int get_smb_linux_xfs_quota(char *path, uid_t euser_id, gid_t egrp_id, LI
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
dp->bsize = (SMB_BIG_UINT)512;
|
||||
dp->softlimit = (SMB_BIG_UINT)D.d_blk_softlimit;
|
||||
dp->hardlimit = (SMB_BIG_UINT)D.d_blk_hardlimit;
|
||||
dp->ihardlimit = (SMB_BIG_UINT)D.d_ino_hardlimit;
|
||||
dp->isoftlimit = (SMB_BIG_UINT)D.d_ino_softlimit;
|
||||
dp->curinodes = (SMB_BIG_UINT)D.d_icount;
|
||||
dp->curblocks = (SMB_BIG_UINT)D.d_bcount;
|
||||
dp->bsize = (uint64_t)512;
|
||||
dp->softlimit = (uint64_t)D.d_blk_softlimit;
|
||||
dp->hardlimit = (uint64_t)D.d_blk_hardlimit;
|
||||
dp->ihardlimit = (uint64_t)D.d_ino_hardlimit;
|
||||
dp->isoftlimit = (uint64_t)D.d_ino_softlimit;
|
||||
dp->curinodes = (uint64_t)D.d_icount;
|
||||
dp->curblocks = (uint64_t)D.d_bcount;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -134,13 +134,13 @@ static int get_smb_linux_v1_quota(char *path, uid_t euser_id, gid_t egrp_id, LIN
|
||||
if (ret && errno != EDQUOT)
|
||||
return ret;
|
||||
|
||||
dp->bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
|
||||
dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
|
||||
dp->curblocks = (SMB_BIG_UINT)D.dqb_curblocks;
|
||||
dp->bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
|
||||
dp->curinodes = (uint64_t)D.dqb_curinodes;
|
||||
dp->curblocks = (uint64_t)D.dqb_curblocks;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -160,13 +160,13 @@ static int get_smb_linux_v2_quota(char *path, uid_t euser_id, gid_t egrp_id, LIN
|
||||
if (ret && errno != EDQUOT)
|
||||
return ret;
|
||||
|
||||
dp->bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
|
||||
dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
|
||||
dp->curblocks = ((SMB_BIG_UINT)D.dqb_curspace) / dp->bsize;
|
||||
dp->bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
|
||||
dp->curinodes = (uint64_t)D.dqb_curinodes;
|
||||
dp->curblocks = ((uint64_t)D.dqb_curspace) / dp->bsize;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -190,13 +190,13 @@ static int get_smb_linux_gen_quota(char *path, uid_t euser_id, gid_t egrp_id, LI
|
||||
if (ret && errno != EDQUOT)
|
||||
return ret;
|
||||
|
||||
dp->bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
|
||||
dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
|
||||
dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
|
||||
dp->curblocks = ((SMB_BIG_UINT)D.dqb_curspace) / dp->bsize;
|
||||
dp->bsize = (uint64_t)QUOTABLOCK_SIZE;
|
||||
dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
|
||||
dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
|
||||
dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
|
||||
dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
|
||||
dp->curinodes = (uint64_t)D.dqb_curinodes;
|
||||
dp->curblocks = ((uint64_t)D.dqb_curspace) / dp->bsize;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -205,7 +205,7 @@ static int get_smb_linux_gen_quota(char *path, uid_t euser_id, gid_t egrp_id, LI
|
||||
Try to get the disk space from disk quotas (LINUX version).
|
||||
****************************************************************************/
|
||||
|
||||
bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
int r;
|
||||
SMB_STRUCT_STAT S;
|
||||
@ -306,7 +306,7 @@ bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
|
||||
try to get the disk space from disk quotas (CRAY VERSION)
|
||||
****************************************************************************/
|
||||
|
||||
bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
struct mntent *mnt;
|
||||
FILE *fd;
|
||||
@ -454,7 +454,7 @@ static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
|
||||
}
|
||||
|
||||
/* Restricted to SUNOS5 for the moment, I haven`t access to others to test. */
|
||||
static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
uid_t uid = euser_id;
|
||||
struct dqblk D;
|
||||
@ -468,7 +468,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
|
||||
enum clnt_stat clnt_stat;
|
||||
bool ret = True;
|
||||
|
||||
*bsize = *dfree = *dsize = (SMB_BIG_UINT)0;
|
||||
*bsize = *dfree = *dsize = (uint64_t)0;
|
||||
|
||||
len=strcspn(mnttype, ":");
|
||||
pathname=strstr(mnttype, ":");
|
||||
@ -575,9 +575,9 @@ Quota code by Peter Urbanec (amiga@cse.unsw.edu.au).
|
||||
****************************************************************************/
|
||||
|
||||
bool disk_quotas(const char *path,
|
||||
SMB_BIG_UINT *bsize,
|
||||
SMB_BIG_UINT *dfree,
|
||||
SMB_BIG_UINT *dsize)
|
||||
uint64_t *bsize,
|
||||
uint64_t *dfree,
|
||||
uint64_t *dsize)
|
||||
{
|
||||
uid_t euser_id;
|
||||
int ret;
|
||||
@ -750,7 +750,7 @@ bool disk_quotas(const char *path,
|
||||
try to get the disk space from disk quotas - OSF1 version
|
||||
****************************************************************************/
|
||||
|
||||
bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
int r, save_errno;
|
||||
struct dqblk D;
|
||||
@ -816,7 +816,7 @@ try to get the disk space from disk quotas (IRIX 6.2 version)
|
||||
#include <sys/quota.h>
|
||||
#include <mntent.h>
|
||||
|
||||
bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
uid_t euser_id;
|
||||
int r;
|
||||
@ -1009,7 +1009,7 @@ static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
|
||||
}
|
||||
|
||||
/* Works on FreeBSD, too. :-) */
|
||||
static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
uid_t uid = euser_id;
|
||||
struct dqblk D;
|
||||
@ -1023,7 +1023,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
|
||||
enum clnt_stat clnt_stat;
|
||||
bool ret = True;
|
||||
|
||||
*bsize = *dfree = *dsize = (SMB_BIG_UINT)0;
|
||||
*bsize = *dfree = *dsize = (uint64_t)0;
|
||||
|
||||
len=strcspn(mnttype, ":");
|
||||
pathname=strstr(mnttype, ":");
|
||||
@ -1134,7 +1134,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
|
||||
try to get the disk space from disk quotas - default version
|
||||
****************************************************************************/
|
||||
|
||||
bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
int r;
|
||||
struct dqblk D;
|
||||
@ -1353,7 +1353,7 @@ Hints for porting:
|
||||
#include <sys/fs/vx_aioctl.h>
|
||||
#include <sys/fs/vx_ioctl.h>
|
||||
|
||||
bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
|
||||
bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
|
||||
{
|
||||
uid_t user_id, euser_id;
|
||||
int ret;
|
||||
@ -1437,14 +1437,14 @@ bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG
|
||||
|
||||
#else /* WITH_QUOTAS */
|
||||
|
||||
bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
|
||||
bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
|
||||
{
|
||||
(*bsize) = 512; /* This value should be ignored */
|
||||
|
||||
/* And just to be sure we set some values that hopefully */
|
||||
/* will be larger that any possible real-world value */
|
||||
(*dfree) = (SMB_BIG_UINT)-1;
|
||||
(*dsize) = (SMB_BIG_UINT)-1;
|
||||
(*dfree) = (uint64_t)-1;
|
||||
(*dsize) = (uint64_t)-1;
|
||||
|
||||
/* As we have select not to use quotas, allways fail */
|
||||
return false;
|
||||
@ -1455,7 +1455,7 @@ bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BI
|
||||
/* wrapper to the new sys_quota interface
|
||||
this file should be removed later
|
||||
*/
|
||||
bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
|
||||
bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
|
||||
{
|
||||
int r;
|
||||
SMB_DISK_QUOTA D;
|
||||
|
@ -1178,10 +1178,10 @@ void reply_setatr(struct smb_request *req)
|
||||
void reply_dskattr(struct smb_request *req)
|
||||
{
|
||||
connection_struct *conn = req->conn;
|
||||
SMB_BIG_UINT dfree,dsize,bsize;
|
||||
uint64_t dfree,dsize,bsize;
|
||||
START_PROFILE(SMBdskattr);
|
||||
|
||||
if (get_dfree_info(conn,".",True,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
|
||||
if (get_dfree_info(conn,".",True,&bsize,&dfree,&dsize) == (uint64_t)-1) {
|
||||
reply_unixerror(req, ERRHRD, ERRgeneral);
|
||||
END_PROFILE(SMBdskattr);
|
||||
return;
|
||||
@ -1200,8 +1200,8 @@ void reply_dskattr(struct smb_request *req)
|
||||
total_space = dsize * (double)bsize;
|
||||
free_space = dfree * (double)bsize;
|
||||
|
||||
dsize = (SMB_BIG_UINT)((total_space+63*512) / (64*512));
|
||||
dfree = (SMB_BIG_UINT)((free_space+63*512) / (64*512));
|
||||
dsize = (uint64_t)((total_space+63*512) / (64*512));
|
||||
dfree = (uint64_t)((free_space+63*512) / (64*512));
|
||||
|
||||
if (dsize > 0xFFFF) dsize = 0xFFFF;
|
||||
if (dfree > 0xFFFF) dfree = 0xFFFF;
|
||||
@ -1744,7 +1744,7 @@ void reply_open_and_X(struct smb_request *req)
|
||||
int smb_action = 0;
|
||||
files_struct *fsp;
|
||||
NTSTATUS status;
|
||||
SMB_BIG_UINT allocation_size;
|
||||
uint64_t allocation_size;
|
||||
ssize_t retval = -1;
|
||||
uint32 access_mask;
|
||||
uint32 share_mode;
|
||||
@ -1767,7 +1767,7 @@ void reply_open_and_X(struct smb_request *req)
|
||||
core_oplock_request = CORE_OPLOCK_REQUEST(req->inbuf);
|
||||
oplock_request = ex_oplock_request | core_oplock_request;
|
||||
smb_ofun = SVAL(req->inbuf,smb_vwv8);
|
||||
allocation_size = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv9);
|
||||
allocation_size = (uint64_t)IVAL(req->inbuf,smb_vwv9);
|
||||
|
||||
/* If it's an IPC, pass off the pipe handler. */
|
||||
if (IS_IPC(conn)) {
|
||||
@ -2887,8 +2887,8 @@ void reply_readbraw(struct smb_request *req)
|
||||
maxcount = MIN(65535,maxcount);
|
||||
|
||||
if (is_locked(fsp,(uint32)req->smbpid,
|
||||
(SMB_BIG_UINT)maxcount,
|
||||
(SMB_BIG_UINT)startpos,
|
||||
(uint64_t)maxcount,
|
||||
(uint64_t)startpos,
|
||||
READ_LOCK)) {
|
||||
reply_readbraw_error();
|
||||
END_PROFILE(SMBreadbraw);
|
||||
@ -2985,8 +2985,8 @@ void reply_lockread(struct smb_request *req)
|
||||
br_lck = do_lock(smbd_messaging_context(),
|
||||
fsp,
|
||||
req->smbpid,
|
||||
(SMB_BIG_UINT)numtoread,
|
||||
(SMB_BIG_UINT)startpos,
|
||||
(uint64_t)numtoread,
|
||||
(uint64_t)startpos,
|
||||
WRITE_LOCK,
|
||||
WINDOWS_LOCK,
|
||||
False, /* Non-blocking lock. */
|
||||
@ -3090,8 +3090,8 @@ Returning short read of maximum allowed for compatibility with Windows 2000.\n",
|
||||
|
||||
data = smb_buf(req->outbuf) + 3;
|
||||
|
||||
if (is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtoread,
|
||||
(SMB_BIG_UINT)startpos, READ_LOCK)) {
|
||||
if (is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtoread,
|
||||
(uint64_t)startpos, READ_LOCK)) {
|
||||
reply_doserror(req, ERRDOS,ERRlock);
|
||||
END_PROFILE(SMBread);
|
||||
return;
|
||||
@ -3377,8 +3377,8 @@ void reply_read_and_X(struct smb_request *req)
|
||||
|
||||
}
|
||||
|
||||
if (is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)smb_maxcnt,
|
||||
(SMB_BIG_UINT)startpos, READ_LOCK)) {
|
||||
if (is_locked(fsp, (uint32)req->smbpid, (uint64_t)smb_maxcnt,
|
||||
(uint64_t)startpos, READ_LOCK)) {
|
||||
END_PROFILE(SMBreadX);
|
||||
reply_doserror(req, ERRDOS, ERRlock);
|
||||
return;
|
||||
@ -3487,8 +3487,8 @@ void reply_writebraw(struct smb_request *req)
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_locked(fsp,(uint32)req->smbpid,(SMB_BIG_UINT)tcount,
|
||||
(SMB_BIG_UINT)startpos, WRITE_LOCK)) {
|
||||
if (is_locked(fsp,(uint32)req->smbpid,(uint64_t)tcount,
|
||||
(uint64_t)startpos, WRITE_LOCK)) {
|
||||
reply_doserror(req, ERRDOS, ERRlock);
|
||||
error_to_writebrawerr(req);
|
||||
END_PROFILE(SMBwritebraw);
|
||||
@ -3673,8 +3673,8 @@ void reply_writeunlock(struct smb_request *req)
|
||||
data = smb_buf(req->inbuf) + 3;
|
||||
|
||||
if (numtowrite
|
||||
&& is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtowrite,
|
||||
(SMB_BIG_UINT)startpos, WRITE_LOCK)) {
|
||||
&& is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtowrite,
|
||||
(uint64_t)startpos, WRITE_LOCK)) {
|
||||
reply_doserror(req, ERRDOS, ERRlock);
|
||||
END_PROFILE(SMBwriteunlock);
|
||||
return;
|
||||
@ -3708,8 +3708,8 @@ void reply_writeunlock(struct smb_request *req)
|
||||
status = do_unlock(smbd_messaging_context(),
|
||||
fsp,
|
||||
req->smbpid,
|
||||
(SMB_BIG_UINT)numtowrite,
|
||||
(SMB_BIG_UINT)startpos,
|
||||
(uint64_t)numtowrite,
|
||||
(uint64_t)startpos,
|
||||
WINDOWS_LOCK);
|
||||
|
||||
if (NT_STATUS_V(status)) {
|
||||
@ -3779,8 +3779,8 @@ void reply_write(struct smb_request *req)
|
||||
startpos = IVAL_TO_SMB_OFF_T(req->inbuf,smb_vwv2);
|
||||
data = smb_buf(req->inbuf) + 3;
|
||||
|
||||
if (is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtowrite,
|
||||
(SMB_BIG_UINT)startpos, WRITE_LOCK)) {
|
||||
if (is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtowrite,
|
||||
(uint64_t)startpos, WRITE_LOCK)) {
|
||||
reply_doserror(req, ERRDOS, ERRlock);
|
||||
END_PROFILE(SMBwrite);
|
||||
return;
|
||||
@ -4035,8 +4035,8 @@ void reply_write_and_X(struct smb_request *req)
|
||||
}
|
||||
|
||||
if (is_locked(fsp,(uint32)req->smbpid,
|
||||
(SMB_BIG_UINT)numtowrite,
|
||||
(SMB_BIG_UINT)startpos, WRITE_LOCK)) {
|
||||
(uint64_t)numtowrite,
|
||||
(uint64_t)startpos, WRITE_LOCK)) {
|
||||
reply_doserror(req, ERRDOS, ERRlock);
|
||||
END_PROFILE(SMBwriteX);
|
||||
return;
|
||||
@ -4358,8 +4358,8 @@ void reply_writeclose(struct smb_request *req)
|
||||
data = smb_buf(req->inbuf) + 1;
|
||||
|
||||
if (numtowrite
|
||||
&& is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtowrite,
|
||||
(SMB_BIG_UINT)startpos, WRITE_LOCK)) {
|
||||
&& is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtowrite,
|
||||
(uint64_t)startpos, WRITE_LOCK)) {
|
||||
reply_doserror(req, ERRDOS,ERRlock);
|
||||
END_PROFILE(SMBwriteclose);
|
||||
return;
|
||||
@ -4413,7 +4413,7 @@ void reply_writeclose(struct smb_request *req)
|
||||
void reply_lock(struct smb_request *req)
|
||||
{
|
||||
connection_struct *conn = req->conn;
|
||||
SMB_BIG_UINT count,offset;
|
||||
uint64_t count,offset;
|
||||
NTSTATUS status;
|
||||
files_struct *fsp;
|
||||
struct byte_range_lock *br_lck = NULL;
|
||||
@ -4435,8 +4435,8 @@ void reply_lock(struct smb_request *req)
|
||||
|
||||
release_level_2_oplocks_on_change(fsp);
|
||||
|
||||
count = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv1);
|
||||
offset = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv3);
|
||||
count = (uint64_t)IVAL(req->inbuf,smb_vwv1);
|
||||
offset = (uint64_t)IVAL(req->inbuf,smb_vwv3);
|
||||
|
||||
DEBUG(3,("lock fd=%d fnum=%d offset=%.0f count=%.0f\n",
|
||||
fsp->fh->fd, fsp->fnum, (double)offset, (double)count));
|
||||
@ -4473,7 +4473,7 @@ void reply_lock(struct smb_request *req)
|
||||
void reply_unlock(struct smb_request *req)
|
||||
{
|
||||
connection_struct *conn = req->conn;
|
||||
SMB_BIG_UINT count,offset;
|
||||
uint64_t count,offset;
|
||||
NTSTATUS status;
|
||||
files_struct *fsp;
|
||||
|
||||
@ -4492,8 +4492,8 @@ void reply_unlock(struct smb_request *req)
|
||||
return;
|
||||
}
|
||||
|
||||
count = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv1);
|
||||
offset = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv3);
|
||||
count = (uint64_t)IVAL(req->inbuf,smb_vwv1);
|
||||
offset = (uint64_t)IVAL(req->inbuf,smb_vwv3);
|
||||
|
||||
status = do_unlock(smbd_messaging_context(),
|
||||
fsp,
|
||||
@ -6491,17 +6491,17 @@ uint32 get_lock_pid( char *data, int data_offset, bool large_file_format)
|
||||
Get a lock count, dealing with large count requests.
|
||||
****************************************************************************/
|
||||
|
||||
SMB_BIG_UINT get_lock_count( char *data, int data_offset, bool large_file_format)
|
||||
uint64_t get_lock_count( char *data, int data_offset, bool large_file_format)
|
||||
{
|
||||
SMB_BIG_UINT count = 0;
|
||||
uint64_t count = 0;
|
||||
|
||||
if(!large_file_format) {
|
||||
count = (SMB_BIG_UINT)IVAL(data,SMB_LKLEN_OFFSET(data_offset));
|
||||
count = (uint64_t)IVAL(data,SMB_LKLEN_OFFSET(data_offset));
|
||||
} else {
|
||||
|
||||
#if defined(HAVE_LONGLONG)
|
||||
count = (((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKLEN_OFFSET_HIGH(data_offset))) << 32) |
|
||||
((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset)));
|
||||
count = (((uint64_t) IVAL(data,SMB_LARGE_LKLEN_OFFSET_HIGH(data_offset))) << 32) |
|
||||
((uint64_t) IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset)));
|
||||
#else /* HAVE_LONGLONG */
|
||||
|
||||
/*
|
||||
@ -6518,7 +6518,7 @@ SMB_BIG_UINT get_lock_count( char *data, int data_offset, bool large_file_format
|
||||
SIVAL(data,SMB_LARGE_LKLEN_OFFSET_HIGH(data_offset),0);
|
||||
}
|
||||
|
||||
count = (SMB_BIG_UINT)IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset));
|
||||
count = (uint64_t)IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset));
|
||||
#endif /* HAVE_LONGLONG */
|
||||
}
|
||||
|
||||
@ -6563,19 +6563,19 @@ static uint32 map_lock_offset(uint32 high, uint32 low)
|
||||
Get a lock offset, dealing with large offset requests.
|
||||
****************************************************************************/
|
||||
|
||||
SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err)
|
||||
uint64_t get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err)
|
||||
{
|
||||
SMB_BIG_UINT offset = 0;
|
||||
uint64_t offset = 0;
|
||||
|
||||
*err = False;
|
||||
|
||||
if(!large_file_format) {
|
||||
offset = (SMB_BIG_UINT)IVAL(data,SMB_LKOFF_OFFSET(data_offset));
|
||||
offset = (uint64_t)IVAL(data,SMB_LKOFF_OFFSET(data_offset));
|
||||
} else {
|
||||
|
||||
#if defined(HAVE_LONGLONG)
|
||||
offset = (((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKOFF_OFFSET_HIGH(data_offset))) << 32) |
|
||||
((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset)));
|
||||
offset = (((uint64_t) IVAL(data,SMB_LARGE_LKOFF_OFFSET_HIGH(data_offset))) << 32) |
|
||||
((uint64_t) IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset)));
|
||||
#else /* HAVE_LONGLONG */
|
||||
|
||||
/*
|
||||
@ -6592,7 +6592,7 @@ SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_forma
|
||||
|
||||
if((new_low = map_lock_offset(high, low)) == 0) {
|
||||
*err = True;
|
||||
return (SMB_BIG_UINT)-1;
|
||||
return (uint64_t)-1;
|
||||
}
|
||||
|
||||
DEBUG(3,("get_lock_offset: truncating lock offset (high)0x%x (low)0x%x to offset 0x%x.\n",
|
||||
@ -6601,7 +6601,7 @@ SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_forma
|
||||
SIVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset),new_low);
|
||||
}
|
||||
|
||||
offset = (SMB_BIG_UINT)IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset));
|
||||
offset = (uint64_t)IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset));
|
||||
#endif /* HAVE_LONGLONG */
|
||||
}
|
||||
|
||||
@ -6620,7 +6620,7 @@ void reply_lockingX(struct smb_request *req)
|
||||
unsigned char oplocklevel;
|
||||
uint16 num_ulocks;
|
||||
uint16 num_locks;
|
||||
SMB_BIG_UINT count = 0, offset = 0;
|
||||
uint64_t count = 0, offset = 0;
|
||||
uint32 lock_pid;
|
||||
int32 lock_timeout;
|
||||
int i;
|
||||
|
@ -118,7 +118,7 @@ static int darwin_statvfs(const char *path, vfs_statvfs_struct *statbuf)
|
||||
statbuf->UserBlocksAvail = sbuf.f_bavail;
|
||||
statbuf->TotalFileNodes = sbuf.f_files;
|
||||
statbuf->FreeFileNodes = sbuf.f_ffree;
|
||||
statbuf->FsIdentifier = *(SMB_BIG_UINT *)(&sbuf.f_fsid); /* Ick. */
|
||||
statbuf->FsIdentifier = *(uint64_t *)(&sbuf.f_fsid); /* Ick. */
|
||||
statbuf->FsCapabilities = darwin_fs_capabilities(sbuf.f_mntonname);
|
||||
|
||||
return 0;
|
||||
|
@ -47,9 +47,9 @@ static char *store_file_unix_basic_info2(connection_struct *conn,
|
||||
Only do this for Windows clients.
|
||||
********************************************************************/
|
||||
|
||||
SMB_BIG_UINT smb_roundup(connection_struct *conn, SMB_BIG_UINT val)
|
||||
uint64_t smb_roundup(connection_struct *conn, uint64_t val)
|
||||
{
|
||||
SMB_BIG_UINT rval = lp_allocation_roundup_size(SNUM(conn));
|
||||
uint64_t rval = lp_allocation_roundup_size(SNUM(conn));
|
||||
|
||||
/* Only roundup for Windows clients. */
|
||||
enum remote_arch_types ra_type = get_remote_arch();
|
||||
@ -64,18 +64,18 @@ SMB_BIG_UINT smb_roundup(connection_struct *conn, SMB_BIG_UINT val)
|
||||
account sparse files.
|
||||
********************************************************************/
|
||||
|
||||
SMB_BIG_UINT get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
|
||||
uint64_t get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
|
||||
{
|
||||
SMB_BIG_UINT ret;
|
||||
uint64_t ret;
|
||||
|
||||
if(S_ISDIR(sbuf->st_mode)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE)
|
||||
ret = (SMB_BIG_UINT)STAT_ST_BLOCKSIZE * (SMB_BIG_UINT)sbuf->st_blocks;
|
||||
ret = (uint64_t)STAT_ST_BLOCKSIZE * (uint64_t)sbuf->st_blocks;
|
||||
#else
|
||||
ret = (SMB_BIG_UINT)get_file_size(*sbuf);
|
||||
ret = (uint64_t)get_file_size(*sbuf);
|
||||
#endif
|
||||
|
||||
if (fsp && fsp->initial_allocation_size)
|
||||
@ -1264,7 +1264,7 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx,
|
||||
long prev_dirpos=0;
|
||||
uint32 mode=0;
|
||||
SMB_OFF_T file_size = 0;
|
||||
SMB_BIG_UINT allocation_size = 0;
|
||||
uint64_t allocation_size = 0;
|
||||
uint32 len;
|
||||
struct timespec mdate_ts, adate_ts, create_date_ts;
|
||||
time_t mdate = (time_t)0, adate = (time_t)0, create_date = (time_t)0;
|
||||
@ -2613,22 +2613,22 @@ static void call_trans2qfsinfo(connection_struct *conn,
|
||||
switch (info_level) {
|
||||
case SMB_INFO_ALLOCATION:
|
||||
{
|
||||
SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
|
||||
uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
|
||||
data_len = 18;
|
||||
if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
|
||||
if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
|
||||
reply_unixerror(req, ERRHRD, ERRgeneral);
|
||||
return;
|
||||
}
|
||||
|
||||
block_size = lp_block_size(snum);
|
||||
if (bsize < block_size) {
|
||||
SMB_BIG_UINT factor = block_size/bsize;
|
||||
uint64_t factor = block_size/bsize;
|
||||
bsize = block_size;
|
||||
dsize /= factor;
|
||||
dfree /= factor;
|
||||
}
|
||||
if (bsize > block_size) {
|
||||
SMB_BIG_UINT factor = bsize/block_size;
|
||||
uint64_t factor = bsize/block_size;
|
||||
bsize = block_size;
|
||||
dsize *= factor;
|
||||
dfree *= factor;
|
||||
@ -2733,21 +2733,21 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)st.st_dev, (unsi
|
||||
case SMB_QUERY_FS_SIZE_INFO:
|
||||
case SMB_FS_SIZE_INFORMATION:
|
||||
{
|
||||
SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
|
||||
uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
|
||||
data_len = 24;
|
||||
if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
|
||||
if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
|
||||
reply_unixerror(req, ERRHRD, ERRgeneral);
|
||||
return;
|
||||
}
|
||||
block_size = lp_block_size(snum);
|
||||
if (bsize < block_size) {
|
||||
SMB_BIG_UINT factor = block_size/bsize;
|
||||
uint64_t factor = block_size/bsize;
|
||||
bsize = block_size;
|
||||
dsize /= factor;
|
||||
dfree /= factor;
|
||||
}
|
||||
if (bsize > block_size) {
|
||||
SMB_BIG_UINT factor = bsize/block_size;
|
||||
uint64_t factor = bsize/block_size;
|
||||
bsize = block_size;
|
||||
dsize *= factor;
|
||||
dfree *= factor;
|
||||
@ -2766,21 +2766,21 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
|
||||
|
||||
case SMB_FS_FULL_SIZE_INFORMATION:
|
||||
{
|
||||
SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
|
||||
uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
|
||||
data_len = 32;
|
||||
if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
|
||||
if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
|
||||
reply_unixerror(req, ERRHRD, ERRgeneral);
|
||||
return;
|
||||
}
|
||||
block_size = lp_block_size(snum);
|
||||
if (bsize < block_size) {
|
||||
SMB_BIG_UINT factor = block_size/bsize;
|
||||
uint64_t factor = block_size/bsize;
|
||||
bsize = block_size;
|
||||
dsize /= factor;
|
||||
dfree /= factor;
|
||||
}
|
||||
if (bsize > block_size) {
|
||||
SMB_BIG_UINT factor = bsize/block_size;
|
||||
uint64_t factor = bsize/block_size;
|
||||
bsize = block_size;
|
||||
dsize *= factor;
|
||||
dfree *= factor;
|
||||
@ -2811,8 +2811,8 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
|
||||
* what we have to send --metze:
|
||||
*
|
||||
* Unknown1: 24 NULL bytes
|
||||
* Soft Quota Treshold: 8 bytes seems like SMB_BIG_UINT or so
|
||||
* Hard Quota Limit: 8 bytes seems like SMB_BIG_UINT or so
|
||||
* Soft Quota Treshold: 8 bytes seems like uint64_t or so
|
||||
* Hard Quota Limit: 8 bytes seems like uint64_t or so
|
||||
* Quota Flags: 2 byte :
|
||||
* Unknown3: 6 NULL bytes
|
||||
*
|
||||
@ -2860,9 +2860,9 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
|
||||
DEBUG(10,("SMB_FS_QUOTA_INFORMATION: for service [%s]\n",lp_servicename(SNUM(conn))));
|
||||
|
||||
/* Unknown1 24 NULL bytes*/
|
||||
SBIG_UINT(pdata,0,(SMB_BIG_UINT)0);
|
||||
SBIG_UINT(pdata,8,(SMB_BIG_UINT)0);
|
||||
SBIG_UINT(pdata,16,(SMB_BIG_UINT)0);
|
||||
SBIG_UINT(pdata,0,(uint64_t)0);
|
||||
SBIG_UINT(pdata,8,(uint64_t)0);
|
||||
SBIG_UINT(pdata,16,(uint64_t)0);
|
||||
|
||||
/* Default Soft Quota 8 bytes */
|
||||
SBIG_UINT(pdata,24,quotas.softlim);
|
||||
@ -2935,7 +2935,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
|
||||
/* We have POSIX ACLs, pathname, encryption,
|
||||
* large read/write, and locking capability. */
|
||||
|
||||
SBIG_UINT(pdata,4,((SMB_BIG_UINT)(
|
||||
SBIG_UINT(pdata,4,((uint64_t)(
|
||||
CIFS_UNIX_POSIX_ACLS_CAP|
|
||||
CIFS_UNIX_POSIX_PATHNAMES_CAP|
|
||||
CIFS_UNIX_FCNTL_LOCKS_CAP|
|
||||
@ -3037,9 +3037,9 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
|
||||
SIVAL(pdata, 0, flags);
|
||||
SIVAL(pdata, 4, SMB_WHOAMI_MASK);
|
||||
SBIG_UINT(pdata, 8,
|
||||
(SMB_BIG_UINT)conn->server_info->utok.uid);
|
||||
(uint64_t)conn->server_info->utok.uid);
|
||||
SBIG_UINT(pdata, 16,
|
||||
(SMB_BIG_UINT)conn->server_info->utok.gid);
|
||||
(uint64_t)conn->server_info->utok.gid);
|
||||
|
||||
|
||||
if (data_len >= max_data_bytes) {
|
||||
@ -3078,7 +3078,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
|
||||
/* GID list */
|
||||
for (i = 0; i < conn->server_info->utok.ngroups; ++i) {
|
||||
SBIG_UINT(pdata, data_len,
|
||||
(SMB_BIG_UINT)conn->server_info->utok.groups[i]);
|
||||
(uint64_t)conn->server_info->utok.groups[i]);
|
||||
data_len += 8;
|
||||
}
|
||||
|
||||
@ -3319,10 +3319,10 @@ cap_low = 0x%x, cap_high = 0x%x\n",
|
||||
|
||||
/* unknown_1 24 NULL bytes in pdata*/
|
||||
|
||||
/* the soft quotas 8 bytes (SMB_BIG_UINT)*/
|
||||
quotas.softlim = (SMB_BIG_UINT)IVAL(pdata,24);
|
||||
/* the soft quotas 8 bytes (uint64_t)*/
|
||||
quotas.softlim = (uint64_t)IVAL(pdata,24);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
quotas.softlim |= (((SMB_BIG_UINT)IVAL(pdata,28)) << 32);
|
||||
quotas.softlim |= (((uint64_t)IVAL(pdata,28)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if ((IVAL(pdata,28) != 0)&&
|
||||
((quotas.softlim != 0xFFFFFFFF)||
|
||||
@ -3335,10 +3335,10 @@ cap_low = 0x%x, cap_high = 0x%x\n",
|
||||
}
|
||||
#endif /* LARGE_SMB_OFF_T */
|
||||
|
||||
/* the hard quotas 8 bytes (SMB_BIG_UINT)*/
|
||||
quotas.hardlim = (SMB_BIG_UINT)IVAL(pdata,32);
|
||||
/* the hard quotas 8 bytes (uint64_t)*/
|
||||
quotas.hardlim = (uint64_t)IVAL(pdata,32);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
quotas.hardlim |= (((SMB_BIG_UINT)IVAL(pdata,36)) << 32);
|
||||
quotas.hardlim |= (((uint64_t)IVAL(pdata,36)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if ((IVAL(pdata,36) != 0)&&
|
||||
((quotas.hardlim != 0xFFFFFFFF)||
|
||||
@ -3828,7 +3828,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
|
||||
int mode=0;
|
||||
int nlink;
|
||||
SMB_OFF_T file_size=0;
|
||||
SMB_BIG_UINT allocation_size=0;
|
||||
uint64_t allocation_size=0;
|
||||
unsigned int data_size = 0;
|
||||
unsigned int param_size = 2;
|
||||
SMB_STRUCT_STAT sbuf;
|
||||
@ -4682,8 +4682,8 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
|
||||
case SMB_QUERY_POSIX_LOCK:
|
||||
{
|
||||
NTSTATUS status = NT_STATUS_INVALID_LEVEL;
|
||||
SMB_BIG_UINT count;
|
||||
SMB_BIG_UINT offset;
|
||||
uint64_t count;
|
||||
uint64_t offset;
|
||||
uint32 lock_pid;
|
||||
enum brl_type lock_type;
|
||||
|
||||
@ -4711,13 +4711,13 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
|
||||
|
||||
lock_pid = IVAL(pdata, POSIX_LOCK_PID_OFFSET);
|
||||
#if defined(HAVE_LONGLONG)
|
||||
offset = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
|
||||
((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_START_OFFSET));
|
||||
count = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
|
||||
((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
|
||||
offset = (((uint64_t) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
|
||||
((uint64_t) IVAL(pdata,POSIX_LOCK_START_OFFSET));
|
||||
count = (((uint64_t) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
|
||||
((uint64_t) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
|
||||
#else /* HAVE_LONGLONG */
|
||||
offset = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_START_OFFSET);
|
||||
count = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
|
||||
offset = (uint64_t)IVAL(pdata,POSIX_LOCK_START_OFFSET);
|
||||
count = (uint64_t)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
|
||||
#endif /* HAVE_LONGLONG */
|
||||
|
||||
status = query_lock(fsp,
|
||||
@ -5123,7 +5123,7 @@ static NTSTATUS smb_file_position_information(connection_struct *conn,
|
||||
int total_data,
|
||||
files_struct *fsp)
|
||||
{
|
||||
SMB_BIG_UINT position_information;
|
||||
uint64_t position_information;
|
||||
|
||||
if (total_data < 8) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
@ -5134,9 +5134,9 @@ static NTSTATUS smb_file_position_information(connection_struct *conn,
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
position_information = (SMB_BIG_UINT)IVAL(pdata,0);
|
||||
position_information = (uint64_t)IVAL(pdata,0);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
position_information |= (((SMB_BIG_UINT)IVAL(pdata,4)) << 32);
|
||||
position_information |= (((uint64_t)IVAL(pdata,4)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if (IVAL(pdata,4) != 0) {
|
||||
/* more than 32 bits? */
|
||||
@ -5475,8 +5475,8 @@ static NTSTATUS smb_set_posix_lock(connection_struct *conn,
|
||||
int total_data,
|
||||
files_struct *fsp)
|
||||
{
|
||||
SMB_BIG_UINT count;
|
||||
SMB_BIG_UINT offset;
|
||||
uint64_t count;
|
||||
uint64_t offset;
|
||||
uint32 lock_pid;
|
||||
bool blocking_lock = False;
|
||||
enum brl_type lock_type;
|
||||
@ -5523,13 +5523,13 @@ static NTSTATUS smb_set_posix_lock(connection_struct *conn,
|
||||
|
||||
lock_pid = IVAL(pdata, POSIX_LOCK_PID_OFFSET);
|
||||
#if defined(HAVE_LONGLONG)
|
||||
offset = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
|
||||
((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_START_OFFSET));
|
||||
count = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
|
||||
((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
|
||||
offset = (((uint64_t) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
|
||||
((uint64_t) IVAL(pdata,POSIX_LOCK_START_OFFSET));
|
||||
count = (((uint64_t) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
|
||||
((uint64_t) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
|
||||
#else /* HAVE_LONGLONG */
|
||||
offset = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_START_OFFSET);
|
||||
count = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
|
||||
offset = (uint64_t)IVAL(pdata,POSIX_LOCK_START_OFFSET);
|
||||
count = (uint64_t)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
|
||||
#endif /* HAVE_LONGLONG */
|
||||
|
||||
DEBUG(10,("smb_set_posix_lock: file %s, lock_type = %u,"
|
||||
@ -5702,7 +5702,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
|
||||
const char *fname,
|
||||
SMB_STRUCT_STAT *psbuf)
|
||||
{
|
||||
SMB_BIG_UINT allocation_size = 0;
|
||||
uint64_t allocation_size = 0;
|
||||
NTSTATUS status = NT_STATUS_OK;
|
||||
files_struct *new_fsp = NULL;
|
||||
|
||||
@ -5714,9 +5714,9 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
allocation_size = (SMB_BIG_UINT)IVAL(pdata,0);
|
||||
allocation_size = (uint64_t)IVAL(pdata,0);
|
||||
#ifdef LARGE_SMB_OFF_T
|
||||
allocation_size |= (((SMB_BIG_UINT)IVAL(pdata,4)) << 32);
|
||||
allocation_size |= (((uint64_t)IVAL(pdata,4)) << 32);
|
||||
#else /* LARGE_SMB_OFF_T */
|
||||
if (IVAL(pdata,4) != 0) {
|
||||
/* more than 32 bits? */
|
||||
|
@ -501,13 +501,13 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
|
||||
Returns 0 on success, -1 on failure.
|
||||
****************************************************************************/
|
||||
|
||||
int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
|
||||
int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
|
||||
{
|
||||
int ret;
|
||||
SMB_STRUCT_STAT st;
|
||||
connection_struct *conn = fsp->conn;
|
||||
SMB_BIG_UINT space_avail;
|
||||
SMB_BIG_UINT bsize,dfree,dsize;
|
||||
uint64_t space_avail;
|
||||
uint64_t bsize,dfree,dsize;
|
||||
|
||||
release_level_2_oplocks_on_change(fsp);
|
||||
|
||||
@ -527,10 +527,10 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
|
||||
if (ret == -1)
|
||||
return ret;
|
||||
|
||||
if (len == (SMB_BIG_UINT)st.st_size)
|
||||
if (len == (uint64_t)st.st_size)
|
||||
return 0;
|
||||
|
||||
if (len < (SMB_BIG_UINT)st.st_size) {
|
||||
if (len < (uint64_t)st.st_size) {
|
||||
/* Shrink - use ftruncate. */
|
||||
|
||||
DEBUG(10,("vfs_allocate_file_space: file %s, shrink. Current size %.0f\n",
|
||||
@ -551,7 +551,7 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
|
||||
len -= st.st_size;
|
||||
len /= 1024; /* Len is now number of 1k blocks needed. */
|
||||
space_avail = get_dfree_info(conn,fsp->fsp_name,False,&bsize,&dfree,&dsize);
|
||||
if (space_avail == (SMB_BIG_UINT)-1) {
|
||||
if (space_avail == (uint64_t)-1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ static NTSTATUS cmd_disconnect(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a
|
||||
|
||||
static NTSTATUS cmd_disk_free(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
|
||||
{
|
||||
SMB_BIG_UINT diskfree, bsize, dfree, dsize;
|
||||
uint64_t diskfree, bsize, dfree, dsize;
|
||||
if (argc != 2) {
|
||||
printf("Usage: disk_free <path>\n");
|
||||
return NT_STATUS_OK;
|
||||
|
@ -71,7 +71,7 @@ struct record {
|
||||
enum lock_op lock_op;
|
||||
enum brl_type lock_type;
|
||||
char conn, f;
|
||||
SMB_BIG_UINT start, len;
|
||||
uint64_t start, len;
|
||||
char needed;
|
||||
};
|
||||
|
||||
@ -303,8 +303,8 @@ static bool test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
|
||||
{
|
||||
unsigned conn = rec->conn;
|
||||
unsigned f = rec->f;
|
||||
SMB_BIG_UINT start = rec->start;
|
||||
SMB_BIG_UINT len = rec->len;
|
||||
uint64_t start = rec->start;
|
||||
uint64_t len = rec->len;
|
||||
enum brl_type op = rec->lock_type;
|
||||
int server;
|
||||
bool ret[NSERVERS];
|
||||
|
@ -180,11 +180,7 @@ static int parse_quota_set(TALLOC_CTX *ctx,
|
||||
|
||||
switch (todo) {
|
||||
case PARSE_LIM:
|
||||
#if defined(HAVE_LONGLONG)
|
||||
if (sscanf(p,"%llu/%llu",&pqt->softlim,&pqt->hardlim)!=2) {
|
||||
#else
|
||||
if (sscanf(p,"%lu/%lu",&pqt->softlim,&pqt->hardlim)!=2) {
|
||||
#endif
|
||||
if (sscanf(p,"%"PRIu64"/%"PRIu64,&pqt->softlim,&pqt->hardlim)!=2) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -423,12 +423,12 @@ bool status_profile_dump(bool verbose)
|
||||
static int print_count_samples(
|
||||
const struct profile_stats * const current,
|
||||
const struct profile_stats * const last,
|
||||
SMB_BIG_UINT delta_usec)
|
||||
uint64_t delta_usec)
|
||||
{
|
||||
int i;
|
||||
int count = 0;
|
||||
unsigned step;
|
||||
SMB_BIG_UINT spent;
|
||||
uint64_t spent;
|
||||
int delta_sec;
|
||||
const char * name;
|
||||
char buf[40];
|
||||
@ -467,13 +467,13 @@ static int print_count_samples(
|
||||
}
|
||||
|
||||
static struct profile_stats sample_data[2];
|
||||
static SMB_BIG_UINT sample_time[2];
|
||||
static uint64_t sample_time[2];
|
||||
|
||||
bool status_profile_rates(bool verbose)
|
||||
{
|
||||
SMB_BIG_UINT remain_usec;
|
||||
SMB_BIG_UINT next_usec;
|
||||
SMB_BIG_UINT delta_usec;
|
||||
uint64_t remain_usec;
|
||||
uint64_t next_usec;
|
||||
uint64_t delta_usec;
|
||||
|
||||
int last = 0;
|
||||
int current = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user