From 352c97561e9de6ccd0102859d18ed15913042622 Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Fri, 13 Feb 2009 16:47:54 -0500 Subject: [Bug 6069] Add a fstatvfs function for libsmbclient - Revert Tim's changes for the moment. I need to see what the issue is and arrange to use "struct statvfs" if at all possible. Derrell --- source3/include/libsmb_internal.h | 4 ++-- source3/include/libsmbclient.h | 25 +++++-------------------- source3/libsmb/libsmb_compat.c | 4 ++-- source3/libsmb/libsmb_stat.c | 4 ++-- 4 files changed, 11 insertions(+), 26 deletions(-) (limited to 'source3') diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index d3683eb3dc..166685c380 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -506,13 +506,13 @@ SMBC_fstat_ctx(SMBCCTX *context, int SMBC_statvfs_ctx(SMBCCTX *context, char *path, - struct smbc_statvfs *st); + struct statvfs *st); int SMBC_fstatvfs_ctx(SMBCCTX *context, SMBCFILE *file, - struct smbc_statvfs *st); + struct statvfs *st); /* Functions in libsmb_xattr.c */ diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h index 3bea0897d1..d35d9de6ea 100644 --- a/source3/include/libsmbclient.h +++ b/source3/include/libsmbclient.h @@ -75,6 +75,7 @@ extern "C" { /* Make sure we have the following includes for now ... */ #include #include +#include #include #include @@ -173,22 +174,6 @@ typedef enum smbc_smb_encrypt_level SMBC_ENCRYPTLEVEL_REQUIRE = 2 } smbc_smb_encrypt_level; -/** - * Use a system independent statvfs struct for smbclient. - */ -struct smbc_statvfs { - fsblkcnt_t f_bavail; - fsblkcnt_t f_bfree; - fsblkcnt_t f_blocks; - fsfilcnt_t f_favail; - fsfilcnt_t f_ffree; - fsfilcnt_t f_files; - unsigned long f_bsize; - unsigned long f_flag; - unsigned long f_frsize; - unsigned long f_fsid; - unsigned long f_namemax; -}; /** * Capabilities set in the f_flag field of struct statvfs, from @@ -887,13 +872,13 @@ void smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn); typedef int (*smbc_statvfs_fn)(SMBCCTX *c, char *path, - struct smbc_statvfs *st); + struct statvfs *st); smbc_statvfs_fn smbc_getFunctionStatVFS(SMBCCTX *c); void smbc_setFunctionStatVFS(SMBCCTX *c, smbc_statvfs_fn fn); typedef int (*smbc_fstatvfs_fn)(SMBCCTX *c, SMBCFILE *file, - struct smbc_statvfs *st); + struct statvfs *st); smbc_fstatvfs_fn smbc_getFunctionFstatVFS(SMBCCTX *c); void smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn); @@ -1655,7 +1640,7 @@ int smbc_fstat(int fd, struct stat *st); */ int smbc_statvfs(char *url, - struct smbc_statvfs *st); + struct statvfs *st); /**@ingroup attribute * Get file system information via an file descriptor. @@ -1678,7 +1663,7 @@ smbc_statvfs(char *url, */ int smbc_fstatvfs(int fd, - struct smbc_statvfs *st); + struct statvfs *st); /**@ingroup attribute diff --git a/source3/libsmb/libsmb_compat.c b/source3/libsmb/libsmb_compat.c index 95485dc102..56d113f31a 100644 --- a/source3/libsmb/libsmb_compat.c +++ b/source3/libsmb/libsmb_compat.c @@ -331,14 +331,14 @@ smbc_fstat(int fd, int smbc_statvfs(char *path, - struct smbc_statvfs *st) + struct statvfs *st) { return smbc_getFunctionStatVFS(statcont)(statcont, path, st); } int smbc_fstatvfs(int fd, - struct smbc_statvfs *st) + struct statvfs *st) { SMBCFILE * file = find_fd(fd); return smbc_getFunctionFstatVFS(statcont)(statcont, file, st); diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c index 0ad40e878a..d589f7ef71 100644 --- a/source3/libsmb/libsmb_stat.c +++ b/source3/libsmb/libsmb_stat.c @@ -308,7 +308,7 @@ SMBC_fstat_ctx(SMBCCTX *context, int SMBC_statvfs_ctx(SMBCCTX *context, char *path, - struct smbc_statvfs *st) + struct statvfs *st) { int ret; bool bIsDir; @@ -360,7 +360,7 @@ SMBC_statvfs_ctx(SMBCCTX *context, int SMBC_fstatvfs_ctx(SMBCCTX *context, SMBCFILE *file, - struct smbc_statvfs *st) + struct statvfs *st) { uint32 fs_attrs = 0; struct cli_state *cli = file->srv->cli; -- cgit