Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10073
b: refs/heads/master
c: 8d3b359
h: refs/heads/master
i:
  10071: 0e76070
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Oct 23, 2005
1 parent 2bb0476 commit 301551a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0fef676bbd75e711711ed3ff5bebb7bfd1bdb00
refs/heads/master: 8d3b35914aa54232b27e6a2b57d84092aadc5e86
1 change: 1 addition & 0 deletions trunk/fs/inotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ static inline void put_inotify_dev(struct inotify_device *dev)
if (atomic_dec_and_test(&dev->count)) {
atomic_dec(&dev->user->inotify_devs);
free_uid(dev->user);
idr_destroy(&dev->idr);
kfree(dev);
}
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/idr.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ int idr_pre_get(struct idr *idp, unsigned gfp_mask);
int idr_get_new(struct idr *idp, void *ptr, int *id);
int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
void idr_remove(struct idr *idp, int id);
void idr_destroy(struct idr *idp);
void idr_init(struct idr *idp);
13 changes: 13 additions & 0 deletions trunk/lib/idr.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,19 @@ void idr_remove(struct idr *idp, int id)
}
EXPORT_SYMBOL(idr_remove);

/**
* idr_destroy - release all cached layers within an idr tree
* idp: idr handle
*/
void idr_destroy(struct idr *idp)
{
while (idp->id_free_cnt) {
struct idr_layer *p = alloc_layer(idp);
kmem_cache_free(idr_layer_cache, p);
}
}
EXPORT_SYMBOL(idr_destroy);

/**
* idr_find - return pointer for given id
* @idp: idr handle
Expand Down

0 comments on commit 301551a

Please sign in to comment.