const char *name, mode_t mode, struct stat *st,
struct rgw_file_handle **fh)
{
- return EINVAL;
+ return -EINVAL;
}
/*
RGWFileHandle* parent = get_rgwfh(parent_fh);
if (! parent) {
/* bad parent */
- return EINVAL;
+ return -EINVAL;
}
if (! parent->is_root()) {
/* cannot create a bucket in a bucket */
- return ENOTDIR;
+ return -ENOTDIR;
}
// XXXX fix this
if ((! parent) ||
(parent->is_object())) {
/* bad parent */
- return EINVAL;
+ return -EINVAL;
}
RGWFileHandle* rgw_fh;
/* name lookup in root--for now) just get a handle */
rgw_fh = fs->lookup_fh(parent, path);
if (! rgw_fh)
- return ENOENT;
+ return -ENOENT;
}
} else {
std::string object_name{path};
if (((rc != 0) ||
(req.get_ret() != 0)) &&
(! (flags & RGW_LOOKUP_FLAG_CREATE)))
- return ENOENT;
+ return -ENOENT;
rgw_fh = fs->lookup_fh(parent, path);
if (! rgw_fh)
- return ENOENT;
+ return -ENOENT;
} /* !root */
struct rgw_file_handle *rfh = rgw_fh->get_fh();
RGWFileHandle* rgw_fh = fs->lookup_handle(*fh_hk);
if (! rgw_fh) {
/* not found */
- return ENOENT;
+ return -ENOENT;
}
struct rgw_file_handle *rfh = rgw_fh->get_fh();
{
CephContext* cct = static_cast<CephContext*>(rgw_fs->rgw);
RGWLibFS *fs = static_cast<RGWLibFS*>(rgw_fs->fs_private);
+
+ if (!fh)
+ return -ENOENT;
+
RGWFileHandle* rgw_fh = get_rgwfh(fh);
if (rgw_fh->is_root()) {
int rc = librgw.get_fe()->execute_req(&req);
if ((rc != 0) ||
(req.get_ret() != 0))
- return EINVAL;
+ return -EINVAL;
/* fill in stat data */
memset(st, 0, sizeof(struct stat));
RGWFileHandle* parent = get_rgwfh(parent_fh);
if (! parent) {
/* bad parent */
- return EINVAL;
+ return -EINVAL;
}
if (parent->is_root()) {
RGWFileHandle* rgw_fh = get_rgwfh(fh);
if (! rgw_fh->is_object())
- return EINVAL;
+ return -EINVAL;
size_t nread = 0;
RGWFileHandle* rgw_fh = get_rgwfh(fh);
if (! rgw_fh->is_object())
- return EINVAL;
+ return -EINVAL;
/* XXXX testing only */
buffer::list bl;
RGWFileHandle* rgw_fh = get_rgwfh(fh);
if (! rgw_fh->is_object())
- return EINVAL;
+ return -EINVAL;
dout(15) << "test dout" << dendl;
RGWFileHandle* rgw_fh = get_rgwfh(fh);
if (! rgw_fh->is_object())
- return EINVAL;
+ return -EINVAL;
buffer::list bl;
for (unsigned int ix = 0; ix < uio->uio_cnt; ++ix) {