OSDN Git Service

lustre: use %p[dD]
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 8 May 2014 01:10:24 +0000 (21:10 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 3 Nov 2014 20:21:12 +0000 (15:21 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/staging/lustre/lustre/llite/dcache.c
drivers/staging/lustre/lustre/llite/file.c
drivers/staging/lustre/lustre/llite/llite_internal.h
drivers/staging/lustre/lustre/llite/llite_lib.c
drivers/staging/lustre/lustre/llite/namei.c
drivers/staging/lustre/lustre/llite/statahead.c
drivers/staging/lustre/lustre/llite/xattr.c

index 311907b..f692261 100644 (file)
@@ -151,10 +151,10 @@ static int ll_ddelete(const struct dentry *de)
 {
        LASSERT(de);
 
-       CDEBUG(D_DENTRY, "%s dentry %.*s (%p, parent %p, inode %p) %s%s\n",
+       CDEBUG(D_DENTRY, "%s dentry %pd (%p, parent %p, inode %p) %s%s\n",
               d_lustre_invalid((struct dentry *)de) ? "deleting" : "keeping",
-              de->d_name.len, de->d_name.name, de, de->d_parent, de->d_inode,
-              d_unhashed((struct dentry *)de) ? "" : "hashed,",
+              de, de, de->d_parent, de->d_inode,
+              d_unhashed(de) ? "" : "hashed,",
               list_empty(&de->d_subdirs) ? "" : "subdirs");
 
        /* kernel >= 2.6.38 last refcount is decreased after this function. */
@@ -180,8 +180,8 @@ int ll_d_init(struct dentry *de)
 {
        LASSERT(de != NULL);
 
-       CDEBUG(D_DENTRY, "ldd on dentry %.*s (%p) parent %p inode %p refc %d\n",
-               de->d_name.len, de->d_name.name, de, de->d_parent, de->d_inode,
+       CDEBUG(D_DENTRY, "ldd on dentry %pd (%p) parent %p inode %p refc %d\n",
+               de, de, de->d_parent, de->d_inode,
                d_count(de));
 
        if (de->d_fsdata == NULL) {
@@ -259,9 +259,8 @@ void ll_invalidate_aliases(struct inode *inode)
 
        ll_lock_dcache(inode);
        ll_d_hlist_for_each_entry(dentry, p, &inode->i_dentry, d_u.d_alias) {
-               CDEBUG(D_DENTRY, "dentry in drop %.*s (%p) parent %p "
-                      "inode %p flags %d\n", dentry->d_name.len,
-                      dentry->d_name.name, dentry, dentry->d_parent,
+               CDEBUG(D_DENTRY, "dentry in drop %pd (%p) parent %p "
+                      "inode %p flags %d\n", dentry, dentry, dentry->d_parent,
                       dentry->d_inode, dentry->d_flags);
 
                if (unlikely(dentry == dentry->d_sb->s_root)) {
@@ -352,8 +351,8 @@ static int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
 {
        int rc;
 
-       CDEBUG(D_VFSTRACE, "VFS Op:name=%s, flags=%u\n",
-              dentry->d_name.name, flags);
+       CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, flags=%u\n",
+              dentry, flags);
 
        rc = ll_revalidate_dentry(dentry, flags);
        return rc;
index c3be2f2..1fdc2fd 100644 (file)
@@ -1166,9 +1166,9 @@ out:
        /* If any bit been read/written (result != 0), we just return
         * short read/write instead of restart io. */
        if ((result == 0 || result == -ENODATA) && io->ci_need_restart) {
-               CDEBUG(D_VFSTRACE, "Restart %s on %s from %lld, count:%zd\n",
+               CDEBUG(D_VFSTRACE, "Restart %s on %pD from %lld, count:%zd\n",
                       iot == CIT_READ ? "read" : "write",
-                      file->f_dentry->d_name.name, *ppos, count);
+                      file, *ppos, count);
                LASSERTF(io->ci_nob == 0, "%zd", io->ci_nob);
                goto restart;
        }
@@ -2899,8 +2899,8 @@ static int __ll_inode_revalidate(struct dentry *dentry, __u64 ibits)
 
        LASSERT(inode != NULL);
 
-       CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),name=%s\n",
-              inode->i_ino, inode->i_generation, inode, dentry->d_name.name);
+       CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),name=%pd\n",
+              inode->i_ino, inode->i_generation, inode, dentry);
 
        exp = ll_i2mdexp(inode);
 
index 4b80a6f..3c9e980 100644 (file)
@@ -1489,8 +1489,8 @@ static inline void __d_lustre_invalidate(struct dentry *dentry)
  */
 static inline void d_lustre_invalidate(struct dentry *dentry, int nested)
 {
-       CDEBUG(D_DENTRY, "invalidate dentry %.*s (%p) parent %p inode %p "
-              "refc %d\n", dentry->d_name.len, dentry->d_name.name, dentry,
+       CDEBUG(D_DENTRY, "invalidate dentry %pd (%p) parent %p inode %p "
+              "refc %d\n", dentry, dentry,
               dentry->d_parent, dentry->d_inode, d_count(dentry));
 
        spin_lock_nested(&dentry->d_lock,
index f4ca7b7..7b6b9e2 100644 (file)
@@ -698,10 +698,8 @@ void lustre_dump_dentry(struct dentry *dentry, int recur)
        list_for_each(tmp, &dentry->d_subdirs)
                subdirs++;
 
-       CERROR("dentry %p dump: name=%.*s parent=%.*s (%p), inode=%p, count=%u,"
-              " flags=0x%x, fsdata=%p, %d subdirs\n", dentry,
-              dentry->d_name.len, dentry->d_name.name,
-              dentry->d_parent->d_name.len, dentry->d_parent->d_name.name,
+       CERROR("dentry %p dump: name=%pd parent=%p, inode=%p, count=%u,"
+              " flags=0x%x, fsdata=%p, %d subdirs\n", dentry, dentry,
               dentry->d_parent, dentry->d_inode, d_count(dentry),
               dentry->d_flags, dentry->d_fsdata, subdirs);
        if (dentry->d_inode != NULL)
index 6dfd985..2d13483 100644 (file)
@@ -509,8 +509,8 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
        if (dentry->d_name.len > ll_i2sbi(parent)->ll_namelen)
                return ERR_PTR(-ENAMETOOLONG);
 
-       CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p),intent=%s\n",
-              dentry->d_name.len, dentry->d_name.name, parent->i_ino,
+       CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),intent=%s\n",
+              dentry, parent->i_ino,
               parent->i_generation, parent, LL_IT2STR(it));
 
        if (d_mountpoint(dentry))
@@ -586,8 +586,8 @@ static struct dentry *ll_lookup_nd(struct inode *parent, struct dentry *dentry,
        struct lookup_intent *itp, it = { .it_op = IT_GETATTR };
        struct dentry *de;
 
-       CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p),flags=%u\n",
-              dentry->d_name.len, dentry->d_name.name, parent->i_ino,
+       CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),flags=%u\n",
+              dentry, parent->i_ino,
               parent->i_generation, parent, flags);
 
        /* Optimize away (CREATE && !OPEN). Let .create handle the race. */
@@ -619,9 +619,9 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry,
        long long lookup_flags = LOOKUP_OPEN;
        int rc = 0;
 
-       CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p),file %p,"
+       CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),file %p,"
                           "open_flags %x,mode %x opened %d\n",
-              dentry->d_name.len, dentry->d_name.name, dir->i_ino,
+              dentry, dir->i_ino,
               dir->i_generation, dir, file, open_flags, mode, *opened);
 
        it = kzalloc(sizeof(*it), GFP_NOFS);
@@ -741,8 +741,8 @@ static int ll_create_it(struct inode *dir, struct dentry *dentry, int mode,
        struct inode *inode;
        int rc = 0;
 
-       CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p),intent=%s\n",
-              dentry->d_name.len, dentry->d_name.name, dir->i_ino,
+       CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),intent=%s\n",
+              dentry, dir->i_ino,
               dir->i_generation, dir, LL_IT2STR(it));
 
        rc = it_open_error(DISP_OPEN_CREATE, it);
@@ -863,17 +863,17 @@ static int ll_create_nd(struct inode *dir, struct dentry *dentry,
 {
        int rc;
 
-       CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p),"
+       CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),"
                           "flags=%u, excl=%d\n",
-              dentry->d_name.len, dentry->d_name.name, dir->i_ino,
+              dentry, dir->i_ino,
               dir->i_generation, dir, mode, want_excl);
 
        rc = ll_mknod_generic(dir, &dentry->d_name, mode, 0, dentry);
 
        ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_CREATE, 1);
 
-       CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, unhashed %d\n",
-              dentry->d_name.len, dentry->d_name.name, d_unhashed(dentry));
+       CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, unhashed %d\n",
+              dentry, d_unhashed(dentry));
 
        return rc;
 }
index 06b71bc..09d965e 100644 (file)
@@ -969,8 +969,8 @@ static int ll_agl_thread(void *arg)
        struct l_wait_info      lwi    = { 0 };
 
        thread->t_pid = current_pid();
-       CDEBUG(D_READA, "agl thread started: sai %p, parent %.*s\n",
-              sai, parent->d_name.len, parent->d_name.name);
+       CDEBUG(D_READA, "agl thread started: sai %p, parent %pd\n",
+              sai, parent);
 
        atomic_inc(&sbi->ll_agl_total);
        spin_lock(&plli->lli_agl_lock);
@@ -1019,8 +1019,8 @@ static int ll_agl_thread(void *arg)
        spin_unlock(&plli->lli_agl_lock);
        wake_up(&thread->t_ctl_waitq);
        ll_sai_put(sai);
-       CDEBUG(D_READA, "agl thread stopped: sai %p, parent %.*s\n",
-              sai, parent->d_name.len, parent->d_name.name);
+       CDEBUG(D_READA, "agl thread stopped: sai %p, parent %pd\n",
+              sai, parent);
        return 0;
 }
 
@@ -1031,8 +1031,8 @@ static void ll_start_agl(struct dentry *parent, struct ll_statahead_info *sai)
        struct ll_inode_info  *plli;
        struct task_struct *task;
 
-       CDEBUG(D_READA, "start agl thread: sai %p, parent %.*s\n",
-              sai, parent->d_name.len, parent->d_name.name);
+       CDEBUG(D_READA, "start agl thread: sai %p, parent %pd\n",
+              sai, parent);
 
        plli = ll_i2info(parent->d_inode);
        task = kthread_run(ll_agl_thread, parent,
@@ -1066,8 +1066,8 @@ static int ll_statahead_thread(void *arg)
        struct l_wait_info      lwi    = { 0 };
 
        thread->t_pid = current_pid();
-       CDEBUG(D_READA, "statahead thread starting: sai %p, parent %.*s\n",
-              sai, parent->d_name.len, parent->d_name.name);
+       CDEBUG(D_READA, "statahead thread starting: sai %p, parent %pd\n",
+              sai, parent);
 
        if (sbi->ll_flags & LL_SBI_AGL_ENABLED)
                ll_start_agl(parent, sai);
@@ -1288,8 +1288,8 @@ out:
        wake_up(&thread->t_ctl_waitq);
        ll_sai_put(sai);
        dput(parent);
-       CDEBUG(D_READA, "statahead thread stopped: sai %p, parent %.*s\n",
-              sai, parent->d_name.len, parent->d_name.name);
+       CDEBUG(D_READA, "statahead thread stopped: sai %p, parent %pd\n",
+              sai, parent);
        return rc;
 }
 
@@ -1612,10 +1612,9 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
                                } else if ((*dentryp)->d_inode != inode) {
                                        /* revalidate, but inode is recreated */
                                        CDEBUG(D_READA,
-                                             "stale dentry %.*s inode %lu/%u, "
+                                             "stale dentry %pd inode %lu/%u, "
                                              "statahead inode %lu/%u\n",
-                                             (*dentryp)->d_name.len,
-                                             (*dentryp)->d_name.name,
+                                             *dentryp,
                                              (*dentryp)->d_inode->i_ino,
                                              (*dentryp)->d_inode->i_generation,
                                              inode->i_ino,
@@ -1666,9 +1665,9 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
        if (unlikely(sai->sai_inode != parent->d_inode)) {
                struct ll_inode_info *nlli = ll_i2info(parent->d_inode);
 
-               CWARN("Race condition, someone changed %.*s just now: "
+               CWARN("Race condition, someone changed %pd just now: "
                      "old parent "DFID", new parent "DFID"\n",
-                     (*dentryp)->d_name.len, (*dentryp)->d_name.name,
+                     *dentryp,
                      PFID(&lli->lli_fid), PFID(&nlli->lli_fid));
                dput(parent);
                iput(sai->sai_inode);
@@ -1676,8 +1675,8 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
                goto out;
        }
 
-       CDEBUG(D_READA, "start statahead thread: sai %p, parent %.*s\n",
-              sai, parent->d_name.len, parent->d_name.name);
+       CDEBUG(D_READA, "start statahead thread: sai %p, parent %pd\n",
+              sai, parent);
 
        /* The sai buffer already has one reference taken at allocation time,
         * but as soon as we expose the sai by attaching it to the lli that
index 5ad5e7b..3151baf 100644 (file)
@@ -516,8 +516,8 @@ ssize_t ll_getxattr(struct dentry *dentry, const char *name,
                }
 
                if (size < lmmsize) {
-                       CERROR("server bug: replied size %d > %d for %s (%s)\n",
-                              lmmsize, (int)size, dentry->d_name.name, name);
+                       CERROR("server bug: replied size %d > %d for %pd (%s)\n",
+                              lmmsize, (int)size, dentry, name);
                        rc = -ERANGE;
                        goto out;
                }