summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syscall.c
diff options
context:
space:
mode:
authorKevin Vigor <kvigor@fb.com>2017-01-23 10:27:52 -0800
committerKevin Vigor <kvigor@fb.com>2017-01-23 10:27:52 -0800
commitf80281c05e3f1c0ead5910586c7e81f047add623 (patch)
treef58cac77acef73cfdf14d420bd10613ad3dc1850 /libglusterfs/src/syscall.c
parent6f6a21f1bbc5131e70b42d89a5ac8d8aa709ad3f (diff)
parentb21c51e6f0baa5145923637f54e79d221ca59cff (diff)
Merge remote-tracking branch 'origin/release-3.8' into merge-3.8
Change-Id: Ie6c73dee0b6798af4a69c43c0b03c3d02ff36aa2
Diffstat (limited to 'libglusterfs/src/syscall.c')
-rw-r--r--libglusterfs/src/syscall.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/libglusterfs/src/syscall.c b/libglusterfs/src/syscall.c
index 316d80452fb..7cf1c7757fe 100644
--- a/libglusterfs/src/syscall.c
+++ b/libglusterfs/src/syscall.c
@@ -309,7 +309,40 @@ sys_lseek (int fd, off_t offset, int whence)
int
sys_statvfs (const char *path, struct statvfs *buf)
{
- return statvfs (path, buf);
+ int ret;
+
+ ret = statvfs (path, buf);
+#ifdef __FreeBSD__
+ /* FreeBSD doesn't return the expected vaule in buf->f_bsize. It
+ * contains the optimal I/O size instead of the file system block
+ * size. Gluster expects that this field contains the block size.
+ */
+ if (ret == 0) {
+ buf->f_bsize = buf->f_frsize;
+ }
+#endif /* __FreeBSD__ */
+
+ return ret;
+}
+
+
+int
+sys_fstatvfs (int fd, struct statvfs *buf)
+{
+ int ret;
+
+ ret = fstatvfs (fd, buf);
+#ifdef __FreeBSD__
+ /* FreeBSD doesn't return the expected vaule in buf->f_bsize. It
+ * contains the optimal I/O size instead of the file system block
+ * size. Gluster expects this field to contain the block size.
+ */
+ if (ret == 0) {
+ buf->f_bsize = buf->f_frsize;
+ }
+#endif /* __FreeBSD__ */
+
+ return ret;
}