Unionfs: display mount point name along with generation number
authorErez Zadok <ezk@cs.sunysb.edu>
Mon, 24 Mar 2008 21:29:42 +0000 (17:29 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 12 Aug 2011 02:37:58 +0000 (22:37 -0400)
CC: Dave Miller <justdave@mozilla.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/main.c
fs/unionfs/super.c
fs/unionfs/union.h

index 8f59fb523545b897ef338d1df8a92a4a56a325e7..b76264a5203124c2d7827b778d73bbad821aeb77 100644 (file)
@@ -736,7 +736,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 = {
index 2456654afca2078c03919fcc500e06dba2f36e82..e5cb2355938a7c96c056fa890651923e79a54d87 100644 (file)
@@ -134,6 +134,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;
@@ -805,7 +806,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 */
index ecf417d6fe99b2078f8748a5ac96728c18aca5f3..735d40c4ff1c81d5ffcdc66f79fe4a7424eee528 100644 (file)
@@ -166,6 +166,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;
 };