Skip to content

Commit

Permalink
fscache: use appropriate radix tree accessors
Browse files Browse the repository at this point in the history
Don't open-code accesses to data structure internals.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Cc: Darrick J. Wong <[email protected]>
Cc: Dave Chinner <[email protected]>
Cc: Ryusuke Konishi <[email protected]>
Cc: Will Deacon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Matthew Wilcox authored and torvalds committed Apr 11, 2018
1 parent f82b376 commit e5a9554
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/fscache/cookie.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie,
/* Clear pointers back to the netfs */
cookie->netfs_data = NULL;
cookie->def = NULL;
BUG_ON(cookie->stores.rnode);
BUG_ON(!radix_tree_empty(&cookie->stores));

if (cookie->parent) {
ASSERTCMP(atomic_read(&cookie->parent->usage), >, 0);
Expand Down
2 changes: 1 addition & 1 deletion fs/fscache/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ static const struct fscache_state *_fscache_invalidate_object(struct fscache_obj
* retire the object instead.
*/
if (!fscache_use_cookie(object)) {
ASSERT(object->cookie->stores.rnode == NULL);
ASSERT(radix_tree_empty(&object->cookie->stores));
set_bit(FSCACHE_OBJECT_RETIRED, &object->flags);
_leave(" [no cookie]");
return transit_to(KILL_OBJECT);
Expand Down

0 comments on commit e5a9554

Please sign in to comment.