forget->forget_one.nlookup = nlookup;
spin_lock(&fc->lock);
- if (fc->connected) {
+ if (fiq->connected) {
fiq->forget_list_tail->next = forget;
fiq->forget_list_tail = forget;
wake_up(&fiq->waitq);
static void __fuse_request_send(struct fuse_conn *fc, struct fuse_req *req)
{
+ struct fuse_iqueue *fiq = &fc->iq;
+
BUG_ON(test_bit(FR_BACKGROUND, &req->flags));
spin_lock(&fc->lock);
- if (!fc->connected) {
+ if (!fiq->connected) {
spin_unlock(&fc->lock);
req->out.h.error = -ENOTCONN;
} else {
- struct fuse_iqueue *fiq = &fc->iq;
-
req->in.h.unique = fuse_get_unique(fiq);
queue_request(fiq, req);
/* acquire extra reference, since request is still needed
__clear_bit(FR_ISREPLY, &req->flags);
req->in.h.unique = unique;
spin_lock(&fc->lock);
- if (fc->connected) {
+ if (fiq->connected) {
queue_request(fiq, req);
err = 0;
}
DECLARE_WAITQUEUE(wait, current);
add_wait_queue_exclusive(&fiq->waitq, &wait);
- while (fc->connected && !request_pending(fiq)) {
+ while (fiq->connected && !request_pending(fiq)) {
set_current_state(TASK_INTERRUPTIBLE);
if (signal_pending(current))
break;
restart:
spin_lock(&fc->lock);
err = -EAGAIN;
- if ((file->f_flags & O_NONBLOCK) && fc->connected &&
+ if ((file->f_flags & O_NONBLOCK) && fiq->connected &&
!request_pending(fiq))
goto err_unlock;
request_wait(fc);
err = -ENODEV;
- if (!fc->connected)
+ if (!fiq->connected)
goto err_unlock;
err = -ERESTARTSYS;
if (!request_pending(fiq))
poll_wait(file, &fiq->waitq, wait);
spin_lock(&fc->lock);
- if (!fc->connected)
+ if (!fiq->connected)
mask = POLLERR;
else if (request_pending(fiq))
mask |= POLLIN | POLLRDNORM;
LIST_HEAD(to_end2);
fc->connected = 0;
+ fiq->connected = 0;
fc->blocked = 0;
fuse_set_initialized(fc);
list_for_each_entry_safe(req, next, &fc->io, list) {
INIT_LIST_HEAD(&fiq->pending);
INIT_LIST_HEAD(&fiq->interrupts);
fiq->forget_list_tail = &fiq->forget_list_head;
+ fiq->connected = 1;
}
void fuse_conn_init(struct fuse_conn *fc)
fc->polled_files = RB_ROOT;
fc->blocked = 0;
fc->initialized = 0;
+ fc->connected = 1;
fc->attr_version = 1;
get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key));
}
list_add_tail(&fc->entry, &fuse_conn_list);
sb->s_root = root_dentry;
- fc->connected = 1;
file->private_data = fuse_conn_get(fc);
mutex_unlock(&fuse_mutex);
/*