]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fscache: use appropriate radix tree accessors
authorMatthew Wilcox <mawilcox@microsoft.com>
Tue, 10 Apr 2018 23:36:48 +0000 (16:36 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Apr 2018 17:28:39 +0000 (10:28 -0700)
Don't open-code accesses to data structure internals.

Link: http://lkml.kernel.org/r/20180313132639.17387-7-willy@infradead.org
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/fscache/cookie.c
fs/fscache/object.c

index 7dc55b93a8304e8305c16a35ab48961083d28dd5..97137d7ec5ee8bfe21796abde94144d726785d29 100644 (file)
@@ -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);
index 1085ca12e25c761d8b09d86b73e30b59d0e3eff7..20e0d0a4dc8cba917ef354e93f1aafe8bfee46a8 100644 (file)
@@ -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);