Merge branch 'locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[pandora-kernel.git] / fs / reiserfs / objectid.c
index 65feba4..3a6de81 100644 (file)
@@ -18,8 +18,7 @@
 static void check_objectid_map(struct super_block *s, __le32 * map)
 {
        if (le32_to_cpu(map[0]) != 1)
-               reiserfs_panic(s,
-                              "vs-15010: check_objectid_map: map corrupted: %lx",
+               reiserfs_panic(s, "vs-15010", "map corrupted: %lx",
                               (long unsigned int)le32_to_cpu(map[0]));
 
        // FIXME: add something else here
@@ -61,7 +60,7 @@ __u32 reiserfs_get_unused_objectid(struct reiserfs_transaction_handle *th)
        /* comment needed -Hans */
        unused_objectid = le32_to_cpu(map[1]);
        if (unused_objectid == U32_MAX) {
-               reiserfs_warning(s, "%s: no more object ids", __FUNCTION__);
+               reiserfs_warning(s, "reiserfs-15100", "no more object ids");
                reiserfs_restore_prepared_buffer(s, SB_BUFFER_WITH_SB(s));
                return 0;
        }
@@ -114,7 +113,7 @@ void reiserfs_release_objectid(struct reiserfs_transaction_handle *th,
                if (objectid_to_release == le32_to_cpu(map[i])) {
                        /* This incrementation unallocates the objectid. */
                        //map[i]++;
-                       map[i] = cpu_to_le32(le32_to_cpu(map[i]) + 1);
+                       le32_add_cpu(&map[i], 1);
 
                        /* Did we unallocate the last member of an odd sequence, and can shrink oids? */
                        if (map[i] == map[i + 1]) {
@@ -138,8 +137,7 @@ void reiserfs_release_objectid(struct reiserfs_transaction_handle *th,
                        /* size of objectid map is not changed */
                        if (objectid_to_release + 1 == le32_to_cpu(map[i + 1])) {
                                //objectid_map[i+1]--;
-                               map[i + 1] =
-                                   cpu_to_le32(le32_to_cpu(map[i + 1]) - 1);
+                               le32_add_cpu(&map[i + 1], -1);
                                return;
                        }
 
@@ -161,9 +159,8 @@ void reiserfs_release_objectid(struct reiserfs_transaction_handle *th,
                i += 2;
        }
 
-       reiserfs_warning(s,
-                        "vs-15011: reiserfs_release_objectid: tried to free free object id (%lu)",
-                        (long unsigned)objectid_to_release);
+       reiserfs_error(s, "vs-15011", "tried to free free object id (%lu)",
+                      (long unsigned)objectid_to_release);
 }
 
 int reiserfs_convert_objectid_map_v1(struct super_block *s)
@@ -183,7 +180,7 @@ int reiserfs_convert_objectid_map_v1(struct super_block *s)
 
        if (cur_size > new_size) {
                /* mark everyone used that was listed as free at the end of the objectid
-                ** map 
+                ** map
                 */
                objectid_map[new_size - 1] = objectid_map[cur_size - 1];
                set_sb_oid_cursize(disk_sb, new_size);