commit 6c52838c711214c87af2ec4a055b57802abe62c3
Author: Erez Zadok <[EMAIL PROTECTED]>
Date:   Mon Mar 24 18:34:23 2008 -0400

    Unionfs: display mount point name along with generation number
    
    CC: Dave Miller <[EMAIL PROTECTED]>
    
    Signed-off-by: Erez Zadok <[EMAIL PROTECTED]>

diff --git a/fs/unionfs/main.c b/fs/unionfs/main.c
index ba3471d..42dc8a8 100644
--- a/fs/unionfs/main.c
+++ b/fs/unionfs/main.c
@@ -737,7 +737,12 @@ static int unionfs_get_sb(struct file_system_type *fs_type,
                          int flags, const char *dev_name,
                          void *raw_data, struct vfsmount *mnt)
 {
-       return get_sb_nodev(fs_type, flags, raw_data, unionfs_read_super, mnt);
+       int err;
+       err = get_sb_nodev(fs_type, flags, raw_data, unionfs_read_super, mnt);
+       if (!err)
+               UNIONFS_SB(mnt->mnt_sb)->dev_name =
+                       kstrdup(dev_name, GFP_KERNEL);
+       return err;
 }
 
 static struct file_system_type unionfs_fs_type = {
diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
index 80c72e4..f2dc639 100644
--- a/fs/unionfs/super.c
+++ b/fs/unionfs/super.c
@@ -124,6 +124,7 @@ static void unionfs_put_super(struct super_block *sb)
                atomic_dec(&s->s_active);
        }
 
+       kfree(spd->dev_name);
        kfree(spd->data);
        kfree(spd);
        sb->s_fs_info = NULL;
@@ -795,7 +796,8 @@ out_no_change:
        atomic_set(&UNIONFS_D(sb->s_root)->generation, i);
        atomic_set(&UNIONFS_I(sb->s_root->d_inode)->generation, i);
        if (!(*flags & MS_SILENT))
-               pr_info("unionfs: new generation number %d\n", i);
+               pr_info("unionfs: %s: new generation number %d\n",
+                       UNIONFS_SB(sb)->dev_name, i);
        /* finally, update the root dentry's times */
        unionfs_copy_attr_times(sb->s_root->d_inode);
        err = 0;                /* reset to success */
diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h
index 4beba11..9c1cca1 100644
--- a/fs/unionfs/union.h
+++ b/fs/unionfs/union.h
@@ -167,6 +167,7 @@ struct unionfs_sb_info {
        struct unionfs_rw_semaphore rwsem;
        pid_t write_lock_owner; /* PID of rw_sem owner (write lock) */
        int high_branch_id;     /* last unique branch ID given */
+       char *dev_name;         /* to identify different unions in pr_debug */
        struct unionfs_data *data;
 };
 
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to