Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18655
b: refs/heads/master
c: 0cd5b88
h: refs/heads/master
i:
  18653: a367217
  18651: b1fce27
  18647: 00cd8fe
  18639: cb4b3b4
  18623: 45c7aa2
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Jan 17, 2006
1 parent d6684a3 commit 86efbff
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f543f253f3aa721a24557d7df8259145bb01b734
refs/heads/master: 0cd5b88553acf0611474dbaf8e43770eed268060
12 changes: 9 additions & 3 deletions trunk/fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,24 @@ struct fuse_req *fuse_get_request(struct fuse_conn *fc)
int intr;
sigset_t oldset;

atomic_inc(&fc->num_waiting);
block_sigs(&oldset);
intr = down_interruptible(&fc->outstanding_sem);
restore_sigs(&oldset);
return intr ? NULL : do_get_request(fc);
if (intr) {
atomic_dec(&fc->num_waiting);
return NULL;
}
return do_get_request(fc);
}

static void fuse_putback_request(struct fuse_conn *fc, struct fuse_req *req)
{
spin_lock(&fuse_lock);
if (req->preallocated)
if (req->preallocated) {
atomic_dec(&fc->num_waiting);
list_add(&req->list, &fc->unused_list);
else
} else
fuse_request_free(req);

/* If we are in debt decrease that first */
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/fuse/fuse_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ struct fuse_conn {
/** Is create not implemented by fs? */
unsigned no_create : 1;

/** The number of requests waiting for completion */
atomic_t num_waiting;

/** Negotiated minor version */
unsigned minor;

Expand Down
9 changes: 9 additions & 0 deletions trunk/fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,16 @@ static struct file_system_type fuse_fs_type = {
.kill_sb = kill_anon_super,
};

static ssize_t fuse_conn_waiting_show(struct fuse_conn *fc, char *page)
{
return sprintf(page, "%i\n", atomic_read(&fc->num_waiting));
}

static struct fuse_conn_attr fuse_conn_waiting =
__ATTR(waiting, 0400, fuse_conn_waiting_show, NULL);

static struct attribute *fuse_conn_attrs[] = {
&fuse_conn_waiting.attr,
NULL,
};

Expand Down

0 comments on commit 86efbff

Please sign in to comment.