Unionfs: use new %pd printf for printing dentry name
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 12 Dec 2013 04:56:40 +0000 (23:56 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 11 Nov 2014 01:24:41 +0000 (20:24 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/commonfops.c
fs/unionfs/copyup.c
fs/unionfs/debug.c
fs/unionfs/dentry.c
fs/unionfs/rename.c
fs/unionfs/whiteout.c

index 38805a6cce4f736d146add1e5ac15278cb255816..22cda29b48fc3a7bb258b2fbea9810d3ec324f5f 100644 (file)
@@ -107,8 +107,8 @@ retry:
                counter++;
                sprintf(suffix, "%*.*x", countersize, countersize, counter);
 
-               pr_debug("unionfs: trying to rename %s to %s\n",
-                        dentry->d_name.name, name);
+               pr_debug("unionfs: trying to rename %pd to %s\n",
+                        dentry, name);
 
                tmp_dentry = lookup_lck_len(name, lower_dentry->d_parent,
                                            nlen);
@@ -426,8 +426,7 @@ out_may_copyup:
        if (willwrite && IS_WRITE_FLAG(file->f_flags) &&
            !IS_WRITE_FLAG(unionfs_lower_file(file)->f_flags) &&
            is_robranch(dentry)) {
-               pr_debug("unionfs: do delay copyup of \"%s\"\n",
-                        dentry->d_name.name);
+               pr_debug("unionfs: do delay copyup of \"%pd\"\n", dentry);
                err = do_delayed_copyup(file, parent);
                /* regular files have only one open lower file */
                if (!err && !S_ISDIR(dentry->d_inode->i_mode))
@@ -476,8 +475,8 @@ int unionfs_file_revalidate(struct file *file, struct dentry *parent,
        dgen = atomic_read(&UNIONFS_D(dentry)->generation);
 
        if (unlikely(sbgen > dgen)) { /* XXX: should never happen */
-               pr_debug("unionfs: failed to revalidate dentry (%s)\n",
-                        dentry->d_name.name);
+               pr_debug("unionfs: failed to revalidate dentry (%pd)\n",
+                        dentry);
                err = -ESTALE;
                goto out;
        }
index 916528a92198fbd83081373121643828b5d54175..bf4a77a8d39b3e30322b20cebd4971e6a806d175 100644 (file)
@@ -156,8 +156,8 @@ static int copyup_permissions(struct super_block *sb,
        if (err == -EOPNOTSUPP &&
            S_ISLNK(new_lower_dentry->d_inode->i_mode)) {
                printk(KERN_WARNING
-                      "unionfs: changing \"%s\" symlink mode unsupported\n",
-                      new_lower_dentry->d_name.name);
+                      "unionfs: changing \"%pd\" symlink mode unsupported\n",
+                      new_lower_dentry);
                err = 0;
        }
 
index f40b9084cfd7d5360cac12d16e0cc42dfef2c880..01d6d5380728f2a94161454b62fa957eb0d1c609 100644 (file)
@@ -494,9 +494,9 @@ void __show_dinode_times(const struct dentry *dentry,
                lower_inode = unionfs_lower_inode_idx(inode, bindex);
                if (!lower_inode)
                        continue;
-               pr_debug("DT(%s:%lu:%d): %s:%s:%d "
+               pr_debug("DT(%pd:%lu:%d): %s:%s:%d "
                         "um=%lu/%lu lm=%lu/%lu uc=%lu/%lu lc=%lu/%lu\n",
-                        dentry->d_name.name, inode->i_ino, bindex,
+                        dentry, inode->i_ino, bindex,
                         file, fxn, line,
                         inode->i_mtime.tv_sec, inode->i_mtime.tv_nsec,
                         lower_inode->i_mtime.tv_sec,
index d4a6a6cd3da3112c20cbc864bdf98124f7b516ed..358750555fc1c62abca0dcb527b75363aa137739 100644 (file)
@@ -266,8 +266,8 @@ bool is_newer_lower(const struct dentry *dentry)
                        if ((lower_inode->i_mtime.tv_sec -
                             inode->i_mtime.tv_sec) > UNIONFS_MIN_CC_TIME) {
                                pr_info("unionfs: new lower inode mtime "
-                                       "(bindex=%d, name=%s)\n", bindex,
-                                       dentry->d_name.name);
+                                       "(bindex=%d, name=%pd)\n", bindex,
+                                       dentry);
                                show_dinode_times(dentry);
                        }
                        return true;
@@ -277,8 +277,8 @@ bool is_newer_lower(const struct dentry *dentry)
                        if ((lower_inode->i_ctime.tv_sec -
                             inode->i_ctime.tv_sec) > UNIONFS_MIN_CC_TIME) {
                                pr_info("unionfs: new lower inode ctime "
-                                       "(bindex=%d, name=%s)\n", bindex,
-                                       dentry->d_name.name);
+                                       "(bindex=%d, name=%pd)\n", bindex,
+                                       dentry);
                                show_dinode_times(dentry);
                        }
                        return true;
index 155c83de8c94eaa53cbf9684686f4f29eae67cb7..ec9b54efbf11d829cbda02339423925dbdc4458c 100644 (file)
@@ -248,8 +248,8 @@ static int do_unionfs_rename(struct inode *old_dir,
                        err = create_whiteout(old_dentry, bindex);
                        if (err) {
                                printk(KERN_ERR "unionfs: can't create a "
-                                      "whiteout for %s in rename (err=%d)\n",
-                                      old_dentry->d_name.name, err);
+                                      "whiteout for %pd in rename (err=%d)\n",
+                                      old_dentry, err);
                                continue;
                        }
                        err = __unionfs_rename(old_dir, old_dentry, old_parent,
@@ -276,7 +276,7 @@ static int do_unionfs_rename(struct inode *old_dir,
                if (err) {
                        /* can't fix anything now, so we exit with -EIO */
                        printk(KERN_ERR "unionfs: can't create a whiteout for "
-                              "%s in rename!\n", old_dentry->d_name.name);
+                              "%pd in rename!\n", old_dentry);
                        err = -EIO;
                }
        }
index b2753ef280ae6d540994f919f902fd0d63b50962..6d5a57f81df55c2bcb6992a7076f2e5eb9ca4a36 100644 (file)
@@ -191,8 +191,8 @@ int unlink_whiteout(struct dentry *wh_dentry)
                err = inode->i_op->unlink(inode, wh_dentry);
        }
        if (err)
-               printk(KERN_ERR "unionfs: could not unlink whiteout %s, "
-                      "err = %d\n", wh_dentry->d_name.name, err);
+               printk(KERN_ERR "unionfs: could not unlink whiteout %pd, "
+                      "err = %d\n", wh_dentry, err);
 
        return err;
 
@@ -236,8 +236,8 @@ int check_unlink_whiteout(struct dentry *dentry, struct dentry *lower_dentry,
        /* check if regular file and whiteout were both found */
        if (unlikely(lower_dentry->d_inode))
                printk(KERN_WARNING "unionfs: removing whiteout; regular "
-                      "file exists in directory %s (branch %d)\n",
-                      lower_dir_dentry->d_name.name, bindex);
+                      "file exists in directory %pd (branch %d)\n",
+                      lower_dir_dentry, bindex);
 
        /* check if branch is writeable */
        err = is_robranch_super(dentry->d_sb, bindex);