struct list_head *tmp = next;
struct dentry *dentry = list_entry(tmp, struct dentry, d_child);
next = tmp->next;
- if (!atomic_read(&dentry->d_count)) {
+ if (!DCOUNT(dentry)) {
list_del(&dentry->d_lru);
list_add(&dentry->d_lru, afs_dentry_unused.prev);
found++;
if (tmp == &afs_dentry_unused)
break;
+#ifdef AFS_LINUX24_ENV
list_del_init(tmp);
+#else
+ list_del(tmp);
+ INIT_LIST_HEAD(tmp);
+#endif /* AFS_LINUX24_ENV */
dentry = list_entry(tmp, struct dentry, d_lru);
+#ifdef AFS_LINUX24_ENV
/* Unused dentry with a count? */
- if (atomic_read(&dentry->d_count))
+ if (DCOUNT(dentry))
BUG();
-
+#endif
DGET(dentry);
+#ifdef AFS_LINUX24_ENV
list_del_init(&dentry->d_hash); /* d_drop */
+#else
+ list_del(&dentry->d_hash);
+ INIT_LIST_HEAD(&dentry->d_hash);
+#endif /* AFS_LINUX24_ENV */
DUNLOCK();
dput(dentry);
DLOCK();
if (!list_empty(&dentry->d_hash) && !list_empty(&dentry->d_subdirs))
__shrink_dcache_parent(dentry);
- if (!atomic_read(&dentry->d_count)) {
+ if (!DCOUNT(dentry)) {
DGET(dentry);
+#ifdef AFS_LINUX24_ENV
list_del_init(&dentry->d_hash); /* d_drop */
+#else
+ list_del(&dentry->d_hash);
+ INIT_LIST_HEAD(&dentry->d_hash);
+#endif /* AFS_LINUX24_ENV */
DUNLOCK();
dput(dentry);
goto restart;