[PATCH][2.5] introduce new list macros for hfs (5 occ)

From: Lightweight patch manager (patch@luckynet.dynu.com)
Date: Sun Jun 09 2002 - 09:04:05 EST


This uses the list_move* and list_del_init macros for hfs

--- linus-2.5/fs/hfs/catalog.c Sun Jun 9 04:16:00 2002
+++ thunder-2.5/fs/hfs/catalog.c Sun Jun 9 06:32:40 2002
@@ -158,8 +158,7 @@
 
 static inline void remove_hash(struct hfs_cat_entry *entry)
 {
- list_del(&entry->hash);
- INIT_LIST_HEAD(&entry->hash);
+ list_del_init(&entry->hash);
 }
 
 /*
@@ -210,10 +209,8 @@
                 entry->state |= HFS_DIRTY;
 
                 /* Only add valid (ie hashed) entries to the dirty list. */
- if (!list_empty(&entry->hash)) {
- list_del(&entry->list);
- list_add(&entry->list, &mdb->entry_dirty);
- }
+ if (!list_empty(&entry->hash))
+ list_move(&entry->list, &mdb->entry_dirty);
         }
         spin_unlock(&entry_lock);
 }
@@ -223,8 +220,7 @@
 {
         if (!(entry->state & HFS_DELETED)) {
                 entry->state |= HFS_DELETED;
- list_del(&entry->hash);
- INIT_LIST_HEAD(&entry->hash);
+ list_del_init(&entry->hash);
 
                 if (entry->type == HFS_CDR_FIL) {
                   /* free all extents */
@@ -882,8 +878,7 @@
                 }
 
                 if (!entry->count) {
- list_del(&entry->hash);
- INIT_LIST_HEAD(&entry->hash);
+ list_del_init(&entry->hash);
                         list_del(&entry->list);
                         list_add(&entry->list, dispose);
                         continue;
@@ -961,8 +956,7 @@
                                 insert = entry_in_use.prev;
 
                        /* add to in_use list */
- list_del(&entry->list);
- list_add(&entry->list, insert);
+ list_move(&entry->list, insert);
 
                        /* reset DIRTY, set LOCK */
                        entry->state ^= HFS_DIRTY | HFS_LOCK;

-- 
Lightweight patch manager using pine. If you have any objections, tell me.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 15 2002 - 22:00:14 EST