* by ceph_telldir do not have a particular order (cannot be compared with
* inequality).
*/
-loff_t ceph_telldir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);
+int64_t ceph_telldir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);
/**
* Move the directory stream to a position specified by the given offset.
* a value returned by seekdir. Note that this value does not refer to the nth
* entry in a directory, and can not be manipulated with plus or minus.
*/
-void ceph_seekdir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, loff_t offset);
+void ceph_seekdir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, int64_t offset);
/**
* Create a directory.
* @param size the length of the buffer
* @returns 0 on success or negative error code on failure
*/
-int ceph_readlink(struct ceph_mount_info *cmount, const char *path, char *buf, loff_t size);
+int ceph_readlink(struct ceph_mount_info *cmount, const char *path, char *buf, int64_t size);
/**
* Creates a symbolic link.
* @param size the new size of the file.
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_truncate(struct ceph_mount_info *cmount, const char *path, loff_t size);
+int ceph_truncate(struct ceph_mount_info *cmount, const char *path, int64_t size);
/**
* Make a block or character special file.
* SEEK_END: the offset is set to the end of the file plus @ref offset bytes.
* @returns 0 on success or a negative error code on failure.
*/
-loff_t ceph_lseek(struct ceph_mount_info *cmount, int fd, loff_t offset, int whence);
+int64_t ceph_lseek(struct ceph_mount_info *cmount, int fd, int64_t offset, int whence);
/**
* Read data from the file.
*
* function reads from the current offset of the file descriptor.
* @returns the number of bytes read into buf, or a negative error code on failure.
*/
-int ceph_read(struct ceph_mount_info *cmount, int fd, char *buf, loff_t size, loff_t offset);
+int ceph_read(struct ceph_mount_info *cmount, int fd, char *buf, int64_t size, int64_t offset);
/**
* Write data to a file.
* function writes to the current offset of the file descriptor.
* @returns the number of bytes written, or a negative error code
*/
-int ceph_write(struct ceph_mount_info *cmount, int fd, const char *buf, loff_t size,
- loff_t offset);
+int ceph_write(struct ceph_mount_info *cmount, int fd, const char *buf, int64_t size,
+ int64_t offset);
/**
* Truncate a file to the given size.
* @param size the new size of the file
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_ftruncate(struct ceph_mount_info *cmount, int fd, loff_t size);
+int ceph_ftruncate(struct ceph_mount_info *cmount, int fd, int64_t size);
/**
* Synchronize an open file to persistent media.
* @return 0 on success or a negative error code on failure.
*/
int ceph_fallocate(struct ceph_mount_info *cmount, int fd, int mode,
- loff_t offset, loff_t length);
+ int64_t offset, int64_t length);
/**
* Get the open file's statistics.
* @returns the size of the addressed filled into the @ref addr parameter, or a negative
* error code on failure.
*/
-int ceph_get_file_stripe_address(struct ceph_mount_info *cmount, int fd, loff_t offset,
+int ceph_get_file_stripe_address(struct ceph_mount_info *cmount, int fd, int64_t offset,
struct sockaddr_storage *addr, int naddr);
/**
* array is not large enough.
*/
int ceph_get_file_extent_osds(struct ceph_mount_info *cmount, int fh,
- loff_t offset, loff_t *length, int *osds, int nosds);
+ int64_t offset, int64_t *length, int *osds, int nosds);
/**
* Get the fully qualified CRUSH location of an OSD.
int pool_create(const char *name);
int pool_create(const char *name, uint64_t auid);
- int pool_create(const char *name, uint64_t auid, __u8 crush_rule);
+ int pool_create(const char *name, uint64_t auid, uint8_t crush_rule);
int pool_create_async(const char *name, PoolAsyncCompletion *c);
int pool_create_async(const char *name, uint64_t auid, PoolAsyncCompletion *c);
- int pool_create_async(const char *name, uint64_t auid, __u8 crush_rule, PoolAsyncCompletion *c);
+ int pool_create_async(const char *name, uint64_t auid, uint8_t crush_rule, PoolAsyncCompletion *c);
int pool_delete(const char *name);
int pool_delete_async(const char *name, PoolAsyncCompletion *c);
int64_t pool_lookup(const char *name);
cmount->get_client()->rewinddir((dir_result_t*)dirp);
}
-extern "C" loff_t ceph_telldir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp)
+extern "C" int64_t ceph_telldir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->telldir((dir_result_t*)dirp);
}
-extern "C" void ceph_seekdir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, loff_t offset)
+extern "C" void ceph_seekdir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, int64_t offset)
{
if (!cmount->is_mounted())
return;
// symlinks
extern "C" int ceph_readlink(struct ceph_mount_info *cmount, const char *path,
- char *buf, loff_t size)
+ char *buf, int64_t size)
{
if (!cmount->is_mounted())
return -ENOTCONN;
}
extern "C" int ceph_truncate(struct ceph_mount_info *cmount, const char *path,
- loff_t size)
+ int64_t size)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->close(fd);
}
-extern "C" loff_t ceph_lseek(struct ceph_mount_info *cmount, int fd,
- loff_t offset, int whence)
+extern "C" int64_t ceph_lseek(struct ceph_mount_info *cmount, int fd,
+ int64_t offset, int whence)
{
if (!cmount->is_mounted())
return -ENOTCONN;
}
extern "C" int ceph_read(struct ceph_mount_info *cmount, int fd, char *buf,
- loff_t size, loff_t offset)
+ int64_t size, int64_t offset)
{
if (!cmount->is_mounted())
return -ENOTCONN;
}
extern "C" int ceph_write(struct ceph_mount_info *cmount, int fd, const char *buf,
- loff_t size, loff_t offset)
+ int64_t size, int64_t offset)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->write(fd, buf, size, offset);
}
-extern "C" int ceph_ftruncate(struct ceph_mount_info *cmount, int fd, loff_t size)
+extern "C" int ceph_ftruncate(struct ceph_mount_info *cmount, int fd, int64_t size)
{
if (!cmount->is_mounted())
return -ENOTCONN;
}
extern "C" int ceph_fallocate(struct ceph_mount_info *cmount, int fd, int mode,
- loff_t offset, loff_t length)
+ int64_t offset, int64_t length)
{
if (!cmount->is_mounted())
return -ENOTCONN;
}
extern "C" int ceph_get_file_extent_osds(struct ceph_mount_info *cmount, int fh,
- loff_t offset, loff_t *length, int *osds, int nosds)
+ int64_t offset, int64_t *length, int *osds, int nosds)
{
if (nosds < 0)
return -EINVAL;
}
extern "C" int ceph_get_file_stripe_address(struct ceph_mount_info *cmount, int fh,
- loff_t offset, struct sockaddr_storage *addr, int naddr)
+ int64_t offset, struct sockaddr_storage *addr, int naddr)
{
vector<entity_addr_t> address;
unsigned i;
int ret = ceph_get_file_extent_osds(cmount, fd, 0, NULL, NULL, 0);
EXPECT_GT(ret, 0);
- loff_t len;
+ int64_t len;
int osds[ret];
/* full stripe extent */
EXPECT_EQ(ret, ceph_get_file_extent_osds(cmount, fd, 0, &len, osds, ret));
- EXPECT_EQ(len, (loff_t)stripe_unit);
+ EXPECT_EQ(len, (int64_t)stripe_unit);
/* half stripe extent */
EXPECT_EQ(ret, ceph_get_file_extent_osds(cmount, fd, stripe_unit/2, &len, osds, ret));
- EXPECT_EQ(len, (loff_t)stripe_unit/2);
+ EXPECT_EQ(len, (int64_t)stripe_unit/2);
/* 1.5 stripe unit offset -1 byte */
EXPECT_EQ(ret, ceph_get_file_extent_osds(cmount, fd, 3*stripe_unit/2-1, &len, osds, ret));
- EXPECT_EQ(len, (loff_t)stripe_unit/2+1);
+ EXPECT_EQ(len, (int64_t)stripe_unit/2+1);
/* 1.5 stripe unit offset +1 byte */
EXPECT_EQ(ret, ceph_get_file_extent_osds(cmount, fd, 3*stripe_unit/2+1, &len, osds, ret));
- EXPECT_EQ(len, (loff_t)stripe_unit/2-1);
+ EXPECT_EQ(len, (int64_t)stripe_unit/2-1);
/* only when more than 1 osd */
if (ret > 1)