datapath: Don't check for RCU in free_buckets in table.
authorJesse Gross <jesse@nicira.com>
Wed, 29 Dec 2010 23:05:02 +0000 (15:05 -0800)
committerJesse Gross <jesse@nicira.com>
Thu, 30 Dec 2010 17:35:40 +0000 (09:35 -0800)
free_buckets() is only called in places where the lifetime of its
container has ended: on allocation failure and on deletion after
a grace period.  If the container can no longer be referenced then
neither can the buckets, so it is safe to directly free them.
sparse complains if the pointer is directly dereferenced and lockdep
complains if the RCU functions are used without some type of lock,
both of which are fine in this case.  This adds an explicit cast to
avoid the complaints.

Found with lockdep.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/table.c

index 5c1b82a..b54534a 100644 (file)
@@ -51,7 +51,7 @@ static void free_buckets(struct tbl_bucket __rcu ***l1,
                unsigned int j;
 
                for (j = 0; j < TBL_L2_SIZE; j++) {
-                       struct tbl_bucket *bucket = rcu_dereference(l2[j]);
+                       struct tbl_bucket *bucket = (struct tbl_bucket __force *)l2[j];
                        if (!bucket)
                                continue;