summaryrefslogtreecommitdiff
authorWan Yong <wanyong@gmail.com>2011-04-06 10:02:15 (GMT)
committer Wan Yong <wanyong@gmail.com>2011-04-06 10:02:15 (GMT)
commit917b04e6d6f1d8ca6d1be145dc47109ee09801c7 (patch)
tree182f616c4f4123a30ec849abbb1b59833bcaf879
parentdc9335048d6aa42088d5ab63653d86f7c2e39200 (diff)
downloadntfs-3g-917b04e6d6f1d8ca6d1be145dc47109ee09801c7.zip
ntfs-3g-917b04e6d6f1d8ca6d1be145dc47109ee09801c7.tar.gz
ntfs-3g-917b04e6d6f1d8ca6d1be145dc47109ee09801c7.tar.bz2
fix get ntfs disk size issue
Diffstat
-rwxr-xr-xconfig.h2
-rwxr-xr-xinclude/fuse-lite/fuse.h6
-rwxr-xr-xinclude/fuse-lite/fuse_lowlevel.h4
-rwxr-xr-xlibfuse-lite/fuse.c6
-rwxr-xr-xlibfuse-lite/fuse_lowlevel.c10
-rwxr-xr-xsrc/lowntfs-3g.c2
-rwxr-xr-xsrc/ntfs-3g.c6
7 files changed, 18 insertions, 18 deletions
diff --git a/config.h b/config.h
index 5ee6935..bd1f225 100755
--- a/config.h
+++ b/config.h
@@ -235,7 +235,7 @@
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/statvfs.h> header file. */
-//#define HAVE_SYS_STATVFS_H 1
+#define HAVE_SYS_STATVFS_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
diff --git a/include/fuse-lite/fuse.h b/include/fuse-lite/fuse.h
index 1b3291a..6e7087e 100755
--- a/include/fuse-lite/fuse.h
+++ b/include/fuse-lite/fuse.h
@@ -26,7 +26,7 @@
#include <sys/stat.h>
#if HAVE_SYS_STATVFS_H
-#include <sys/statvfs.h>
+#include <sys/statfs.h>
#endif
#ifdef __cplusplus
@@ -192,7 +192,7 @@ struct fuse_operations {
*/
#if HAVE_SYS_STATVFS_H
- int (*statfs) (const char *, struct statvfs *);
+ int (*statfs) (const char *, struct statfs *);
#endif
/** Possibly flush cached data
@@ -581,7 +581,7 @@ int fuse_fs_flush(struct fuse_fs *fs, const char *path,
struct fuse_file_info *fi);
#if HAVE_SYS_STATVFS_H
-int fuse_fs_statfs(struct fuse_fs *fs, const char *path, struct statvfs *buf);
+int fuse_fs_statfs(struct fuse_fs *fs, const char *path, struct statfs *buf);
#endif
int fuse_fs_opendir(struct fuse_fs *fs, const char *path,
diff --git a/include/fuse-lite/fuse_lowlevel.h b/include/fuse-lite/fuse_lowlevel.h
index 5b6dc6d..e921d15 100755
--- a/include/fuse-lite/fuse_lowlevel.h
+++ b/include/fuse-lite/fuse_lowlevel.h
@@ -26,7 +26,7 @@
#if HAVE_SYS_STATVFS_H
-#include <sys/statvfs.h>
+#include <sys/statfs.h>
#endif
#include <sys/uio.h>
@@ -961,7 +961,7 @@ int fuse_reply_iov(fuse_req_t req, const struct iovec *iov, int count);
* @return zero for success, -errno for failure to send reply
*/
#if HAVE_SYS_STATVFS_H
-int fuse_reply_statfs(fuse_req_t req, const struct statvfs *stbuf);
+int fuse_reply_statfs(fuse_req_t req, const struct statfs *stbuf);
#endif
diff --git a/libfuse-lite/fuse.c b/libfuse-lite/fuse.c
index 0e81738..a60717b 100755
--- a/libfuse-lite/fuse.c
+++ b/libfuse-lite/fuse.c
@@ -678,13 +678,13 @@ int fuse_fs_flush(struct fuse_fs *fs, const char *path,
}
#if HAVE_SYS_STATVFS_H
-int fuse_fs_statfs(struct fuse_fs *fs, const char *path, struct statvfs *buf)
+int fuse_fs_statfs(struct fuse_fs *fs, const char *path, struct statfs *buf)
{
fuse_get_context()->private_data = fs->user_data;
if (fs->op.statfs)
return fs->op.statfs(path, buf);
else {
- buf->f_namemax = 255;
+ buf->f_namelen = 255;
buf->f_bsize = 512;
return 0;
}
@@ -1976,7 +1976,7 @@ static void fuse_lib_statfs(fuse_req_t req, fuse_ino_t ino)
struct fuse *f = req_fuse_prepare(req);
#if HAVE_SYS_STATVFS_H
- struct statvfs buf;
+ struct statfs buf;
char *path;
int err;
diff --git a/libfuse-lite/fuse_lowlevel.c b/libfuse-lite/fuse_lowlevel.c
index f6530c1..1457e6c 100755
--- a/libfuse-lite/fuse_lowlevel.c
+++ b/libfuse-lite/fuse_lowlevel.c
@@ -249,7 +249,7 @@ size_t fuse_add_direntry(fuse_req_t req, char *buf, size_t bufsize,
#if HAVE_SYS_STATVFS_H
-static void convert_statfs(const struct statvfs *stbuf,
+static void convert_statfs(const struct statfs *stbuf,
struct fuse_kstatfs *kstatfs)
{
kstatfs->bsize = stbuf->f_bsize;
@@ -259,7 +259,7 @@ static void convert_statfs(const struct statvfs *stbuf,
kstatfs->bavail = stbuf->f_bavail;
kstatfs->files = stbuf->f_files;
kstatfs->ffree = stbuf->f_ffree;
- kstatfs->namelen = stbuf->f_namemax;
+ kstatfs->namelen = stbuf->f_namelen;
}
#endif
@@ -418,7 +418,7 @@ int fuse_reply_buf(fuse_req_t req, const char *buf, size_t size)
#if HAVE_SYS_STATVFS_H
-int fuse_reply_statfs(fuse_req_t req, const struct statvfs *stbuf)
+int fuse_reply_statfs(fuse_req_t req, const struct statfs *stbuf)
{
struct fuse_statfs_out arg;
size_t size = req->f->conn.proto_minor < 4 ? FUSE_COMPAT_STATFS_SIZE : sizeof(arg);
@@ -825,8 +825,8 @@ static void do_statfs(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
req->f->op.statfs(req, nodeid);
else {
#if HAVE_SYS_STATVFS_H
- struct statvfs buf = {
- .f_namemax = 255,
+ struct statfs buf = {
+ .f_namelen = 255,
.f_bsize = 512,
};
fuse_reply_statfs(req, &buf);
diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c
index b6cdafd..a943e60 100755
--- a/src/lowntfs-3g.c
+++ b/src/lowntfs-3g.c
@@ -491,7 +491,7 @@ static void ntfs_fuse_statfs(fuse_req_t req,
size += vol->free_mft_records;
if (size < 0)
size = 0;
- sfs.f_ffree = sfs.f_favail = size;
+ sfs.f_ffree = /*sfs.f_favail =*/ size;
/* Maximum length of filenames. */
sfs.f_namemax = NTFS_MAX_NAME_LEN;
diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c
index 73a66b9..23c8716 100755
--- a/src/ntfs-3g.c
+++ b/src/ntfs-3g.c
@@ -470,7 +470,7 @@ static int ntfs_allowed_real_dir_access(struct SECURITY_CONTEXT *scx,
*/
#if HAVE_SYS_STATVFS_H
static int ntfs_fuse_statfs(const char *path __attribute__((unused)),
- struct statvfs *sfs)
+ struct statfs *sfs)
{
s64 size;
int delta_bits;
@@ -516,10 +516,10 @@ static int ntfs_fuse_statfs(const char *path __attribute__((unused)),
size += vol->free_mft_records;
if (size < 0)
size = 0;
- sfs->f_ffree = sfs->f_favail = size;
+ sfs->f_ffree = /*sfs->f_favail = */size;
/* Maximum length of filenames. */
- sfs->f_namemax = NTFS_MAX_NAME_LEN;
+ sfs->f_namelen = NTFS_MAX_NAME_LEN;
return 0;
}
#endif