]> Pileus Git - ~andy/linux/blobdiff - fs/ocfs2/super.c
ocfs2: Remove masklog ML_XATTR.
[~andy/linux] / fs / ocfs2 / super.c
index 21c4bfdfd73916135e3948bfe78ba84c5dc96ff9..0e4083987d2bf8c0b3daed879041a0e4df1af9dd 100644 (file)
@@ -42,7 +42,9 @@
 #include <linux/seq_file.h>
 #include <linux/quotaops.h>
 
-#define MLOG_MASK_PREFIX ML_SUPER
+#define CREATE_TRACE_POINTS
+#include "ocfs2_trace.h"
+
 #include <cluster/masklog.h>
 
 #include "ocfs2.h"
@@ -476,7 +478,8 @@ static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb)
        }
 
 bail:
-       mlog_exit(status);
+       if (status)
+               mlog_errno(status);
        return status;
 }
 
@@ -504,7 +507,8 @@ static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb)
        }
 
 bail:
-       mlog_exit(status);
+       if (status)
+               mlog_errno(status);
        return status;
 }
 
@@ -534,7 +538,7 @@ static void ocfs2_release_system_inodes(struct ocfs2_super *osb)
        }
 
        if (!osb->local_system_inodes)
-               goto out;
+               return;
 
        for (i = 0; i < NUM_LOCAL_SYSTEM_INODES * osb->max_slots; i++) {
                if (osb->local_system_inodes[i]) {
@@ -545,9 +549,6 @@ static void ocfs2_release_system_inodes(struct ocfs2_super *osb)
 
        kfree(osb->local_system_inodes);
        osb->local_system_inodes = NULL;
-
-out:
-       mlog_exit(0);
 }
 
 /* We're allocating fs objects, use GFP_NOFS */
@@ -678,12 +679,9 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
                }
 
                if (*flags & MS_RDONLY) {
-                       mlog(0, "Going to ro mode.\n");
                        sb->s_flags |= MS_RDONLY;
                        osb->osb_flags |= OCFS2_OSB_SOFT_RO;
                } else {
-                       mlog(0, "Making ro filesystem writeable.\n");
-
                        if (osb->osb_flags & OCFS2_OSB_ERROR_FS) {
                                mlog(ML_ERROR, "Cannot remount RDWR "
                                     "filesystem due to previous errors.\n");
@@ -701,6 +699,7 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
                        sb->s_flags &= ~MS_RDONLY;
                        osb->osb_flags &= ~OCFS2_OSB_SOFT_RO;
                }
+               trace_ocfs2_remount(sb->s_flags, osb->osb_flags, *flags);
 unlock_osb:
                spin_unlock(&osb->osb_lock);
                /* Enable quota accounting after remounting RW */
@@ -1026,7 +1025,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
        char nodestr[8];
        struct ocfs2_blockcheck_stats stats;
 
-       mlog(0, "%p, %p, %i", sb, data, silent);
+       trace_ocfs2_fill_super(sb, data, silent);
 
        if (!ocfs2_parse_options(sb, data, &parsed_options, 0)) {
                status = -EINVAL;
@@ -1202,7 +1201,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
                        mlog_errno(status);
                        atomic_set(&osb->vol_state, VOLUME_DISABLED);
                        wake_up(&osb->osb_mount_event);
-                       mlog_exit(status);
                        return status;
                }
        }
@@ -1216,7 +1214,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
        /* Start this when the mount is almost sure of being successful */
        ocfs2_orphan_scan_start(osb);
 
-       mlog_exit(status);
        return status;
 
 read_super_error:
@@ -1231,7 +1228,8 @@ read_super_error:
                ocfs2_dismount_volume(sb, 1);
        }
 
-       mlog_exit(status);
+       if (status)
+               mlog_errno(status);
        return status;
 }
 
@@ -1314,8 +1312,7 @@ static int ocfs2_parse_options(struct super_block *sb,
        char *p;
        u32 tmp;
 
-       mlog(0, "remount: %d, options: \"%s\"\n", is_remount,
-            options ? options : "(none)");
+       trace_ocfs2_parse_options(is_remount, options ? options : "(none)");
 
        mopt->commit_interval = 0;
        mopt->mount_opt = OCFS2_MOUNT_NOINTR;
@@ -1532,7 +1529,6 @@ static int ocfs2_parse_options(struct super_block *sb,
        status = 1;
 
 bail:
-       mlog_exit(status);
        return status;
 }
 
@@ -1661,10 +1657,9 @@ leave:
                ocfs2_quota_shutdown();
                ocfs2_free_mem_caches();
                exit_ocfs2_uptodate_cache();
+               mlog_errno(status);
        }
 
-       mlog_exit(status);
-
        if (status >= 0) {
                return register_filesystem(&ocfs2_fs_type);
        } else
@@ -1689,18 +1684,14 @@ static void __exit ocfs2_exit(void)
        unregister_filesystem(&ocfs2_fs_type);
 
        exit_ocfs2_uptodate_cache();
-
-       mlog_exit_void();
 }
 
 static void ocfs2_put_super(struct super_block *sb)
 {
-       mlog(0, "(0x%p)\n", sb);
+       trace_ocfs2_put_super(sb);
 
        ocfs2_sync_blockdev(sb);
        ocfs2_dismount_volume(sb, 0);
-
-       mlog_exit_void();
 }
 
 static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
@@ -1712,7 +1703,7 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
        struct buffer_head *bh = NULL;
        struct inode *inode = NULL;
 
-       mlog(0, "(%p, %p)\n", dentry->d_sb, buf);
+       trace_ocfs2_statfs(dentry->d_sb, buf);
 
        osb = OCFS2_SB(dentry->d_sb);
 
@@ -1759,7 +1750,8 @@ bail:
        if (inode)
                iput(inode);
 
-       mlog_exit(status);
+       if (status)
+               mlog_errno(status);
 
        return status;
 }
@@ -1923,7 +1915,6 @@ leave:
        if (unlock_super)
                ocfs2_super_unlock(osb, 1);
 
-       mlog_exit(status);
        return status;
 }
 
@@ -1933,7 +1924,7 @@ static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err)
        struct ocfs2_super *osb = NULL;
        char nodestr[8];
 
-       mlog(0, "(0x%p)\n", sb);
+       trace_ocfs2_dismount_volume(sb);
 
        BUG_ON(!sb);
        osb = OCFS2_SB(sb);
@@ -2148,7 +2139,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
                status = -EINVAL;
                goto bail;
        }
-       mlog(0, "max_slots for this device: %u\n", osb->max_slots);
 
        ocfs2_orphan_scan_init(osb);
 
@@ -2287,7 +2277,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
        osb->s_clustersize_bits =
                le32_to_cpu(di->id2.i_super.s_clustersize_bits);
        osb->s_clustersize = 1 << osb->s_clustersize_bits;
-       mlog(0, "clusterbits=%d\n", osb->s_clustersize_bits);
 
        if (osb->s_clustersize < OCFS2_MIN_CLUSTERSIZE ||
            osb->s_clustersize > OCFS2_MAX_CLUSTERSIZE) {
@@ -2326,11 +2315,10 @@ static int ocfs2_initialize_super(struct super_block *sb,
                le64_to_cpu(di->id2.i_super.s_first_cluster_group);
        osb->fs_generation = le32_to_cpu(di->i_fs_generation);
        osb->uuid_hash = le32_to_cpu(di->id2.i_super.s_uuid_hash);
-       mlog(0, "vol_label: %s\n", osb->vol_label);
-       mlog(0, "uuid: %s\n", osb->uuid_str);
-       mlog(0, "root_blkno=%llu, system_dir_blkno=%llu\n",
-            (unsigned long long)osb->root_blkno,
-            (unsigned long long)osb->system_dir_blkno);
+       trace_ocfs2_initialize_super(osb->vol_label, osb->uuid_str,
+                                    (unsigned long long)osb->root_blkno,
+                                    (unsigned long long)osb->system_dir_blkno,
+                                    osb->s_clustersize_bits);
 
        osb->osb_dlm_debug = ocfs2_new_dlm_debug();
        if (!osb->osb_dlm_debug) {
@@ -2373,7 +2361,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
        }
 
 bail:
-       mlog_exit(status);
        return status;
 }
 
@@ -2443,7 +2430,8 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di,
        }
 
 out:
-       mlog_exit(status);
+       if (status && status != -EAGAIN)
+               mlog_errno(status);
        return status;
 }
 
@@ -2505,8 +2493,6 @@ static int ocfs2_check_volume(struct ocfs2_super *osb)
                 * ourselves as mounted. */
        }
 
-       mlog(0, "Journal loaded.\n");
-
        status = ocfs2_load_local_alloc(osb);
        if (status < 0) {
                mlog_errno(status);
@@ -2538,7 +2524,8 @@ finally:
        if (local_alloc)
                kfree(local_alloc);
 
-       mlog_exit(status);
+       if (status)
+               mlog_errno(status);
        return status;
 }
 
@@ -2567,8 +2554,6 @@ static void ocfs2_delete_osb(struct ocfs2_super *osb)
        kfree(osb->uuid_str);
        ocfs2_put_dlm_debug(osb->osb_dlm_debug);
        memset(osb, 0, sizeof(struct ocfs2_super));
-
-       mlog_exit_void();
 }
 
 /* Put OCFS2 into a readonly state, or (if the user specifies it),