// ------------
// read, write
-loff_t Client::lseek(int fd, loff_t offset, int whence, const UserPerm& perms)
+loff_t Client::lseek(int fd, loff_t offset, int whence)
{
Mutex::Locker lock(client_lock);
tout(cct) << "lseek" << std::endl;
if (f->flags & O_PATH)
return -EBADF;
#endif
- return _lseek(f, offset, whence, perms);
+ return _lseek(f, offset, whence);
}
-loff_t Client::_lseek(Fh *f, loff_t offset, int whence, const UserPerm& perms)
+loff_t Client::_lseek(Fh *f, loff_t offset, int whence)
{
Inode *in = f->inode.get();
int r;
- if (!may_open(f->inode.get(), f->flags, perms)) {
- return -EPERM;
- }
-
switch (whence) {
case SEEK_SET:
f->pos = offset;
break;
case SEEK_END:
- r = _getattr(in, CEPH_STAT_CAP_SIZE, perms);
+ r = _getattr(in, CEPH_STAT_CAP_SIZE, f->actor_perms);
if (r < 0)
return r;
f->pos = in->size + offset;
* change out from under us.
*/
if (f->flags & O_APPEND) {
- int r = _lseek(f, 0, SEEK_END, f->actor_perms);
+ int r = _lseek(f, 0, SEEK_END);
if (r < 0) {
unlock_fh_pos(f);
return r;
return r;
}
-loff_t Client::ll_lseek(Fh *fh, loff_t offset, int whence,
- const UserPerm& perms)
+loff_t Client::ll_lseek(Fh *fh, loff_t offset, int whence)
{
Mutex::Locker lock(client_lock);
tout(cct) << "ll_lseek" << std::endl;
tout(cct) << offset << std::endl;
tout(cct) << whence << std::endl;
- return _lseek(fh, offset, whence, perms);
+ return _lseek(fh, offset, whence);
}
int Client::ll_read(Fh *fh, loff_t off, loff_t len, bufferlist *bl)
const char *data_pool, bool *created, const UserPerm &perms);
loff_t _lseek(Fh *fh, loff_t offset, int whence);
- loff_t _lseek(Fh *fh, loff_t offset, int whence, const UserPerm& perms);
int _read(Fh *fh, int64_t offset, uint64_t size, bufferlist *bl);
int _write(Fh *fh, int64_t offset, uint64_t size, const char *buf,
const struct iovec *iov, int iovcnt);
int lookup_parent(Inode *in, const UserPerm& perms, Inode **parent=NULL);
int lookup_name(Inode *in, Inode *parent, const UserPerm& perms);
int close(int fd);
- loff_t lseek(int fd, loff_t offset, int whence, const UserPerm& perms);
+ loff_t lseek(int fd, loff_t offset, int whence);
int read(int fd, char *buf, loff_t size, loff_t offset=-1);
int preadv(int fd, const struct iovec *iov, int iovcnt, loff_t offset=-1);
int write(int fd, const char *buf, loff_t size, loff_t offset=-1);
int ll_read(Fh *fh, loff_t off, loff_t len, bufferlist *bl);
int ll_write(Fh *fh, loff_t off, loff_t len, const char *data);
- loff_t ll_lseek(Fh *fh, loff_t offset, int whence, const UserPerm& perms);
+ loff_t ll_lseek(Fh *fh, loff_t offset, int whence);
int ll_flush(Fh *fh);
int ll_fsync(Fh *fh, bool syncdataonly);
int ll_fallocate(Fh *fh, int mode, loff_t offset, loff_t length);
int fd = open_files[f];
int64_t off = t.get_int();
int64_t whence = t.get_int();
- client->lseek(fd, off, whence, perms);
+ client->lseek(fd, off, whence);
} else if (strcmp(op, "read") == 0) {
int64_t f = t.get_int();
int64_t size = t.get_int();
{
if (!cmount->is_mounted())
return -ENOTCONN;
- return cmount->get_client()->lseek(fd, offset, whence, cmount->default_perms);
+ return cmount->get_client()->lseek(fd, offset, whence);
}
extern "C" int ceph_read(struct ceph_mount_info *cmount, int fd, char *buf,
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, cmount->default_perms));
+ return (cmount->get_client()->ll_lseek(fh, offset, whence));
}
extern "C" int ceph_ll_write(class ceph_mount_info *cmount,