libcephfs: Improve portability by replacing loff_t type usage with off_t. 64-bit behavior on glibc is enforced with __USE_FILE_OFFSET64 compiler error.

Signed-off-by: John Coyle <dx9err@gmail.com>
This commit is contained in:
John Coyle 2015-10-18 14:37:53 -04:00
parent 1c5623247c
commit 1ff3870471
2 changed files with 4 additions and 10 deletions

View File

@ -23,12 +23,6 @@
#include <stdint.h>
#include <stdbool.h>
// FreeBSD compatibility
#if defined(__FreeBSD__) || defined(__APPLE__)
typedef off_t loff_t;
typedef off_t off64_t;
#endif
#ifdef __cplusplus
extern "C" {
#endif
@ -1387,8 +1381,8 @@ int ceph_ll_setattr(struct ceph_mount_info *cmount, struct Inode *in,
struct stat *st, int mask, int uid, int gid);
int ceph_ll_open(struct ceph_mount_info *cmount, struct Inode *in, int flags,
struct Fh **fh, int uid, int gid);
loff_t ceph_ll_lseek(struct ceph_mount_info *cmount, struct Fh* filehandle,
loff_t offset, int whence);
off_t ceph_ll_lseek(struct ceph_mount_info *cmount, struct Fh* filehandle,
off_t offset, int whence);
int ceph_ll_read(struct ceph_mount_info *cmount, struct Fh* filehandle,
int64_t off, uint64_t len, char* buf);
int ceph_ll_fsync(struct ceph_mount_info *cmount, struct Fh *fh,

View File

@ -1453,8 +1453,8 @@ extern "C" int ceph_ll_fsync(class ceph_mount_info *cmount,
return (cmount->get_client()->ll_fsync(fh, syncdataonly));
}
extern "C" loff_t ceph_ll_lseek(class ceph_mount_info *cmount,
Fh *fh, loff_t offset, int whence)
extern "C" off_t ceph_ll_lseek(class ceph_mount_info *cmount,
Fh *fh, off_t offset, int whence)
{
return (cmount->get_client()->ll_lseek(fh, offset, whence));
}