Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347836
b: refs/heads/master
c: 1f372df
h: refs/heads/master
v: v3
  • Loading branch information
David Howells committed Dec 20, 2012
1 parent fad10d9 commit 0006687
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 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: 7ef001e937e8b9cbedb2fc1c31dd681ac3b31927
refs/heads/master: 1f372dff1da37e2b36ae9085368fa46896398598
2 changes: 1 addition & 1 deletion trunk/fs/cachefiles/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ static void cachefiles_invalidate_object(struct fscache_operation *op)
}
}

fscache_op_complete(op);
fscache_op_complete(op, true);
_leave("");
}

Expand Down
7 changes: 4 additions & 3 deletions trunk/fs/fscache/operation.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ void fscache_cancel_all_ops(struct fscache_object *object)
}

/*
* Record the completion of an in-progress operation.
* Record the completion or cancellation of an in-progress operation.
*/
void fscache_op_complete(struct fscache_operation *op)
void fscache_op_complete(struct fscache_operation *op, bool cancelled)
{
struct fscache_object *object = op->object;

Expand All @@ -380,7 +380,8 @@ void fscache_op_complete(struct fscache_operation *op)

spin_lock(&object->lock);

op->state = FSCACHE_OP_ST_COMPLETE;
op->state = cancelled ?
FSCACHE_OP_ST_CANCELLED : FSCACHE_OP_ST_COMPLETE;

if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags))
object->n_exclusive--;
Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/fscache/page.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static void fscache_attr_changed_op(struct fscache_operation *op)
fscache_abort_object(object);
}

fscache_op_complete(op);
fscache_op_complete(op, true);
_leave("");
}

Expand Down Expand Up @@ -704,7 +704,7 @@ static void fscache_write_op(struct fscache_operation *_op)
* exists, so we should just cancel this write operation.
*/
spin_unlock(&object->lock);
op->op.state = FSCACHE_OP_ST_CANCELLED;
fscache_op_complete(&op->op, false);
_leave(" [inactive]");
return;
}
Expand All @@ -717,7 +717,7 @@ static void fscache_write_op(struct fscache_operation *_op)
* cancel this write operation.
*/
spin_unlock(&object->lock);
op->op.state = FSCACHE_OP_ST_CANCELLED;
fscache_op_complete(&op->op, false);
_leave(" [cancel] op{f=%lx s=%u} obj{s=%u f=%lx}",
_op->flags, _op->state, object->state, object->flags);
return;
Expand Down Expand Up @@ -755,7 +755,7 @@ static void fscache_write_op(struct fscache_operation *_op)
fscache_end_page_write(object, page);
if (ret < 0) {
fscache_abort_object(object);
fscache_op_complete(&op->op);
fscache_op_complete(&op->op, true);
} else {
fscache_enqueue_operation(&op->op);
}
Expand All @@ -770,7 +770,7 @@ static void fscache_write_op(struct fscache_operation *_op)
spin_unlock(&cookie->stores_lock);
clear_bit(FSCACHE_OBJECT_PENDING_WRITE, &object->flags);
spin_unlock(&object->lock);
fscache_op_complete(&op->op);
fscache_op_complete(&op->op, true);
_leave("");
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/fscache-cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extern atomic_t fscache_op_debug_id;
extern void fscache_op_work_func(struct work_struct *work);

extern void fscache_enqueue_operation(struct fscache_operation *);
extern void fscache_op_complete(struct fscache_operation *);
extern void fscache_op_complete(struct fscache_operation *, bool);
extern void fscache_put_operation(struct fscache_operation *);

/**
Expand Down Expand Up @@ -196,7 +196,7 @@ static inline void fscache_retrieval_complete(struct fscache_retrieval *op,
{
op->n_pages -= n_pages;
if (op->n_pages <= 0)
fscache_op_complete(&op->op);
fscache_op_complete(&op->op, true);
}

/**
Expand Down

0 comments on commit 0006687

Please sign in to comment.