[nfs-ganesha] getdents()->getdents64(), struct dirent -> struct dirent64
Kaleb S. KEITHLEY
kkeithle at fedoraproject.org
Thu May 22 11:13:28 UTC 2014
commit fe5a967eb906d4440445ab9d997cd6a109554b4b
Author: Kaleb S. KEITHLEY <kkeithle at redhat.com>
Date: Thu May 22 07:12:56 2014 -0400
getdents()->getdents64(), struct dirent -> struct dirent64
nfs-ganesha-2.0.0-dirent.patch | 91 ++++++++++++++++++++++++++++++++++++++++
nfs-ganesha.spec | 7 +++-
2 files changed, 97 insertions(+), 1 deletions(-)
---
diff --git a/nfs-ganesha-2.0.0-dirent.patch b/nfs-ganesha-2.0.0-dirent.patch
new file mode 100644
index 0000000..ff4800d
--- /dev/null
+++ b/nfs-ganesha-2.0.0-dirent.patch
@@ -0,0 +1,91 @@
+--- nfs-ganesha-2.0.0/src/CMakeLists.txt.orig 2014-05-20 13:58:50.685211144 -0400
++++ nfs-ganesha-2.0.0/src/CMakeLists.txt 2014-05-20 14:00:24.825924703 -0400
+@@ -125,6 +125,7 @@
+
+ if (LINUX)
+ set(PLATFORM "LINUX")
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE64_SOURCE")
+ set(OS_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include/os/linux")
+ find_library(LIBDL dl) # module loader
+ endif(LINUX)
+--- nfs-ganesha-2.0.0/src/os/linux/subr.c.orig 2014-05-20 14:02:56.340987294 -0400
++++ nfs-ganesha-2.0.0/src/os/linux/subr.c 2014-05-20 14:03:41.196565516 -0400
+@@ -34,6 +34,7 @@
+ #include <sys/syscall.h>
+ #include "os/subr.h"
+
++#ifdef NOT_TRUE
+ /* not defined in linux headers so we do it here
+ */
+ struct linux_dirent {
+@@ -50,6 +51,7 @@
+ // offset is (d_reclen - 1))
+ */
+ };
++#endif
+
+ /**
+ * @brief Read system directory entries into the buffer
+@@ -63,7 +65,7 @@
+ {
+ int retval = 0;
+
+- retval = syscall(SYS_getdents, fd, buf, bcount);
++ retval = syscall(SYS_getdents64, fd, buf, bcount);
+ if (retval >= 0)
+ *basepp += retval;
+ return retval;
+@@ -82,7 +84,7 @@
+
+ bool to_vfs_dirent(char *buf, int bpos, struct vfs_dirent *vd, off_t base)
+ {
+- struct linux_dirent *dp = (struct linux_dirent *)(buf + bpos);
++ struct dirent64 *dp = (struct dirent64 *)(buf + bpos);
+ char type;
+
+ vd->vd_ino = dp->d_ino;
+--- nfs-ganesha-2.0.0/src/FSAL/FSAL_GPFS/handle.c.orig 2014-05-20 14:30:03.880250822 -0400
++++ nfs-ganesha-2.0.0/src/FSAL/FSAL_GPFS/handle.c 2014-05-20 14:31:41.470619655 -0400
+@@ -438,6 +438,7 @@
+ return status;
+ }
+
++#ifdef NOT_TRUE
+ /* not defined in linux headers so we do it here
+ */
+
+@@ -455,6 +456,7 @@
+ // offset is (d_reclen - 1))
+ */
+ };
++#endif
+
+ #define BUF_SIZE 1024
+ /**
+@@ -480,7 +482,7 @@
+ fsal_status_t status;
+ off_t seekloc = 0;
+ int bpos, cnt, nread;
+- struct linux_dirent *dentry;
++ struct dirent64 *dentry;
+ char buf[BUF_SIZE];
+
+ if (whence != NULL)
+@@ -502,7 +504,7 @@
+ }
+ cnt = 0;
+ do {
+- nread = syscall(SYS_getdents, dirfd, buf, BUF_SIZE);
++ nread = syscall(SYS_getdents64, dirfd, buf, BUF_SIZE);
+ if (nread < 0) {
+ retval = errno;
+ fsal_error = posix2fsal_error(retval);
+@@ -511,7 +513,7 @@
+ if (nread == 0)
+ break;
+ for (bpos = 0; bpos < nread;) {
+- dentry = (struct linux_dirent *)(buf + bpos);
++ dentry = (struct dirent64 *)(buf + bpos);
+ if (strcmp(dentry->d_name, ".") == 0
+ || strcmp(dentry->d_name, "..") == 0)
+ goto skip; /* must skip '.' and '..' */
diff --git a/nfs-ganesha.spec b/nfs-ganesha.spec
index 40a8bd7..56477eb 100644
--- a/nfs-ganesha.spec
+++ b/nfs-ganesha.spec
@@ -17,7 +17,7 @@
Name: nfs-ganesha
Version: 2.0.0
-Release: 7%{?prereltag:.%{prereltag}}%{?dist}
+Release: 8%{?prereltag:.%{prereltag}}%{?dist}
Summary: Ganesha NFS Server
Group: System Environment/Libraries
License: LGPLv3+
@@ -33,6 +33,7 @@ Source4: nfs_ganesha.sh
Patch1: nfs-ganesha-2.0.0rc5.patch
Patch2: nfs-ganesha-2.0.0-lustre-strict.patch
Patch3: nfs-ganesha-2.0.0-no-strict-aliasing.patch
+Patch4: nfs-ganesha-2.0.0-dirent.patch
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
@@ -152,6 +153,7 @@ mv %{ntirpcname}-%{ntirpcvers}/* src/libntirpc/
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
%patch3 -p1
%endif
+%patch4 -p1
%build
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
@@ -232,6 +234,9 @@ install -D -p -m 0744 %{SOURCE4} %{buildroot}%{_sbindir}/nfs_ganesha.sh
%dir %{_pkgdocdir}
%changelog
+* Wed May 21 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-8
+- getdents()->getdents64(), struct dirent -> struct dirent64
+
* Sat May 10 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com>
- and exclude libfsalceph
More information about the scm-commits
mailing list