* Added missing symbols to versionscript (Joshua J. Berry)
+ * Do not limit number of file locks being waited upon
+
2005-07-28 Miklos Szeredi <miklos@szeredi.hu>
* kernel: invalidate attributes for read/readdir/readlink
else
fuse_request_free(req);
- /* If we are in debt decrease that first */
- if (fc->outstanding_debt)
- fc->outstanding_debt--;
- else
- up(&fc->outstanding_sem);
+ if (!req->unaccounted) {
+ /* If we are in debt decrease that first */
+ if (fc->outstanding_debt)
+ fc->outstanding_debt--;
+ else
+ up(&fc->outstanding_sem);
+ }
spin_unlock(&fuse_lock);
}
req->in.h.unique = fc->reqctr;
req->in.h.len = sizeof(struct fuse_in_header) +
len_args(req->in.numargs, (struct fuse_arg *) req->in.args);
- if (!req->preallocated) {
+ if (!req->preallocated && !req->unaccounted) {
/* If request is not preallocated (either FORGET or
- RELEASE), then still decrease outstanding_sem, so
+ RELEASE), and is not unaccounted (SETLKW),
+ then still decrease outstanding_sem, so
user can't open infinite number of files while not
processing the RELEASE requests. However for
efficiency do it without blocking, so if down()
struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_req *req;
struct fuse_lk_in_out arg;
+ int sleep = fl->fl_flags & FL_SLEEP;
int err;
if (fc->no_lk)
return posix_lock_file_wait(file, fl);
- req = fuse_get_request(fc);
- if (!req)
- return -EINTR;
+ if (!sleep) {
+ req = fuse_get_request(fc);
+ if (!req)
+ return -EINTR;
+ } else {
+ /* SETLKW can wait indefinately so we do not use up a
+ request from the pool, but allocate an unaccounted
+ new one */
+ req = fuse_request_alloc();
+ if (!req)
+ return -ENOMEM;
+ req->unaccounted = 1;
+ }
memset(&arg, 0, sizeof(arg));
convert_file_lock(fl, &arg.lk);
- req->in.h.opcode = (fl->fl_flags & FL_SLEEP) ? FUSE_SETLKW : FUSE_SETLK;
+ req->in.h.opcode = sleep ? FUSE_SETLKW : FUSE_SETLK;
req->in.h.nodeid = get_node_id(inode);
req->inode = inode;
req->in.numargs = 1;
/** The request is preallocated */
unsigned preallocated:1;
+ /** The request is not accounted via outstanding_{sem,debt} */
+ unsigned unaccounted:1;
+
/** The request was interrupted */
unsigned interrupted:1;
/** Is removexattr not implemented by fs? */
unsigned no_removexattr : 1;
+ /** Are file locking primitives implemented by fs? */
unsigned no_lk : 1;
#ifdef KERNEL_2_6
fuse_ll_destroy;
fuse_ll_is_lib_option;
fuse_ll_loop;
+ fuse_ll_loop_mnt;
fuse_ll_exited;
fuse_ll_read_cmd;
fuse_ll_process_cmd;
fuse_reply_buf;
fuse_reply_statfs;
fuse_reply_xattr;
+ fuse_req_ctx;
fuse_set_getcontext_func;
fuse_setup;
fuse_setup_compat2;