* [PATCH 0/9] Patches promoting the use of %pd in printk
@ 2013-12-10 15:26 David Howells
2013-12-10 15:26 ` [PATCH 1/9] Use %pd in AFS David Howells
` (8 more replies)
0 siblings, 9 replies; 17+ messages in thread
From: David Howells @ 2013-12-10 15:26 UTC (permalink / raw)
To: viro; +Cc: dhowells, linux-fsdevel
Hi Al,
Here are some patches that make use of the %pd printk specifier and the like
in more places in filesystem code.
The patches can be found here also:
http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=for-viro
David
---
David Howells (9):
Use %pd in AFS
Use %pd in AutoFS
Use %pd in CacheFiles
Use %pd in CIFS
Use %pd in eCryptFS
Use %pd in Ext4
Use %pd in NFSD
Use %pd in ConfigFS
Use %pd in general VFS code
fs/afs/dir.c | 72 ++++++++++++++++++++++---------------------------
fs/afs/inode.c | 5 +--
fs/afs/mntpt.c | 20 +++-----------
fs/afs/write.c | 5 +--
fs/autofs4/expire.c | 27 ++++++------------
fs/autofs4/root.c | 23 +++++-----------
fs/cachefiles/namei.c | 19 ++++---------
fs/cachefiles/xattr.c | 18 ++++--------
fs/cifs/dir.c | 14 +++++-----
fs/cifs/file.c | 10 +++----
fs/cifs/inode.c | 12 ++++----
fs/configfs/dir.c | 5 +--
fs/dcache.c | 4 +--
fs/ecryptfs/file.c | 4 +--
fs/ecryptfs/inode.c | 12 ++++----
fs/ext4/namei.c | 5 +--
fs/nfsd/nfs4xdr.c | 2 +
17 files changed, 101 insertions(+), 156 deletions(-)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/9] Use %pd in AFS
2013-12-10 15:26 [PATCH 0/9] Patches promoting the use of %pd in printk David Howells
@ 2013-12-10 15:26 ` David Howells
2013-12-10 15:26 ` [PATCH 2/9] Use %pd in AutoFS David Howells
` (7 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: David Howells @ 2013-12-10 15:26 UTC (permalink / raw)
To: viro; +Cc: dhowells, linux-fsdevel
Use the new %pd printk() specifier in AFS to replace passing of dentry name or
dentry name and name length * 2 with just passing the dentry.
Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/afs/dir.c | 72 +++++++++++++++++++++++++-------------------------------
fs/afs/inode.c | 5 ++--
fs/afs/mntpt.c | 20 +++-------------
fs/afs/write.c | 5 ++--
4 files changed, 40 insertions(+), 62 deletions(-)
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 529300327f45..fc67b59200e1 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -433,7 +433,7 @@ static int afs_do_lookup(struct inode *dir, struct dentry *dentry,
};
int ret;
- _enter("{%lu},%p{%s},", dir->i_ino, dentry, dentry->d_name.name);
+ _enter("{%lu},%p{%pd},", dir->i_ino, dentry, dentry);
/* search the directory */
ret = afs_dir_iterate(dir, &cookie.ctx, key);
@@ -465,8 +465,8 @@ static struct inode *afs_try_auto_mntpt(
struct afs_vnode *vnode = AFS_FS_I(dir);
struct inode *inode;
- _enter("%d, %p{%s}, {%x:%u}, %p",
- ret, dentry, devname, vnode->fid.vid, vnode->fid.vnode, key);
+ _enter("%d, %p{%pd}, {%x:%u}, %p",
+ ret, dentry, dentry, vnode->fid.vid, vnode->fid.vnode, key);
if (ret != -ENOENT ||
!test_bit(AFS_VNODE_AUTOCELL, &vnode->flags))
@@ -501,8 +501,8 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
vnode = AFS_FS_I(dir);
- _enter("{%x:%u},%p{%s},",
- vnode->fid.vid, vnode->fid.vnode, dentry, dentry->d_name.name);
+ _enter("{%x:%u},%p{%pd},",
+ vnode->fid.vid, vnode->fid.vnode, dentry, dentry);
ASSERTCMP(dentry->d_inode, ==, NULL);
@@ -588,11 +588,10 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
vnode = AFS_FS_I(dentry->d_inode);
if (dentry->d_inode)
- _enter("{v={%x:%u} n=%s fl=%lx},",
- vnode->fid.vid, vnode->fid.vnode, dentry->d_name.name,
- vnode->flags);
+ _enter("{v={%x:%u} n=%pd fl=%lx},",
+ vnode->fid.vid, vnode->fid.vnode, dentry, vnode->flags);
else
- _enter("{neg n=%s}", dentry->d_name.name);
+ _enter("{neg n=%pd}", dentry);
key = afs_request_key(AFS_FS_S(dentry->d_sb)->volume->cell);
if (IS_ERR(key))
@@ -607,7 +606,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
afs_validate(dir, key);
if (test_bit(AFS_VNODE_DELETED, &dir->flags)) {
- _debug("%s: parent dir deleted", dentry->d_name.name);
+ _debug("%pd: parent dir deleted", dentry);
goto out_bad;
}
@@ -625,17 +624,16 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
if (!dentry->d_inode)
goto out_bad;
if (is_bad_inode(dentry->d_inode)) {
- printk("kAFS: afs_d_revalidate: %s/%s has bad inode\n",
- parent->d_name.name, dentry->d_name.name);
+ printk("kAFS: afs_d_revalidate: %pd/%pd has bad inode\n",
+ parent, dentry);
goto out_bad;
}
/* if the vnode ID has changed, then the dirent points to a
* different file */
if (fid.vnode != vnode->fid.vnode) {
- _debug("%s: dirent changed [%u != %u]",
- dentry->d_name.name, fid.vnode,
- vnode->fid.vnode);
+ _debug("%pd: dirent changed [%u != %u]",
+ dentry, fid.vnode, vnode->fid.vnode);
goto not_found;
}
@@ -643,9 +641,8 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
* been deleted and replaced, and the original vnode ID has
* been reused */
if (fid.unique != vnode->fid.unique) {
- _debug("%s: file deleted (uq %u -> %u I:%u)",
- dentry->d_name.name, fid.unique,
- vnode->fid.unique,
+ _debug("%pd: file deleted (uq %u -> %u I:%u)",
+ dentry, fid.unique, vnode->fid.unique,
dentry->d_inode->i_generation);
spin_lock(&vnode->lock);
set_bit(AFS_VNODE_DELETED, &vnode->flags);
@@ -656,14 +653,13 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
case -ENOENT:
/* the filename is unknown */
- _debug("%s: dirent not found", dentry->d_name.name);
+ _debug("%pd: dirent not found", dentry);
if (dentry->d_inode)
goto not_found;
goto out_valid;
default:
- _debug("failed to iterate dir %s: %d",
- parent->d_name.name, ret);
+ _debug("failed to iterate dir %pd: %d", parent, ret);
goto out_bad;
}
@@ -686,8 +682,7 @@ out_bad:
if (check_submounts_and_drop(dentry) != 0)
goto out_skip;
- _debug("dropping dentry %s/%s",
- parent->d_name.name, dentry->d_name.name);
+ _debug("dropping dentry %pd/%pd", parent, dentry);
dput(parent);
key_put(key);
@@ -703,7 +698,7 @@ out_bad:
*/
static int afs_d_delete(const struct dentry *dentry)
{
- _enter("%s", dentry->d_name.name);
+ _enter("%pd", dentry);
if (dentry->d_flags & DCACHE_NFSFS_RENAMED)
goto zap;
@@ -726,7 +721,7 @@ zap:
*/
static void afs_d_release(struct dentry *dentry)
{
- _enter("%s", dentry->d_name.name);
+ _enter("%pd", dentry);
}
/*
@@ -745,8 +740,8 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
dvnode = AFS_FS_I(dir);
- _enter("{%x:%u},{%s},%ho",
- dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, mode);
+ _enter("{%x:%u},{%pd},%ho",
+ dvnode->fid.vid, dvnode->fid.vnode, dentry, mode);
key = afs_request_key(dvnode->volume->cell);
if (IS_ERR(key)) {
@@ -806,8 +801,7 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry)
dvnode = AFS_FS_I(dir);
- _enter("{%x:%u},{%s}",
- dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name);
+ _enter("{%x:%u},{%pd}", dvnode->fid.vid, dvnode->fid.vnode, dentry);
key = afs_request_key(dvnode->volume->cell);
if (IS_ERR(key)) {
@@ -848,8 +842,7 @@ static int afs_unlink(struct inode *dir, struct dentry *dentry)
dvnode = AFS_FS_I(dir);
- _enter("{%x:%u},{%s}",
- dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name);
+ _enter("{%x:%u},{%pd}", dvnode->fid.vid, dvnode->fid.vnode, dentry);
ret = -ENAMETOOLONG;
if (dentry->d_name.len >= AFSNAMEMAX)
@@ -922,8 +915,8 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
dvnode = AFS_FS_I(dir);
- _enter("{%x:%u},{%s},%ho,",
- dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, mode);
+ _enter("{%x:%u},{%pd},%ho,",
+ dvnode->fid.vid, dvnode->fid.vnode, dentry, mode);
key = afs_request_key(dvnode->volume->cell);
if (IS_ERR(key)) {
@@ -985,10 +978,10 @@ static int afs_link(struct dentry *from, struct inode *dir,
vnode = AFS_FS_I(from->d_inode);
dvnode = AFS_FS_I(dir);
- _enter("{%x:%u},{%x:%u},{%s}",
+ _enter("{%x:%u},{%x:%u},{%pd}",
vnode->fid.vid, vnode->fid.vnode,
dvnode->fid.vid, dvnode->fid.vnode,
- dentry->d_name.name);
+ dentry);
key = afs_request_key(dvnode->volume->cell);
if (IS_ERR(key)) {
@@ -1030,9 +1023,8 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry,
dvnode = AFS_FS_I(dir);
- _enter("{%x:%u},{%s},%s",
- dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name,
- content);
+ _enter("{%x:%u},{%pd},%s",
+ dvnode->fid.vid, dvnode->fid.vnode, dentry, content);
ret = -EINVAL;
if (strlen(content) >= AFSPATHMAX)
@@ -1098,11 +1090,11 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
orig_dvnode = AFS_FS_I(old_dir);
new_dvnode = AFS_FS_I(new_dir);
- _enter("{%x:%u},{%x:%u},{%x:%u},{%s}",
+ _enter("{%x:%u},{%x:%u},{%x:%u},{%pd}",
orig_dvnode->fid.vid, orig_dvnode->fid.vnode,
vnode->fid.vid, vnode->fid.vnode,
new_dvnode->fid.vid, new_dvnode->fid.vnode,
- new_dentry->d_name.name);
+ new_dentry);
key = afs_request_key(orig_dvnode->volume->cell);
if (IS_ERR(key)) {
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index ce25d755b7aa..030faa681d0e 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -462,9 +462,8 @@ int afs_setattr(struct dentry *dentry, struct iattr *attr)
struct key *key;
int ret;
- _enter("{%x:%u},{n=%s},%x",
- vnode->fid.vid, vnode->fid.vnode, dentry->d_name.name,
- attr->ia_valid);
+ _enter("{%x:%u},{n=%pd},%x",
+ vnode->fid.vid, vnode->fid.vnode, dentry, attr->ia_valid);
if (!(attr->ia_valid & (ATTR_SIZE | ATTR_MODE | ATTR_UID | ATTR_GID |
ATTR_MTIME))) {
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c
index 9682c33d5daf..5a80f4838efa 100644
--- a/fs/afs/mntpt.c
+++ b/fs/afs/mntpt.c
@@ -106,13 +106,7 @@ static struct dentry *afs_mntpt_lookup(struct inode *dir,
struct dentry *dentry,
unsigned int flags)
{
- _enter("%p,%p{%p{%s},%s}",
- dir,
- dentry,
- dentry->d_parent,
- dentry->d_parent ?
- dentry->d_parent->d_name.name : (const unsigned char *) "",
- dentry->d_name.name);
+ _enter("%p,%pd2", dir, dentry);
return ERR_PTR(-EREMOTE);
}
@@ -122,13 +116,7 @@ static struct dentry *afs_mntpt_lookup(struct inode *dir,
*/
static int afs_mntpt_open(struct inode *inode, struct file *file)
{
- _enter("%p,%p{%p{%s},%s}",
- inode, file,
- file->f_path.dentry->d_parent,
- file->f_path.dentry->d_parent ?
- file->f_path.dentry->d_parent->d_name.name :
- (const unsigned char *) "",
- file->f_path.dentry->d_name.name);
+ _enter("%p,%pD2", inode, file);
return -EREMOTE;
}
@@ -146,7 +134,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
bool rwpath = false;
int ret;
- _enter("{%s}", mntpt->d_name.name);
+ _enter("{%pd}", mntpt);
BUG_ON(!mntpt->d_inode);
@@ -242,7 +230,7 @@ struct vfsmount *afs_d_automount(struct path *path)
{
struct vfsmount *newmnt;
- _enter("{%s}", path->dentry->d_name.name);
+ _enter("{%pd}", path->dentry);
newmnt = afs_mntpt_do_automount(path->dentry);
if (IS_ERR(newmnt))
diff --git a/fs/afs/write.c b/fs/afs/write.c
index a890db4b9898..facc0c4c7ae1 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -689,9 +689,8 @@ int afs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode);
int ret;
- _enter("{%x:%u},{n=%s},%d",
- vnode->fid.vid, vnode->fid.vnode, dentry->d_name.name,
- datasync);
+ _enter("{%x:%u},{n=%pd},%d",
+ vnode->fid.vid, vnode->fid.vnode, dentry, datasync);
ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
if (ret)
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/9] Use %pd in AutoFS
2013-12-10 15:26 [PATCH 0/9] Patches promoting the use of %pd in printk David Howells
2013-12-10 15:26 ` [PATCH 1/9] Use %pd in AFS David Howells
@ 2013-12-10 15:26 ` David Howells
2013-12-11 2:08 ` Ian Kent
2013-12-11 12:09 ` David Howells
2013-12-10 15:26 ` [PATCH 3/9] Use %pd in CacheFiles David Howells
` (6 subsequent siblings)
8 siblings, 2 replies; 17+ messages in thread
From: David Howells @ 2013-12-10 15:26 UTC (permalink / raw)
To: viro; +Cc: dhowells, linux-fsdevel, autofs, Ian Kent
Use the new %pd printk() specifier in AutoFS to replace passing of dentry name
or dentry name and name length * 2 with just passing the dentry.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Ian Kent <raven@themaw.net>
cc: autofs@vger.kernel.org
---
fs/autofs4/expire.c | 27 +++++++++------------------
fs/autofs4/root.c | 23 ++++++++---------------
2 files changed, 17 insertions(+), 33 deletions(-)
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index 3d9d3f5d5dda..fc5826c08fcd 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -47,8 +47,7 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
struct path path = {.mnt = mnt, .dentry = dentry};
int status = 1;
- DPRINTK("dentry %p %.*s",
- dentry, (int)dentry->d_name.len, dentry->d_name.name);
+ DPRINTK("dentry %p %pd", dentry, dentry);
path_get(&path);
@@ -198,8 +197,7 @@ static int autofs4_direct_busy(struct vfsmount *mnt,
unsigned long timeout,
int do_now)
{
- DPRINTK("top %p %.*s",
- top, (int) top->d_name.len, top->d_name.name);
+ DPRINTK("top %p %pd", top, top);
/* If it's busy update the expiry counters */
if (!may_umount_tree(mnt)) {
@@ -227,8 +225,7 @@ static int autofs4_tree_busy(struct vfsmount *mnt,
struct autofs_info *top_ino = autofs4_dentry_ino(top);
struct dentry *p;
- DPRINTK("top %p %.*s",
- top, (int)top->d_name.len, top->d_name.name);
+ DPRINTK("top %p %pd", top, top);
/* Negative dentry - give up */
if (!simple_positive(top))
@@ -236,8 +233,7 @@ static int autofs4_tree_busy(struct vfsmount *mnt,
p = NULL;
while ((p = get_next_positive_dentry(p, top))) {
- DPRINTK("dentry %p %.*s",
- p, (int) p->d_name.len, p->d_name.name);
+ DPRINTK("dentry %p %pd", p, top);
/*
* Is someone visiting anywhere in the subtree ?
@@ -289,13 +285,11 @@ static struct dentry *autofs4_check_leaves(struct vfsmount *mnt,
{
struct dentry *p;
- DPRINTK("parent %p %.*s",
- parent, (int)parent->d_name.len, parent->d_name.name);
+ DPRINTK("parent %p %pd", parent, parent);
p = NULL;
while ((p = get_next_positive_dentry(p, parent))) {
- DPRINTK("dentry %p %.*s",
- p, (int) p->d_name.len, p->d_name.name);
+ DPRINTK("dentry %p %pd", p, p);
if (d_mountpoint(p)) {
/* Can we umount this guy */
@@ -387,8 +381,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
* offset (autofs-5.0+).
*/
if (d_mountpoint(dentry)) {
- DPRINTK("checking mountpoint %p %.*s",
- dentry, (int)dentry->d_name.len, dentry->d_name.name);
+ DPRINTK("checking mountpoint %p %pd", dentry, dentry);
/* Can we umount this guy */
if (autofs4_mount_busy(mnt, dentry))
@@ -438,8 +431,7 @@ next:
return NULL;
found:
- DPRINTK("returning %p %.*s",
- expired, (int)expired->d_name.len, expired->d_name.name);
+ DPRINTK("returning %p %pd", expired, expired);
ino = autofs4_dentry_ino(expired);
ino->flags |= AUTOFS_INF_EXPIRING;
init_completion(&ino->expire_complete);
@@ -465,8 +457,7 @@ int autofs4_expire_wait(struct dentry *dentry)
if (ino->flags & AUTOFS_INF_EXPIRING) {
spin_unlock(&sbi->fs_lock);
- DPRINTK("waiting for expire %p name=%.*s",
- dentry, dentry->d_name.len, dentry->d_name.name);
+ DPRINTK("waiting for expire %p name=%pd", dentry, dentry);
status = autofs4_wait(sbi, dentry, NFY_NONE);
wait_for_completion(&ino->expire_complete);
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 92ef341ba0cf..99b9ab4b6859 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -108,8 +108,7 @@ static int autofs4_dir_open(struct inode *inode, struct file *file)
struct dentry *dentry = file->f_path.dentry;
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
- DPRINTK("file=%p dentry=%p %.*s",
- file, dentry, dentry->d_name.len, dentry->d_name.name);
+ DPRINTK("file=%p dentry=%p %pd", file, dentry, dentry);
if (autofs4_oz_mode(sbi))
goto out;
@@ -267,8 +266,7 @@ static int autofs4_mount_wait(struct dentry *dentry)
int status = 0;
if (ino->flags & AUTOFS_INF_PENDING) {
- DPRINTK("waiting for mount name=%.*s",
- dentry->d_name.len, dentry->d_name.name);
+ DPRINTK("waiting for mount name=%pd", dentry);
status = autofs4_wait(sbi, dentry, NFY_MOUNT);
DPRINTK("mount wait done status=%d", status);
}
@@ -326,8 +324,7 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
struct autofs_info *ino = autofs4_dentry_ino(dentry);
int status;
- DPRINTK("dentry=%p %.*s",
- dentry, dentry->d_name.len, dentry->d_name.name);
+ DPRINTK("dentry=%p %pd", dentry, dentry);
/* The daemon never triggers a mount. */
if (autofs4_oz_mode(sbi))
@@ -414,8 +411,7 @@ static int autofs4_d_manage(struct dentry *dentry, bool rcu_walk)
struct autofs_info *ino = autofs4_dentry_ino(dentry);
int status;
- DPRINTK("dentry=%p %.*s",
- dentry, dentry->d_name.len, dentry->d_name.name);
+ DPRINTK("dentry=%p %pd", dentry, dentry);
/* The daemon never waits. */
if (autofs4_oz_mode(sbi)) {
@@ -472,7 +468,7 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, u
struct autofs_info *ino;
struct dentry *active;
- DPRINTK("name = %.*s", dentry->d_name.len, dentry->d_name.name);
+ DPRINTK("name = %pd", dentry);
/* File name too long to exist */
if (dentry->d_name.len > NAME_MAX)
@@ -526,8 +522,7 @@ static int autofs4_dir_symlink(struct inode *dir,
size_t size = strlen(symname);
char *cp;
- DPRINTK("%s <- %.*s", symname,
- dentry->d_name.len, dentry->d_name.name);
+ DPRINTK("%s <- %pd", symname, dentry);
if (!autofs4_oz_mode(sbi))
return -EACCES;
@@ -669,8 +664,7 @@ static int autofs4_dir_rmdir(struct inode *dir, struct dentry *dentry)
struct autofs_info *ino = autofs4_dentry_ino(dentry);
struct autofs_info *p_ino;
- DPRINTK("dentry %p, removing %.*s",
- dentry, dentry->d_name.len, dentry->d_name.name);
+ DPRINTK("dentry %p, removing %pd", dentry, dentry);
if (!autofs4_oz_mode(sbi))
return -EACCES;
@@ -712,8 +706,7 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, umode_t m
if (!autofs4_oz_mode(sbi))
return -EACCES;
- DPRINTK("dentry %p, creating %.*s",
- dentry, dentry->d_name.len, dentry->d_name.name);
+ DPRINTK("dentry %p, creating %pd", dentry, dentry);
BUG_ON(!ino);
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/9] Use %pd in CacheFiles
2013-12-10 15:26 [PATCH 0/9] Patches promoting the use of %pd in printk David Howells
2013-12-10 15:26 ` [PATCH 1/9] Use %pd in AFS David Howells
2013-12-10 15:26 ` [PATCH 2/9] Use %pd in AutoFS David Howells
@ 2013-12-10 15:26 ` David Howells
[not found] ` <20131210152612.4916.80435.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
` (5 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: David Howells @ 2013-12-10 15:26 UTC (permalink / raw)
To: viro; +Cc: dhowells, linux-fsdevel
Use the new %pd printk() specifier in CacheFiles to replace passing of dentry
name or dentry name and name length * 2 with just passing the dentry.
Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/cachefiles/namei.c | 19 ++++++-------------
fs/cachefiles/xattr.c | 18 ++++++------------
2 files changed, 12 insertions(+), 25 deletions(-)
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
index ca65f39dc8dc..f8b6b31b861d 100644
--- a/fs/cachefiles/namei.c
+++ b/fs/cachefiles/namei.c
@@ -103,8 +103,7 @@ static void cachefiles_mark_object_buried(struct cachefiles_cache *cache,
struct cachefiles_object *object;
struct rb_node *p;
- _enter(",'%*.*s'",
- dentry->d_name.len, dentry->d_name.len, dentry->d_name.name);
+ _enter(",'%pd'", dentry);
write_lock(&cache->active_lock);
@@ -278,9 +277,7 @@ static int cachefiles_bury_object(struct cachefiles_cache *cache,
char nbuffer[8 + 8 + 1];
int ret;
- _enter(",'%*.*s','%*.*s'",
- dir->d_name.len, dir->d_name.len, dir->d_name.name,
- rep->d_name.len, rep->d_name.len, rep->d_name.name);
+ _enter(",'%pd','%pd'", dir, rep);
_debug("remove %p from %p", rep, dir);
@@ -602,8 +599,7 @@ lookup_again:
/* if we've found that the terminal object exists, then we need to
* check its attributes and delete it if it's out of date */
if (!object->new) {
- _debug("validate '%*.*s'",
- next->d_name.len, next->d_name.len, next->d_name.name);
+ _debug("validate '%pd'", next);
ret = cachefiles_check_object_xattr(object, auxdata);
if (ret == -ESTALE) {
@@ -832,8 +828,7 @@ static struct dentry *cachefiles_check_active(struct cachefiles_cache *cache,
unsigned long start;
int ret;
- //_enter(",%*.*s/,%s",
- // dir->d_name.len, dir->d_name.len, dir->d_name.name, filename);
+ //_enter(",%pd/,%s", dir, filename);
/* look up the victim */
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
@@ -915,8 +910,7 @@ int cachefiles_cull(struct cachefiles_cache *cache, struct dentry *dir,
struct dentry *victim;
int ret;
- _enter(",%*.*s/,%s",
- dir->d_name.len, dir->d_name.len, dir->d_name.name, filename);
+ _enter(",%pd/,%s", dir, filename);
victim = cachefiles_check_active(cache, dir, filename);
if (IS_ERR(victim))
@@ -974,8 +968,7 @@ int cachefiles_check_in_use(struct cachefiles_cache *cache, struct dentry *dir,
{
struct dentry *victim;
- //_enter(",%*.*s/,%s",
- // dir->d_name.len, dir->d_name.len, dir->d_name.name, filename);
+ //_enter(",%pd/,%s", dir);
victim = cachefiles_check_active(cache, dir, filename);
if (IS_ERR(victim))
diff --git a/fs/cachefiles/xattr.c b/fs/cachefiles/xattr.c
index 12b0eef84183..8ad642793936 100644
--- a/fs/cachefiles/xattr.c
+++ b/fs/cachefiles/xattr.c
@@ -51,10 +51,8 @@ int cachefiles_check_object_type(struct cachefiles_object *object)
}
if (ret != -EEXIST) {
- kerror("Can't set xattr on %*.*s [%lu] (err %d)",
- dentry->d_name.len, dentry->d_name.len,
- dentry->d_name.name, dentry->d_inode->i_ino,
- -ret);
+ kerror("Can't set xattr on %pd [%lu] (err %d)",
+ dentry, dentry->d_inode->i_ino, -ret);
goto error;
}
@@ -64,10 +62,8 @@ int cachefiles_check_object_type(struct cachefiles_object *object)
if (ret == -ERANGE)
goto bad_type_length;
- kerror("Can't read xattr on %*.*s [%lu] (err %d)",
- dentry->d_name.len, dentry->d_name.len,
- dentry->d_name.name, dentry->d_inode->i_ino,
- -ret);
+ kerror("Can't read xattr on %pd [%lu] (err %d)",
+ dentry, dentry->d_inode->i_ino, -ret);
goto error;
}
@@ -92,10 +88,8 @@ bad_type_length:
bad_type:
xtype[2] = 0;
- kerror("Cache object %*.*s [%lu] type %s not %s",
- dentry->d_name.len, dentry->d_name.len,
- dentry->d_name.name, dentry->d_inode->i_ino,
- xtype, type);
+ kerror("Cache object %pd [%lu] type %s not %s",
+ dentry, dentry->d_inode->i_ino, xtype, type);
ret = -EIO;
goto error;
}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 4/9] Use %pd in CIFS
[not found] ` <20131210152612.4916.80435.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
@ 2013-12-10 15:26 ` David Howells
0 siblings, 0 replies; 17+ messages in thread
From: David Howells @ 2013-12-10 15:26 UTC (permalink / raw)
To: viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn
Cc: Steve French, linux-cifs-u79uwXL29TY76Z2rM5mHXA,
dhowells-H+wXaHxf7aLQT0dZR+AlfA,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, Jeff Layton
Use the new %pd printk() specifier in CIFS to replace passing of dentry name or
dentry name and name length * 2 with just passing the dentry.
Signed-off-by: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
cc: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
cc: Steve French <sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
fs/cifs/dir.c | 14 +++++++-------
fs/cifs/file.c | 10 ++++------
fs/cifs/inode.c | 12 ++++++------
3 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 11ff5f116b20..4b18490bdad3 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -462,8 +462,8 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
xid = get_xid();
- cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
- inode, direntry->d_name.name, direntry);
+ cifs_dbg(FYI, "parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
+ inode, direntry, direntry);
tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
if (IS_ERR(tlink)) {
@@ -531,8 +531,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
__u32 oplock;
int created = FILE_CREATED;
- cifs_dbg(FYI, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p\n",
- inode, direntry->d_name.name, direntry);
+ cifs_dbg(FYI, "cifs_create parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
+ inode, direntry, direntry);
tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
rc = PTR_ERR(tlink);
@@ -701,8 +701,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
xid = get_xid();
- cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
- parent_dir_inode, direntry->d_name.name, direntry);
+ cifs_dbg(FYI, "parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
+ parent_dir_inode, direntry, direntry);
/* check whether path exists */
@@ -821,7 +821,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
{
int rc = 0;
- cifs_dbg(FYI, "In cifs d_delete, name = %s\n", direntry->d_name.name);
+ cifs_dbg(FYI, "In cifs d_delete, name = %pd\n", direntry);
return rc;
} */
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 5a5a87240fe2..90f9ee34e1c6 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1642,8 +1642,8 @@ cifs_write(struct cifsFileInfo *open_file, __u32 pid, const char *write_data,
cifs_sb = CIFS_SB(dentry->d_sb);
- cifs_dbg(FYI, "write %zd bytes to offset %lld of %s\n",
- write_size, *offset, dentry->d_name.name);
+ cifs_dbg(FYI, "write %zd bytes to offset %lld of %pd\n",
+ write_size, *offset, dentry);
tcon = tlink_tcon(open_file->tlink);
server = tcon->ses->server;
@@ -2213,8 +2213,7 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
xid = get_xid();
- cifs_dbg(FYI, "Sync file - name: %s datasync: 0x%x\n",
- file->f_path.dentry->d_name.name, datasync);
+ cifs_dbg(FYI, "Sync file - name: %pD datasync: 0x%x\n", file, datasync);
if (!CIFS_CACHE_READ(CIFS_I(inode))) {
rc = cifs_invalidate_mapping(inode);
@@ -2255,8 +2254,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
xid = get_xid();
- cifs_dbg(FYI, "Sync file - name: %s datasync: 0x%x\n",
- file->f_path.dentry->d_name.name, datasync);
+ cifs_dbg(FYI, "Sync file - name: %pD datasync: 0x%x\n", file, datasync);
tcon = tlink_tcon(smbfile->tlink);
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) {
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 36f9ebb93ceb..64ac645ea4b8 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1391,8 +1391,8 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode,
d_instantiate(dentry, newinode);
#ifdef CONFIG_CIFS_DEBUG2
- cifs_dbg(FYI, "instantiated dentry %p %s to inode %p\n",
- dentry, dentry->d_name.name, newinode);
+ cifs_dbg(FYI, "instantiated dentry %p %pd to inode %p\n",
+ dentry, dentry, newinode);
if (newinode->i_nlink != 2)
cifs_dbg(FYI, "unexpected number of links %d\n",
@@ -2019,8 +2019,8 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
struct cifs_unix_set_info_args *args = NULL;
struct cifsFileInfo *open_file;
- cifs_dbg(FYI, "setattr_unix on file %s attrs->ia_valid=0x%x\n",
- direntry->d_name.name, attrs->ia_valid);
+ cifs_dbg(FYI, "setattr_unix on file %pd attrs->ia_valid=0x%x\n",
+ direntry, attrs->ia_valid);
xid = get_xid();
@@ -2162,8 +2162,8 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
xid = get_xid();
- cifs_dbg(FYI, "setattr on file %s attrs->iavalid 0x%x\n",
- direntry->d_name.name, attrs->ia_valid);
+ cifs_dbg(FYI, "setattr on file %pd attrs->iavalid 0x%x\n",
+ direntry, attrs->ia_valid);
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM)
attrs->ia_valid |= ATTR_FORCE;
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 5/9] Use %pd in eCryptFS
2013-12-10 15:26 [PATCH 0/9] Patches promoting the use of %pd in printk David Howells
` (3 preceding siblings ...)
[not found] ` <20131210152612.4916.80435.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
@ 2013-12-10 15:26 ` David Howells
2013-12-17 17:45 ` Tyler Hicks
2013-12-10 15:26 ` [PATCH 6/9] Use %pd in Ext4 David Howells
` (3 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: David Howells @ 2013-12-10 15:26 UTC (permalink / raw)
To: viro; +Cc: dhowells, linux-fsdevel, ecryptfs, Tyler Hicks
Use the new %pd printk() specifier in eCryptFS to replace passing of dentry
name or dentry name and name length * 2 with just passing the dentry.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Tyler Hicks <tyhicks@canonical.com>
cc: ecryptfs@vger.kernel.org
---
fs/ecryptfs/file.c | 4 ++--
fs/ecryptfs/inode.c | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index b1eaa7a1f82c..c705360e2b16 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -230,8 +230,8 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
if (rc) {
printk(KERN_ERR "%s: Error attempting to initialize "
"the lower file for the dentry with name "
- "[%s]; rc = [%d]\n", __func__,
- ecryptfs_dentry->d_name.name, rc);
+ "[%pd]; rc = [%d]\n", __func__,
+ ecryptfs_dentry, rc);
goto out_free;
}
if ((ecryptfs_inode_to_private(inode)->lower_file->f_flags & O_ACCMODE)
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index c36c44824471..87ad33e091e9 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -250,8 +250,8 @@ int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry,
if (rc) {
printk(KERN_ERR "%s: Error attempting to initialize "
"the lower file for the dentry with name "
- "[%s]; rc = [%d]\n", __func__,
- ecryptfs_dentry->d_name.name, rc);
+ "[%pd]; rc = [%d]\n", __func__,
+ ecryptfs_dentry, rc);
goto out;
}
rc = ecryptfs_write_metadata(ecryptfs_dentry, ecryptfs_inode);
@@ -313,8 +313,8 @@ static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode)
if (rc) {
printk(KERN_ERR "%s: Error attempting to initialize "
"the lower file for the dentry with name "
- "[%s]; rc = [%d]\n", __func__,
- dentry->d_name.name, rc);
+ "[%pd]; rc = [%d]\n", __func__,
+ dentry, rc);
return rc;
}
@@ -418,8 +418,8 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode,
if (IS_ERR(lower_dentry)) {
rc = PTR_ERR(lower_dentry);
ecryptfs_printk(KERN_DEBUG, "%s: lookup_one_len() returned "
- "[%d] on lower_dentry = [%s]\n", __func__, rc,
- ecryptfs_dentry->d_name.name);
+ "[%d] on lower_dentry = [%pd]\n", __func__, rc,
+ ecryptfs_dentry);
goto out;
}
if (lower_dentry->d_inode)
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 6/9] Use %pd in Ext4
2013-12-10 15:26 [PATCH 0/9] Patches promoting the use of %pd in printk David Howells
` (4 preceding siblings ...)
2013-12-10 15:26 ` [PATCH 5/9] Use %pd in eCryptFS David Howells
@ 2013-12-10 15:26 ` David Howells
2013-12-10 15:58 ` Theodore Ts'o
2013-12-11 12:10 ` David Howells
2013-12-10 15:27 ` [PATCH 7/9] Use %pd in NFSD David Howells
` (2 subsequent siblings)
8 siblings, 2 replies; 17+ messages in thread
From: David Howells @ 2013-12-10 15:26 UTC (permalink / raw)
To: viro
Cc: dhowells, Theodore Ts'o, linux-ext4, Andreas Dilger, linux-fsdevel
Use the new %pd printk() specifier in Ext4 to replace passing of dentry name or
dentry name and name length * 2 with just passing the dentry.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: "Theodore Ts'o" <tytso@mit.edu>
cc: Andreas Dilger <adilger.kernel@dilger.ca>
cc: linux-ext4@vger.kernel.org
---
fs/ext4/namei.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 5a0408d7b114..3e9e70663233 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1425,9 +1425,8 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsi
return ERR_PTR(-EIO);
}
if (unlikely(ino == dir->i_ino)) {
- EXT4_ERROR_INODE(dir, "'%.*s' linked to parent dir",
- dentry->d_name.len,
- dentry->d_name.name);
+ EXT4_ERROR_INODE(dir, "'%pd' linked to parent dir",
+ dentry);
return ERR_PTR(-EIO);
}
inode = ext4_iget(dir->i_sb, ino);
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 7/9] Use %pd in NFSD
2013-12-10 15:26 [PATCH 0/9] Patches promoting the use of %pd in printk David Howells
` (5 preceding siblings ...)
2013-12-10 15:26 ` [PATCH 6/9] Use %pd in Ext4 David Howells
@ 2013-12-10 15:27 ` David Howells
2013-12-10 15:27 ` [PATCH 8/9] Use %pd in ConfigFS David Howells
2013-12-10 15:27 ` [PATCH 9/9] Use %pd in general VFS code David Howells
8 siblings, 0 replies; 17+ messages in thread
From: David Howells @ 2013-12-10 15:27 UTC (permalink / raw)
To: viro; +Cc: dhowells, linux-fsdevel, linux-nfs
Use the new %pd printk() specifier in NFSD to replace passing of dentry name or
dentry name and name length * 2 with just passing the dentry.
Signed-off-by: David Howells <dhowells@redhat.com>
cc "J. Bruce Fields" <bfields@fieldses.org>
cc: linux-nfs@vger.kernel.org
---
fs/nfsd/nfs4xdr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index ee7237f99f54..34342c9bc09b 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1884,7 +1884,7 @@ static __be32 nfsd4_encode_path(const struct path *root,
}
WRITE32(len);
WRITEMEM(dentry->d_name.name, len);
- dprintk("/%s", dentry->d_name.name);
+ dprintk("/%pd", dentry);
spin_unlock(&dentry->d_lock);
dput(dentry);
ncomponents--;
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 8/9] Use %pd in ConfigFS
2013-12-10 15:26 [PATCH 0/9] Patches promoting the use of %pd in printk David Howells
` (6 preceding siblings ...)
2013-12-10 15:27 ` [PATCH 7/9] Use %pd in NFSD David Howells
@ 2013-12-10 15:27 ` David Howells
2013-12-10 15:27 ` [PATCH 9/9] Use %pd in general VFS code David Howells
8 siblings, 0 replies; 17+ messages in thread
From: David Howells @ 2013-12-10 15:27 UTC (permalink / raw)
To: viro; +Cc: dhowells, linux-fsdevel, Joel Becker
Use the new %pd printk() specifier in ConfigFS to replace passing of dentry
name or dentry name and name length * 2 with just passing the dentry.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Joel Becker <jlbec@evilplan.org>
---
fs/configfs/dir.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index e081acbac2e7..9c3e85609e92 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -386,7 +386,7 @@ static void remove_dir(struct dentry * d)
if (d->d_inode)
simple_rmdir(parent->d_inode,d);
- pr_debug(" o %s removing done (%d)\n",d->d_name.name, d_count(d));
+ pr_debug(" o %pd removing done (%d)\n", d, d_count(d));
dput(parent);
}
@@ -567,8 +567,7 @@ static void detach_attrs(struct config_item * item)
if (!dentry)
return;
- pr_debug("configfs %s: dropping attrs for dir\n",
- dentry->d_name.name);
+ pr_debug("configfs %pd: dropping attrs for dir\n", dentry);
parent_sd = dentry->d_fsdata;
list_for_each_entry_safe(sd, tmp, &parent_sd->s_children, s_sibling) {
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 9/9] Use %pd in general VFS code
2013-12-10 15:26 [PATCH 0/9] Patches promoting the use of %pd in printk David Howells
` (7 preceding siblings ...)
2013-12-10 15:27 ` [PATCH 8/9] Use %pd in ConfigFS David Howells
@ 2013-12-10 15:27 ` David Howells
8 siblings, 0 replies; 17+ messages in thread
From: David Howells @ 2013-12-10 15:27 UTC (permalink / raw)
To: viro; +Cc: dhowells, linux-fsdevel
Use the new %pd printk() specifier in general VFS code to replace passing of
dentry name or dentry name and name length * 2 with just passing the dentry.
Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/dcache.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/dcache.c b/fs/dcache.c
index 4bdb300b16e2..87d38d34fe1c 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2768,9 +2768,9 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
if (IS_ERR(actual)) {
if (PTR_ERR(actual) == -ELOOP)
pr_warn_ratelimited(
- "VFS: Lookup of '%s' in %s %s"
+ "VFS: Lookup of '%pd' in %s %s"
" would have caused loop\n",
- dentry->d_name.name,
+ dentry,
inode->i_sb->s_type->name,
inode->i_sb->s_id);
dput(alias);
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 6/9] Use %pd in Ext4
2013-12-10 15:26 ` [PATCH 6/9] Use %pd in Ext4 David Howells
@ 2013-12-10 15:58 ` Theodore Ts'o
2013-12-11 12:10 ` David Howells
1 sibling, 0 replies; 17+ messages in thread
From: Theodore Ts'o @ 2013-12-10 15:58 UTC (permalink / raw)
To: David Howells; +Cc: viro, linux-ext4, Andreas Dilger, linux-fsdevel
On Tue, Dec 10, 2013 at 03:26:55PM +0000, David Howells wrote:
> Use the new %pd printk() specifier in Ext4 to replace passing of dentry name or
> dentry name and name length * 2 with just passing the dentry.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: "Theodore Ts'o" <tytso@mit.edu>
> cc: Andreas Dilger <adilger.kernel@dilger.ca>
> cc: linux-ext4@vger.kernel.org
Acked-by: "Theodore Ts'o" <tytso@mit.edu>
Do you want to have Al take this, or I'm happy to carry this in the
ext4 tree.
- Ted
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/9] Use %pd in AutoFS
2013-12-10 15:26 ` [PATCH 2/9] Use %pd in AutoFS David Howells
@ 2013-12-11 2:08 ` Ian Kent
2013-12-11 12:09 ` David Howells
1 sibling, 0 replies; 17+ messages in thread
From: Ian Kent @ 2013-12-11 2:08 UTC (permalink / raw)
To: David Howells; +Cc: viro, linux-fsdevel, autofs
On Tue, 2013-12-10 at 15:26 +0000, David Howells wrote:
> Use the new %pd printk() specifier in AutoFS to replace passing of dentry name
> or dentry name and name length * 2 with just passing the dentry.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Ian Kent <raven@themaw.net>
> cc: autofs@vger.kernel.org
Looks sensible.
Acked-by: Ian Kent <raven@themaw.net>
> ---
>
> fs/autofs4/expire.c | 27 +++++++++------------------
> fs/autofs4/root.c | 23 ++++++++---------------
> 2 files changed, 17 insertions(+), 33 deletions(-)
>
> diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
> index 3d9d3f5d5dda..fc5826c08fcd 100644
> --- a/fs/autofs4/expire.c
> +++ b/fs/autofs4/expire.c
> @@ -47,8 +47,7 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
> struct path path = {.mnt = mnt, .dentry = dentry};
> int status = 1;
>
> - DPRINTK("dentry %p %.*s",
> - dentry, (int)dentry->d_name.len, dentry->d_name.name);
> + DPRINTK("dentry %p %pd", dentry, dentry);
>
> path_get(&path);
>
> @@ -198,8 +197,7 @@ static int autofs4_direct_busy(struct vfsmount *mnt,
> unsigned long timeout,
> int do_now)
> {
> - DPRINTK("top %p %.*s",
> - top, (int) top->d_name.len, top->d_name.name);
> + DPRINTK("top %p %pd", top, top);
>
> /* If it's busy update the expiry counters */
> if (!may_umount_tree(mnt)) {
> @@ -227,8 +225,7 @@ static int autofs4_tree_busy(struct vfsmount *mnt,
> struct autofs_info *top_ino = autofs4_dentry_ino(top);
> struct dentry *p;
>
> - DPRINTK("top %p %.*s",
> - top, (int)top->d_name.len, top->d_name.name);
> + DPRINTK("top %p %pd", top, top);
>
> /* Negative dentry - give up */
> if (!simple_positive(top))
> @@ -236,8 +233,7 @@ static int autofs4_tree_busy(struct vfsmount *mnt,
>
> p = NULL;
> while ((p = get_next_positive_dentry(p, top))) {
> - DPRINTK("dentry %p %.*s",
> - p, (int) p->d_name.len, p->d_name.name);
> + DPRINTK("dentry %p %pd", p, top);
>
> /*
> * Is someone visiting anywhere in the subtree ?
> @@ -289,13 +285,11 @@ static struct dentry *autofs4_check_leaves(struct vfsmount *mnt,
> {
> struct dentry *p;
>
> - DPRINTK("parent %p %.*s",
> - parent, (int)parent->d_name.len, parent->d_name.name);
> + DPRINTK("parent %p %pd", parent, parent);
>
> p = NULL;
> while ((p = get_next_positive_dentry(p, parent))) {
> - DPRINTK("dentry %p %.*s",
> - p, (int) p->d_name.len, p->d_name.name);
> + DPRINTK("dentry %p %pd", p, p);
>
> if (d_mountpoint(p)) {
> /* Can we umount this guy */
> @@ -387,8 +381,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
> * offset (autofs-5.0+).
> */
> if (d_mountpoint(dentry)) {
> - DPRINTK("checking mountpoint %p %.*s",
> - dentry, (int)dentry->d_name.len, dentry->d_name.name);
> + DPRINTK("checking mountpoint %p %pd", dentry, dentry);
>
> /* Can we umount this guy */
> if (autofs4_mount_busy(mnt, dentry))
> @@ -438,8 +431,7 @@ next:
> return NULL;
>
> found:
> - DPRINTK("returning %p %.*s",
> - expired, (int)expired->d_name.len, expired->d_name.name);
> + DPRINTK("returning %p %pd", expired, expired);
> ino = autofs4_dentry_ino(expired);
> ino->flags |= AUTOFS_INF_EXPIRING;
> init_completion(&ino->expire_complete);
> @@ -465,8 +457,7 @@ int autofs4_expire_wait(struct dentry *dentry)
> if (ino->flags & AUTOFS_INF_EXPIRING) {
> spin_unlock(&sbi->fs_lock);
>
> - DPRINTK("waiting for expire %p name=%.*s",
> - dentry, dentry->d_name.len, dentry->d_name.name);
> + DPRINTK("waiting for expire %p name=%pd", dentry, dentry);
>
> status = autofs4_wait(sbi, dentry, NFY_NONE);
> wait_for_completion(&ino->expire_complete);
> diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
> index 92ef341ba0cf..99b9ab4b6859 100644
> --- a/fs/autofs4/root.c
> +++ b/fs/autofs4/root.c
> @@ -108,8 +108,7 @@ static int autofs4_dir_open(struct inode *inode, struct file *file)
> struct dentry *dentry = file->f_path.dentry;
> struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
>
> - DPRINTK("file=%p dentry=%p %.*s",
> - file, dentry, dentry->d_name.len, dentry->d_name.name);
> + DPRINTK("file=%p dentry=%p %pd", file, dentry, dentry);
>
> if (autofs4_oz_mode(sbi))
> goto out;
> @@ -267,8 +266,7 @@ static int autofs4_mount_wait(struct dentry *dentry)
> int status = 0;
>
> if (ino->flags & AUTOFS_INF_PENDING) {
> - DPRINTK("waiting for mount name=%.*s",
> - dentry->d_name.len, dentry->d_name.name);
> + DPRINTK("waiting for mount name=%pd", dentry);
> status = autofs4_wait(sbi, dentry, NFY_MOUNT);
> DPRINTK("mount wait done status=%d", status);
> }
> @@ -326,8 +324,7 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
> struct autofs_info *ino = autofs4_dentry_ino(dentry);
> int status;
>
> - DPRINTK("dentry=%p %.*s",
> - dentry, dentry->d_name.len, dentry->d_name.name);
> + DPRINTK("dentry=%p %pd", dentry, dentry);
>
> /* The daemon never triggers a mount. */
> if (autofs4_oz_mode(sbi))
> @@ -414,8 +411,7 @@ static int autofs4_d_manage(struct dentry *dentry, bool rcu_walk)
> struct autofs_info *ino = autofs4_dentry_ino(dentry);
> int status;
>
> - DPRINTK("dentry=%p %.*s",
> - dentry, dentry->d_name.len, dentry->d_name.name);
> + DPRINTK("dentry=%p %pd", dentry, dentry);
>
> /* The daemon never waits. */
> if (autofs4_oz_mode(sbi)) {
> @@ -472,7 +468,7 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, u
> struct autofs_info *ino;
> struct dentry *active;
>
> - DPRINTK("name = %.*s", dentry->d_name.len, dentry->d_name.name);
> + DPRINTK("name = %pd", dentry);
>
> /* File name too long to exist */
> if (dentry->d_name.len > NAME_MAX)
> @@ -526,8 +522,7 @@ static int autofs4_dir_symlink(struct inode *dir,
> size_t size = strlen(symname);
> char *cp;
>
> - DPRINTK("%s <- %.*s", symname,
> - dentry->d_name.len, dentry->d_name.name);
> + DPRINTK("%s <- %pd", symname, dentry);
>
> if (!autofs4_oz_mode(sbi))
> return -EACCES;
> @@ -669,8 +664,7 @@ static int autofs4_dir_rmdir(struct inode *dir, struct dentry *dentry)
> struct autofs_info *ino = autofs4_dentry_ino(dentry);
> struct autofs_info *p_ino;
>
> - DPRINTK("dentry %p, removing %.*s",
> - dentry, dentry->d_name.len, dentry->d_name.name);
> + DPRINTK("dentry %p, removing %pd", dentry, dentry);
>
> if (!autofs4_oz_mode(sbi))
> return -EACCES;
> @@ -712,8 +706,7 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, umode_t m
> if (!autofs4_oz_mode(sbi))
> return -EACCES;
>
> - DPRINTK("dentry %p, creating %.*s",
> - dentry, dentry->d_name.len, dentry->d_name.name);
> + DPRINTK("dentry %p, creating %pd", dentry, dentry);
>
> BUG_ON(!ino);
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/9] Use %pd in AutoFS
2013-12-10 15:26 ` [PATCH 2/9] Use %pd in AutoFS David Howells
2013-12-11 2:08 ` Ian Kent
@ 2013-12-11 12:09 ` David Howells
2013-12-12 2:43 ` Ian Kent
1 sibling, 1 reply; 17+ messages in thread
From: David Howells @ 2013-12-11 12:09 UTC (permalink / raw)
To: Ian Kent; +Cc: dhowells, viro, linux-fsdevel, autofs
Ian Kent <raven@themaw.net> wrote:
> > Use the new %pd printk() specifier in AutoFS to replace passing of dentry name
> > or dentry name and name length * 2 with just passing the dentry.
> >
> > Signed-off-by: David Howells <dhowells@redhat.com>
> > cc: Ian Kent <raven@themaw.net>
> > cc: autofs@vger.kernel.org
>
> Looks sensible.
>
> Acked-by: Ian Kent <raven@themaw.net>
Can you take the autofs bit through your tree?
David
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 6/9] Use %pd in Ext4
2013-12-10 15:26 ` [PATCH 6/9] Use %pd in Ext4 David Howells
2013-12-10 15:58 ` Theodore Ts'o
@ 2013-12-11 12:10 ` David Howells
2014-01-06 14:43 ` Theodore Ts'o
1 sibling, 1 reply; 17+ messages in thread
From: David Howells @ 2013-12-11 12:10 UTC (permalink / raw)
To: Theodore Ts'o
Cc: dhowells, viro, linux-ext4, Andreas Dilger, linux-fsdevel
Theodore Ts'o <tytso@mit.edu> wrote:
> Do you want to have Al take this, or I'm happy to carry this in the
> ext4 tree.
Can you take the Ext4 bit through your tree?
David
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/9] Use %pd in AutoFS
2013-12-11 12:09 ` David Howells
@ 2013-12-12 2:43 ` Ian Kent
0 siblings, 0 replies; 17+ messages in thread
From: Ian Kent @ 2013-12-12 2:43 UTC (permalink / raw)
To: David Howells; +Cc: viro, linux-fsdevel, autofs
On Wed, 2013-12-11 at 12:09 +0000, David Howells wrote:
> Ian Kent <raven@themaw.net> wrote:
>
> > > Use the new %pd printk() specifier in AutoFS to replace passing of dentry name
> > > or dentry name and name length * 2 with just passing the dentry.
> > >
> > > Signed-off-by: David Howells <dhowells@redhat.com>
> > > cc: Ian Kent <raven@themaw.net>
> > > cc: autofs@vger.kernel.org
> >
> > Looks sensible.
> >
> > Acked-by: Ian Kent <raven@themaw.net>
>
> Can you take the autofs bit through your tree?
Because there have been so few changes to autofs I don't maintain a
development tree.
I can take it if you wish but if I do it will need to be passed on to
akpm for inclusion in linux-next .... which will probably take a while.
Might be quicker if you include it in your patch set.
Your call though.
>
> David
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 5/9] Use %pd in eCryptFS
2013-12-10 15:26 ` [PATCH 5/9] Use %pd in eCryptFS David Howells
@ 2013-12-17 17:45 ` Tyler Hicks
0 siblings, 0 replies; 17+ messages in thread
From: Tyler Hicks @ 2013-12-17 17:45 UTC (permalink / raw)
To: David Howells; +Cc: viro, linux-fsdevel, ecryptfs
[-- Attachment #1: Type: text/plain, Size: 2969 bytes --]
On 2013-12-10 15:26:48, David Howells wrote:
> Use the new %pd printk() specifier in eCryptFS to replace passing of dentry
> name or dentry name and name length * 2 with just passing the dentry.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Tyler Hicks <tyhicks@canonical.com>
Thanks for the patch! It looks like you're asking the individual
filesystem maintainers to carry the patch so I'll throw it into my -next
branch.
Tyler
> cc: ecryptfs@vger.kernel.org
> ---
>
> fs/ecryptfs/file.c | 4 ++--
> fs/ecryptfs/inode.c | 12 ++++++------
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
> index b1eaa7a1f82c..c705360e2b16 100644
> --- a/fs/ecryptfs/file.c
> +++ b/fs/ecryptfs/file.c
> @@ -230,8 +230,8 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
> if (rc) {
> printk(KERN_ERR "%s: Error attempting to initialize "
> "the lower file for the dentry with name "
> - "[%s]; rc = [%d]\n", __func__,
> - ecryptfs_dentry->d_name.name, rc);
> + "[%pd]; rc = [%d]\n", __func__,
> + ecryptfs_dentry, rc);
> goto out_free;
> }
> if ((ecryptfs_inode_to_private(inode)->lower_file->f_flags & O_ACCMODE)
> diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
> index c36c44824471..87ad33e091e9 100644
> --- a/fs/ecryptfs/inode.c
> +++ b/fs/ecryptfs/inode.c
> @@ -250,8 +250,8 @@ int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry,
> if (rc) {
> printk(KERN_ERR "%s: Error attempting to initialize "
> "the lower file for the dentry with name "
> - "[%s]; rc = [%d]\n", __func__,
> - ecryptfs_dentry->d_name.name, rc);
> + "[%pd]; rc = [%d]\n", __func__,
> + ecryptfs_dentry, rc);
> goto out;
> }
> rc = ecryptfs_write_metadata(ecryptfs_dentry, ecryptfs_inode);
> @@ -313,8 +313,8 @@ static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode)
> if (rc) {
> printk(KERN_ERR "%s: Error attempting to initialize "
> "the lower file for the dentry with name "
> - "[%s]; rc = [%d]\n", __func__,
> - dentry->d_name.name, rc);
> + "[%pd]; rc = [%d]\n", __func__,
> + dentry, rc);
> return rc;
> }
>
> @@ -418,8 +418,8 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode,
> if (IS_ERR(lower_dentry)) {
> rc = PTR_ERR(lower_dentry);
> ecryptfs_printk(KERN_DEBUG, "%s: lookup_one_len() returned "
> - "[%d] on lower_dentry = [%s]\n", __func__, rc,
> - ecryptfs_dentry->d_name.name);
> + "[%d] on lower_dentry = [%pd]\n", __func__, rc,
> + ecryptfs_dentry);
> goto out;
> }
> if (lower_dentry->d_inode)
>
> --
> To unsubscribe from this list: send the line "unsubscribe ecryptfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 6/9] Use %pd in Ext4
2013-12-11 12:10 ` David Howells
@ 2014-01-06 14:43 ` Theodore Ts'o
0 siblings, 0 replies; 17+ messages in thread
From: Theodore Ts'o @ 2014-01-06 14:43 UTC (permalink / raw)
To: David Howells; +Cc: viro, linux-ext4, Andreas Dilger, linux-fsdevel
On Wed, Dec 11, 2013 at 12:10:04PM +0000, David Howells wrote:
> Theodore Ts'o <tytso@mit.edu> wrote:
>
> > Do you want to have Al take this, or I'm happy to carry this in the
> > ext4 tree.
>
> Can you take the Ext4 bit through your tree?
Thanks, applied to the ext4 tree.
- Ted
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2014-01-06 14:43 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-10 15:26 [PATCH 0/9] Patches promoting the use of %pd in printk David Howells
2013-12-10 15:26 ` [PATCH 1/9] Use %pd in AFS David Howells
2013-12-10 15:26 ` [PATCH 2/9] Use %pd in AutoFS David Howells
2013-12-11 2:08 ` Ian Kent
2013-12-11 12:09 ` David Howells
2013-12-12 2:43 ` Ian Kent
2013-12-10 15:26 ` [PATCH 3/9] Use %pd in CacheFiles David Howells
[not found] ` <20131210152612.4916.80435.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2013-12-10 15:26 ` [PATCH 4/9] Use %pd in CIFS David Howells
2013-12-10 15:26 ` [PATCH 5/9] Use %pd in eCryptFS David Howells
2013-12-17 17:45 ` Tyler Hicks
2013-12-10 15:26 ` [PATCH 6/9] Use %pd in Ext4 David Howells
2013-12-10 15:58 ` Theodore Ts'o
2013-12-11 12:10 ` David Howells
2014-01-06 14:43 ` Theodore Ts'o
2013-12-10 15:27 ` [PATCH 7/9] Use %pd in NFSD David Howells
2013-12-10 15:27 ` [PATCH 8/9] Use %pd in ConfigFS David Howells
2013-12-10 15:27 ` [PATCH 9/9] Use %pd in general VFS code David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).