Skip to content

Commit

Permalink
fuse: fix lock annotations
Browse files Browse the repository at this point in the history
Sparse doesn't understand lock annotations of the form
__releases(&foo->lock).  Change them to __releases(foo->lock).  Same
for __acquires().

Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
Miklos Szeredi committed Sep 7, 2010
1 parent 595afaf commit b9ca67b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
26 changes: 14 additions & 12 deletions fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static void flush_bg_queue(struct fuse_conn *fc)
* Called with fc->lock, unlocks it
*/
static void request_end(struct fuse_conn *fc, struct fuse_req *req)
__releases(&fc->lock)
__releases(fc->lock)
{
void (*end) (struct fuse_conn *, struct fuse_req *) = req->end;
req->end = NULL;
Expand Down Expand Up @@ -306,8 +306,8 @@ __releases(&fc->lock)

static void wait_answer_interruptible(struct fuse_conn *fc,
struct fuse_req *req)
__releases(&fc->lock)
__acquires(&fc->lock)
__releases(fc->lock)
__acquires(fc->lock)
{
if (signal_pending(current))
return;
Expand All @@ -325,8 +325,8 @@ static void queue_interrupt(struct fuse_conn *fc, struct fuse_req *req)
}

static void request_wait_answer(struct fuse_conn *fc, struct fuse_req *req)
__releases(&fc->lock)
__acquires(&fc->lock)
__releases(fc->lock)
__acquires(fc->lock)
{
if (!fc->no_interrupt) {
/* Any signal may interrupt this */
Expand Down Expand Up @@ -905,8 +905,8 @@ static int request_pending(struct fuse_conn *fc)

/* Wait until a request is available on the pending list */
static void request_wait(struct fuse_conn *fc)
__releases(&fc->lock)
__acquires(&fc->lock)
__releases(fc->lock)
__acquires(fc->lock)
{
DECLARE_WAITQUEUE(wait, current);

Expand Down Expand Up @@ -934,7 +934,7 @@ __acquires(&fc->lock)
*/
static int fuse_read_interrupt(struct fuse_conn *fc, struct fuse_copy_state *cs,
size_t nbytes, struct fuse_req *req)
__releases(&fc->lock)
__releases(fc->lock)
{
struct fuse_in_header ih;
struct fuse_interrupt_in arg;
Expand Down Expand Up @@ -1720,8 +1720,8 @@ static unsigned fuse_dev_poll(struct file *file, poll_table *wait)
* This function releases and reacquires fc->lock
*/
static void end_requests(struct fuse_conn *fc, struct list_head *head)
__releases(&fc->lock)
__acquires(&fc->lock)
__releases(fc->lock)
__acquires(fc->lock)
{
while (!list_empty(head)) {
struct fuse_req *req;
Expand All @@ -1744,8 +1744,8 @@ __acquires(&fc->lock)
* locked).
*/
static void end_io_requests(struct fuse_conn *fc)
__releases(&fc->lock)
__acquires(&fc->lock)
__releases(fc->lock)
__acquires(fc->lock)
{
while (!list_empty(&fc->io)) {
struct fuse_req *req =
Expand All @@ -1770,6 +1770,8 @@ __acquires(&fc->lock)
}

static void end_queued_requests(struct fuse_conn *fc)
__releases(fc->lock)
__acquires(fc->lock)
{
fc->max_background = UINT_MAX;
flush_bg_queue(fc);
Expand Down
8 changes: 4 additions & 4 deletions fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,8 @@ static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)

/* Called under fc->lock, may release and reacquire it */
static void fuse_send_writepage(struct fuse_conn *fc, struct fuse_req *req)
__releases(&fc->lock)
__acquires(&fc->lock)
__releases(fc->lock)
__acquires(fc->lock)
{
struct fuse_inode *fi = get_fuse_inode(req->inode);
loff_t size = i_size_read(req->inode);
Expand Down Expand Up @@ -1183,8 +1183,8 @@ __acquires(&fc->lock)
* Called with fc->lock
*/
void fuse_flush_writepages(struct inode *inode)
__releases(&fc->lock)
__acquires(&fc->lock)
__releases(fc->lock)
__acquires(fc->lock)
{
struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_inode *fi = get_fuse_inode(inode);
Expand Down

0 comments on commit b9ca67b

Please sign in to comment.