aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-09-08 14:28:54 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2005-09-08 14:28:54 +0000
commitfcf9f8d616b86886bfbbff6e0940a2fe74ac8ad5 (patch)
treee2e9cc59b315facedb1046672293fce4eb39c7a4 /lib
parent079db8dcbd74307a163817cebffced1cb4d7b407 (diff)
downloadlibfuse-fcf9f8d616b86886bfbbff6e0940a2fe74ac8ad5.tar.gz
revert stuff
Diffstat (limited to 'lib')
-rw-r--r--lib/fuse.c86
-rw-r--r--lib/fuse_lowlevel.c118
2 files changed, 0 insertions, 204 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index 7f8ed3d..2209212 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -727,25 +727,6 @@ static void fuse_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
reply_err(req, err);
}
-static void fuse_access(fuse_req_t req, fuse_ino_t ino, int mask)
-{
- struct fuse *f = req_fuse_prepare(req);
- char *path;
- int err;
-
- err = -ENOENT;
- pthread_rwlock_rdlock(&f->tree_lock);
- path = get_path(f, ino);
- if (path != NULL) {
- err = -ENOSYS;
- if (f->op.access)
- err = f->op.access(path, mask);
- free(path);
- }
- pthread_rwlock_unlock(&f->tree_lock);
- reply_err(req, err);
-}
-
static void fuse_readlink(fuse_req_t req, fuse_ino_t ino)
{
struct fuse *f = req_fuse_prepare(req);
@@ -981,71 +962,6 @@ static void fuse_link(fuse_req_t req, fuse_ino_t ino, fuse_ino_t newparent,
reply_entry(req, &e, err);
}
-static void fuse_create(fuse_req_t req, fuse_ino_t parent, const char *name,
- mode_t mode, struct fuse_file_info *fi)
-{
- struct fuse *f = req_fuse_prepare(req);
- struct fuse_entry_param e;
- char *path;
- int opened = 0;
- int err;
-
- err = -ENOENT;
- pthread_rwlock_rdlock(&f->tree_lock);
- path = get_path_name(f, parent, name);
- if (path != NULL) {
- err = -ENOSYS;
- if (f->op.create && f->op.getattr) {
- int oerr = f->op.create(path, mode, fi);
- if (!oerr)
- opened = 1;
-
- if (f->flags & FUSE_DEBUG) {
- if (opened)
- printf("CREATE[%lu] flags: 0x%x %s\n", fi->fh, fi->flags, path);
- else
- printf("LOOKUP(CREATE) %s\n", path);
- fflush(stdout);
- }
-
- err = lookup_path(f, parent, name, path, &e);
- if (err) {
- if (f->op.release && opened)
- f->op.release(path, fi);
- } else if (opened != (S_ISREG(e.attr.st_mode) != 0)) {
- err = oerr ? oerr : -EIO;
- if (f->op.release && opened)
- f->op.release(path, fi);
- forget_node(f, e.ino, 1);
- }
- }
- }
-
- if (!err) {
- if (f->flags & FUSE_DIRECT_IO)
- fi->direct_io = 1;
- if (f->flags & FUSE_KERNEL_CACHE)
- fi->keep_cache = 1;
-
- pthread_mutex_lock(&f->lock);
- if (fuse_reply_create(req, &e, fi) == -ENOENT) {
- /* The open syscall was interrupted, so it must be cancelled */
- if(f->op.release && opened)
- f->op.release(path, fi);
- forget_node(f, e.ino, 1);
- } else {
- struct node *node = get_node(f, e.ino);
- node->open_count ++;
- }
- pthread_mutex_unlock(&f->lock);
- } else
- reply_err(req, err);
-
- if (path)
- free(path);
- pthread_rwlock_unlock(&f->tree_lock);
-}
-
static void fuse_open(fuse_req_t req, fuse_ino_t ino,
struct fuse_file_info *fi)
{
@@ -1680,7 +1596,6 @@ static struct fuse_lowlevel_ops fuse_path_ops = {
.forget = fuse_forget,
.getattr = fuse_getattr,
.setattr = fuse_setattr,
- .access = fuse_access,
.readlink = fuse_readlink,
.mknod = fuse_mknod,
.mkdir = fuse_mkdir,
@@ -1689,7 +1604,6 @@ static struct fuse_lowlevel_ops fuse_path_ops = {
.symlink = fuse_symlink,
.rename = fuse_rename,
.link = fuse_link,
- .create = fuse_create,
.open = fuse_open,
.read = fuse_read,
.write = fuse_write,
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index 3bbc296..a5a5eb6 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -69,12 +69,6 @@ static const char *opname(enum fuse_opcode opcode)
case FUSE_READDIR: return "READDIR";
case FUSE_RELEASEDIR: return "RELEASEDIR";
case FUSE_FSYNCDIR: return "FSYNCDIR";
- case FUSE_GETLK: return "GETLK";
- case FUSE_SETLK: return "SETLK";
- case FUSE_SETLKW: return "SETLKW";
- case FUSE_ACCESS: return "ACCESS";
- case FUSE_CREATE: return "CREATE";
- case FUSE_FSETATTR: return "FSETATTR";
default: return "???";
}
}
@@ -115,26 +109,6 @@ static void convert_attr(const struct fuse_attr *attr, struct stat *stbuf)
#endif
}
-static void convert_file_lock(const struct fuse_file_lock *ffl,
- struct fuse_lock_param *lk)
-{
- lk->type = ffl->type;
- lk->start = ffl->start;
- lk->end = ffl->end;
- lk->owner = ffl->owner;
- lk->pid = ffl->pid;
-}
-
-static void convert_lock_param(const struct fuse_lock_param *lk,
- struct fuse_file_lock *ffl)
-{
- ffl->type = lk->type;
- ffl->start = lk->start;
- ffl->end = lk->end;
- ffl->owner = lk->owner;
- ffl->pid = lk->pid;
-}
-
static size_t iov_length(const struct iovec *iov, size_t count)
{
size_t seg;
@@ -367,16 +341,6 @@ int fuse_reply_xattr(fuse_req_t req, size_t count)
return send_reply_ok(req, &arg, sizeof(arg));
}
-int fuse_reply_getlk(fuse_req_t req, const struct fuse_lock_param *lk)
-{
- struct fuse_lk_in_out arg;
-
- memset(&arg, 0, sizeof(arg));
- convert_lock_param(lk, &arg.lk);
-
- return send_reply_ok(req, &arg, sizeof(arg));
-}
-
static void do_lookup(fuse_req_t req, fuse_ino_t nodeid, char *name)
{
if (req->f->op.lookup)
@@ -412,24 +376,6 @@ static void do_setattr(fuse_req_t req, fuse_ino_t nodeid,
fuse_reply_err(req, ENOSYS);
}
-static void do_fsetattr(fuse_req_t req, fuse_ino_t nodeid,
- struct fuse_fsetattr_in *arg)
-{
- struct fuse_file_info fi;
-
- memset(&fi, 0, sizeof(fi));
- fi.fh = arg->fh;
- do_setattr(req, nodeid, &arg->setattr, &fi);
-}
-
-static void do_access(fuse_req_t req, fuse_ino_t nodeid,
- struct fuse_access_in *arg)
-{
- if (req->f->op.access)
- req->f->op.access(req, nodeid, arg->mask);
- else
- fuse_reply_err(req, ENOSYS);
-}
static void do_readlink(fuse_req_t req, fuse_ino_t nodeid)
{
if (req->f->op.readlink)
@@ -502,20 +448,6 @@ static void do_link(fuse_req_t req, fuse_ino_t nodeid,
fuse_reply_err(req, ENOSYS);
}
-static void do_create(fuse_req_t req, fuse_ino_t nodeid,
- struct fuse_open_in *arg)
-{
- if (req->f->op.create) {
- struct fuse_file_info fi;
-
- memset(&fi, 0, sizeof(fi));
- fi.flags = arg->flags;
-
- req->f->op.create(req, nodeid, PARAM(arg), arg->mode, &fi);
- } else
- fuse_reply_err(req, ENOSYS);
-}
-
static void do_open(fuse_req_t req, fuse_ino_t nodeid,
struct fuse_open_in *arg)
{
@@ -706,32 +638,6 @@ static void do_removexattr(fuse_req_t req, fuse_ino_t nodeid, char *name)
fuse_reply_err(req, ENOSYS);
}
-static void do_getlk(fuse_req_t req, fuse_ino_t nodeid,
- struct fuse_lk_in_out *arg)
-{
- if (req->f->op.getlk) {
- struct fuse_lock_param lk;
-
- memset(&lk, 0, sizeof(lk));
- convert_file_lock(&arg->lk, &lk);
- req->f->op.getlk(req, nodeid, &lk);
- } else
- fuse_reply_err(req, ENOSYS);
-}
-
-static void do_setlk(fuse_req_t req, fuse_ino_t nodeid, int issleep,
- struct fuse_lk_in_out *arg)
-{
- if (req->f->op.setlk) {
- struct fuse_lock_param lk;
-
- memset(&lk, 0, sizeof(lk));
- convert_file_lock(&arg->lk, &lk);
- req->f->op.setlk(req, nodeid, issleep, &lk);
- } else
- fuse_reply_err(req, ENOSYS);
-}
-
static void do_init(fuse_req_t req, struct fuse_init_in_out *arg)
{
struct fuse_init_in_out outarg;
@@ -827,10 +733,6 @@ static void fuse_ll_process(void *data, const char *buf, size_t len,
do_setattr(req, in->nodeid, (struct fuse_setattr_in *) inarg, NULL);
break;
- case FUSE_FSETATTR:
- do_fsetattr(req, in->nodeid, (struct fuse_fsetattr_in *) inarg);
- break;
-
case FUSE_READLINK:
do_readlink(req, in->nodeid);
break;
@@ -924,26 +826,6 @@ static void fuse_ll_process(void *data, const char *buf, size_t len,
do_fsyncdir(req, in->nodeid, (struct fuse_fsync_in *) inarg);
break;
- case FUSE_GETLK:
- do_getlk(req, in->nodeid, (struct fuse_lk_in_out *) inarg);
- break;
-
- case FUSE_SETLK:
- do_setlk(req, in->nodeid, 0, (struct fuse_lk_in_out *) inarg);
- break;
-
- case FUSE_SETLKW:
- do_setlk(req, in->nodeid, 1, (struct fuse_lk_in_out *) inarg);
- break;
-
- case FUSE_ACCESS:
- do_access(req, in->nodeid, (struct fuse_access_in *) inarg);
- break;
-
- case FUSE_CREATE:
- do_create(req, in->nodeid, (struct fuse_open_in *) inarg);
- break;
-
default:
fuse_reply_err(req, ENOSYS);
}