struct ceph_mds_client *mdsc = &client->mdsc;
struct ceph_mds_request *req;
int want_auth = USE_ANY_MDS;
+ int op = (flags & O_CREAT) ? CEPH_MDS_OP_CREATE : CEPH_MDS_OP_OPEN;
if (flags & (O_WRONLY|O_RDWR|O_CREAT|O_TRUNC))
want_auth = USE_AUTH_MDS;
- dout(5, "prepare_open_request flags %d\n", flags);
- if (flags & O_CREAT)
- req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_OPEN, want_auth);
- else
- req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_CREATE, want_auth);
+ req = ceph_mdsc_create_request(mdsc, op, want_auth);
if (IS_ERR(req))
goto out;
req->r_fmode = ceph_flags_to_mode(flags);
*freepath = build_dentry_path(rdentry, ppath,
pathlen, ino);
dout(10, "create_request_message dentry %p %llx/%.*s\n",
- rdentry, rino, *pathlen, *ppath);
+ rdentry, *ino, *pathlen, *ppath);
} else if (rpath) {
*ino = rino;
*ppath = rpath;