/****** file i/o **********/
// common parts for open and openat. call with client_lock locked.
-int Client::create_and_open(std::optional<int> dirfd, const char *relpath, int flags,
+int Client::create_and_open(int dirfd, const char *relpath, int flags,
const UserPerm& perms, mode_t mode, int stripe_unit,
int stripe_count, int object_size, const char *data_pool,
std::string alternate_name) {
int mask = ceph_caps_for_mode(ceph_flags_to_mode(cflags));
InodeRef dirinode = nullptr;
- if (dirfd) {
- int r = get_fd_inode(*dirfd, &dirinode);
- if (r < 0) {
- return r;
- }
+ int r = get_fd_inode(dirfd, &dirinode);
+ if (r < 0) {
+ return r;
}
- int r = path_walk(path, &in, perms, followsym, mask, dirinode);
+ r = path_walk(path, &in, perms, followsym, mask, dirinode);
if (r == 0 && (flags & O_CREAT) && (flags & O_EXCL))
return -CEPHFS_EEXIST;
// file ops
int mknod(const char *path, mode_t mode, const UserPerm& perms, dev_t rdev=0);
- int create_and_open(std::optional<int> dirfd, const char *relpath, int flags, const UserPerm& perms,
- mode_t mode, int stripe_unit, int stripe_count, int object_size, const char *data_pool,
- std::string alternate_name);
+ int create_and_open(int dirfd, const char *relpath, int flags, const UserPerm& perms,
+ mode_t mode, int stripe_unit, int stripe_count, int object_size,
+ const char *data_pool, std::string alternate_name);
int open(const char *path, int flags, const UserPerm& perms, mode_t mode=0, std::string alternate_name="") {
return open(path, flags, perms, mode, 0, 0, 0, NULL, alternate_name);
}