.. | .. |
---|
424 | 424 | return hash_long(from_kuid(&init_user_ns, uid), GID_HASHBITS); |
---|
425 | 425 | } |
---|
426 | 426 | |
---|
| 427 | +static void unix_gid_free(struct rcu_head *rcu) |
---|
| 428 | +{ |
---|
| 429 | + struct unix_gid *ug = container_of(rcu, struct unix_gid, rcu); |
---|
| 430 | + struct cache_head *item = &ug->h; |
---|
| 431 | + |
---|
| 432 | + if (test_bit(CACHE_VALID, &item->flags) && |
---|
| 433 | + !test_bit(CACHE_NEGATIVE, &item->flags)) |
---|
| 434 | + put_group_info(ug->gi); |
---|
| 435 | + kfree(ug); |
---|
| 436 | +} |
---|
| 437 | + |
---|
427 | 438 | static void unix_gid_put(struct kref *kref) |
---|
428 | 439 | { |
---|
429 | 440 | struct cache_head *item = container_of(kref, struct cache_head, ref); |
---|
430 | 441 | struct unix_gid *ug = container_of(item, struct unix_gid, h); |
---|
431 | | - if (test_bit(CACHE_VALID, &item->flags) && |
---|
432 | | - !test_bit(CACHE_NEGATIVE, &item->flags)) |
---|
433 | | - put_group_info(ug->gi); |
---|
434 | | - kfree_rcu(ug, rcu); |
---|
| 442 | + |
---|
| 443 | + call_rcu(&ug->rcu, unix_gid_free); |
---|
435 | 444 | } |
---|
436 | 445 | |
---|
437 | 446 | static int unix_gid_match(struct cache_head *corig, struct cache_head *cnew) |
---|