diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-16 10:53:17 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-10-24 23:34:50 -0400 |
commit | 6de1472f1a4a3bd912f515f29d3cf52a65a4c718 (patch) | |
tree | 3b93cfa6198d68832479f211c72a675bfb406fd9 /fs/nfs | |
parent | 48bc06e74be178968b53d339dbcb110cd2bb16ea (diff) |
nfs: use %p[dD] instead of open-coded (and often racy) equivalents
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/dir.c | 119 | ||||
-rw-r--r-- | fs/nfs/direct.c | 17 | ||||
-rw-r--r-- | fs/nfs/file.c | 117 | ||||
-rw-r--r-- | fs/nfs/namespace.c | 5 | ||||
-rw-r--r-- | fs/nfs/nfs3proc.c | 8 | ||||
-rw-r--r-- | fs/nfs/nfs4file.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs4namespace.c | 7 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 5 | ||||
-rw-r--r-- | fs/nfs/proc.c | 8 | ||||
-rw-r--r-- | fs/nfs/unlink.c | 9 | ||||
-rw-r--r-- | fs/nfs/write.c | 6 |
11 files changed, 119 insertions, 186 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 02b0df769e2d..8b3dd7174fa2 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -98,9 +98,7 @@ nfs_opendir(struct inode *inode, struct file *filp) | |||
98 | struct nfs_open_dir_context *ctx; | 98 | struct nfs_open_dir_context *ctx; |
99 | struct rpc_cred *cred; | 99 | struct rpc_cred *cred; |
100 | 100 | ||
101 | dfprintk(FILE, "NFS: open dir(%s/%s)\n", | 101 | dfprintk(FILE, "NFS: open dir(%pD2)\n", filp); |
102 | filp->f_path.dentry->d_parent->d_name.name, | ||
103 | filp->f_path.dentry->d_name.name); | ||
104 | 102 | ||
105 | nfs_inc_stats(inode, NFSIOS_VFSOPEN); | 103 | nfs_inc_stats(inode, NFSIOS_VFSOPEN); |
106 | 104 | ||
@@ -297,11 +295,10 @@ int nfs_readdir_search_for_cookie(struct nfs_cache_array *array, nfs_readdir_des | |||
297 | if (ctx->duped > 0 | 295 | if (ctx->duped > 0 |
298 | && ctx->dup_cookie == *desc->dir_cookie) { | 296 | && ctx->dup_cookie == *desc->dir_cookie) { |
299 | if (printk_ratelimit()) { | 297 | if (printk_ratelimit()) { |
300 | pr_notice("NFS: directory %s/%s contains a readdir loop." | 298 | pr_notice("NFS: directory %pD2 contains a readdir loop." |
301 | "Please contact your server vendor. " | 299 | "Please contact your server vendor. " |
302 | "The file: %s has duplicate cookie %llu\n", | 300 | "The file: %s has duplicate cookie %llu\n", |
303 | desc->file->f_dentry->d_parent->d_name.name, | 301 | desc->file, |
304 | desc->file->f_dentry->d_name.name, | ||
305 | array->array[i].string.name, | 302 | array->array[i].string.name, |
306 | *desc->dir_cookie); | 303 | *desc->dir_cookie); |
307 | } | 304 | } |
@@ -822,9 +819,8 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx) | |||
822 | struct nfs_open_dir_context *dir_ctx = file->private_data; | 819 | struct nfs_open_dir_context *dir_ctx = file->private_data; |
823 | int res = 0; | 820 | int res = 0; |
824 | 821 | ||
825 | dfprintk(FILE, "NFS: readdir(%s/%s) starting at cookie %llu\n", | 822 | dfprintk(FILE, "NFS: readdir(%pD2) starting at cookie %llu\n", |
826 | dentry->d_parent->d_name.name, dentry->d_name.name, | 823 | file, (long long)ctx->pos); |
827 | (long long)ctx->pos); | ||
828 | nfs_inc_stats(inode, NFSIOS_VFSGETDENTS); | 824 | nfs_inc_stats(inode, NFSIOS_VFSGETDENTS); |
829 | 825 | ||
830 | /* | 826 | /* |
@@ -880,22 +876,17 @@ out: | |||
880 | nfs_unblock_sillyrename(dentry); | 876 | nfs_unblock_sillyrename(dentry); |
881 | if (res > 0) | 877 | if (res > 0) |
882 | res = 0; | 878 | res = 0; |
883 | dfprintk(FILE, "NFS: readdir(%s/%s) returns %d\n", | 879 | dfprintk(FILE, "NFS: readdir(%pD2) returns %d\n", file, res); |
884 | dentry->d_parent->d_name.name, dentry->d_name.name, | ||
885 | res); | ||
886 | return res; | 880 | return res; |
887 | } | 881 | } |
888 | 882 | ||
889 | static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence) | 883 | static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence) |
890 | { | 884 | { |
891 | struct dentry *dentry = filp->f_path.dentry; | 885 | struct inode *inode = file_inode(filp); |
892 | struct inode *inode = dentry->d_inode; | ||
893 | struct nfs_open_dir_context *dir_ctx = filp->private_data; | 886 | struct nfs_open_dir_context *dir_ctx = filp->private_data; |
894 | 887 | ||
895 | dfprintk(FILE, "NFS: llseek dir(%s/%s, %lld, %d)\n", | 888 | dfprintk(FILE, "NFS: llseek dir(%pD2, %lld, %d)\n", |
896 | dentry->d_parent->d_name.name, | 889 | filp, offset, whence); |
897 | dentry->d_name.name, | ||
898 | offset, whence); | ||
899 | 890 | ||
900 | mutex_lock(&inode->i_mutex); | 891 | mutex_lock(&inode->i_mutex); |
901 | switch (whence) { | 892 | switch (whence) { |
@@ -925,15 +916,12 @@ out: | |||
925 | static int nfs_fsync_dir(struct file *filp, loff_t start, loff_t end, | 916 | static int nfs_fsync_dir(struct file *filp, loff_t start, loff_t end, |
926 | int datasync) | 917 | int datasync) |
927 | { | 918 | { |
928 | struct dentry *dentry = filp->f_path.dentry; | 919 | struct inode *inode = file_inode(filp); |
929 | struct inode *inode = dentry->d_inode; | ||
930 | 920 | ||
931 | dfprintk(FILE, "NFS: fsync dir(%s/%s) datasync %d\n", | 921 | dfprintk(FILE, "NFS: fsync dir(%pD2) datasync %d\n", filp, datasync); |
932 | dentry->d_parent->d_name.name, dentry->d_name.name, | ||
933 | datasync); | ||
934 | 922 | ||
935 | mutex_lock(&inode->i_mutex); | 923 | mutex_lock(&inode->i_mutex); |
936 | nfs_inc_stats(dentry->d_inode, NFSIOS_VFSFSYNC); | 924 | nfs_inc_stats(inode, NFSIOS_VFSFSYNC); |
937 | mutex_unlock(&inode->i_mutex); | 925 | mutex_unlock(&inode->i_mutex); |
938 | return 0; | 926 | return 0; |
939 | } | 927 | } |
@@ -1073,9 +1061,8 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags) | |||
1073 | } | 1061 | } |
1074 | 1062 | ||
1075 | if (is_bad_inode(inode)) { | 1063 | if (is_bad_inode(inode)) { |
1076 | dfprintk(LOOKUPCACHE, "%s: %s/%s has dud inode\n", | 1064 | dfprintk(LOOKUPCACHE, "%s: %pd2 has dud inode\n", |
1077 | __func__, dentry->d_parent->d_name.name, | 1065 | __func__, dentry); |
1078 | dentry->d_name.name); | ||
1079 | goto out_bad; | 1066 | goto out_bad; |
1080 | } | 1067 | } |
1081 | 1068 | ||
@@ -1125,9 +1112,8 @@ out_set_verifier: | |||
1125 | nfs_advise_use_readdirplus(dir); | 1112 | nfs_advise_use_readdirplus(dir); |
1126 | out_valid_noent: | 1113 | out_valid_noent: |
1127 | dput(parent); | 1114 | dput(parent); |
1128 | dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is valid\n", | 1115 | dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is valid\n", |
1129 | __func__, dentry->d_parent->d_name.name, | 1116 | __func__, dentry); |
1130 | dentry->d_name.name); | ||
1131 | return 1; | 1117 | return 1; |
1132 | out_zap_parent: | 1118 | out_zap_parent: |
1133 | nfs_zap_caches(dir); | 1119 | nfs_zap_caches(dir); |
@@ -1147,18 +1133,16 @@ out_zap_parent: | |||
1147 | goto out_valid; | 1133 | goto out_valid; |
1148 | 1134 | ||
1149 | dput(parent); | 1135 | dput(parent); |
1150 | dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is invalid\n", | 1136 | dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n", |
1151 | __func__, dentry->d_parent->d_name.name, | 1137 | __func__, dentry); |
1152 | dentry->d_name.name); | ||
1153 | return 0; | 1138 | return 0; |
1154 | out_error: | 1139 | out_error: |
1155 | nfs_free_fattr(fattr); | 1140 | nfs_free_fattr(fattr); |
1156 | nfs_free_fhandle(fhandle); | 1141 | nfs_free_fhandle(fhandle); |
1157 | nfs4_label_free(label); | 1142 | nfs4_label_free(label); |
1158 | dput(parent); | 1143 | dput(parent); |
1159 | dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) lookup returned error %d\n", | 1144 | dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) lookup returned error %d\n", |
1160 | __func__, dentry->d_parent->d_name.name, | 1145 | __func__, dentry, error); |
1161 | dentry->d_name.name, error); | ||
1162 | return error; | 1146 | return error; |
1163 | } | 1147 | } |
1164 | 1148 | ||
@@ -1182,16 +1166,14 @@ static int nfs_weak_revalidate(struct dentry *dentry, unsigned int flags) | |||
1182 | * eventually need to do something more here. | 1166 | * eventually need to do something more here. |
1183 | */ | 1167 | */ |
1184 | if (!inode) { | 1168 | if (!inode) { |
1185 | dfprintk(LOOKUPCACHE, "%s: %s/%s has negative inode\n", | 1169 | dfprintk(LOOKUPCACHE, "%s: %pd2 has negative inode\n", |
1186 | __func__, dentry->d_parent->d_name.name, | 1170 | __func__, dentry); |
1187 | dentry->d_name.name); | ||
1188 | return 1; | 1171 | return 1; |
1189 | } | 1172 | } |
1190 | 1173 | ||
1191 | if (is_bad_inode(inode)) { | 1174 | if (is_bad_inode(inode)) { |
1192 | dfprintk(LOOKUPCACHE, "%s: %s/%s has dud inode\n", | 1175 | dfprintk(LOOKUPCACHE, "%s: %pd2 has dud inode\n", |
1193 | __func__, dentry->d_parent->d_name.name, | 1176 | __func__, dentry); |
1194 | dentry->d_name.name); | ||
1195 | return 0; | 1177 | return 0; |
1196 | } | 1178 | } |
1197 | 1179 | ||
@@ -1206,9 +1188,8 @@ static int nfs_weak_revalidate(struct dentry *dentry, unsigned int flags) | |||
1206 | */ | 1188 | */ |
1207 | static int nfs_dentry_delete(const struct dentry *dentry) | 1189 | static int nfs_dentry_delete(const struct dentry *dentry) |
1208 | { | 1190 | { |
1209 | dfprintk(VFS, "NFS: dentry_delete(%s/%s, %x)\n", | 1191 | dfprintk(VFS, "NFS: dentry_delete(%pd2, %x)\n", |
1210 | dentry->d_parent->d_name.name, dentry->d_name.name, | 1192 | dentry, dentry->d_flags); |
1211 | dentry->d_flags); | ||
1212 | 1193 | ||
1213 | /* Unhash any dentry with a stale inode */ | 1194 | /* Unhash any dentry with a stale inode */ |
1214 | if (dentry->d_inode != NULL && NFS_STALE(dentry->d_inode)) | 1195 | if (dentry->d_inode != NULL && NFS_STALE(dentry->d_inode)) |
@@ -1286,8 +1267,7 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in | |||
1286 | struct nfs4_label *label = NULL; | 1267 | struct nfs4_label *label = NULL; |
1287 | int error; | 1268 | int error; |
1288 | 1269 | ||
1289 | dfprintk(VFS, "NFS: lookup(%s/%s)\n", | 1270 | dfprintk(VFS, "NFS: lookup(%pd2)\n", dentry); |
1290 | dentry->d_parent->d_name.name, dentry->d_name.name); | ||
1291 | nfs_inc_stats(dir, NFSIOS_VFSLOOKUP); | 1271 | nfs_inc_stats(dir, NFSIOS_VFSLOOKUP); |
1292 | 1272 | ||
1293 | res = ERR_PTR(-ENAMETOOLONG); | 1273 | res = ERR_PTR(-ENAMETOOLONG); |
@@ -1418,8 +1398,8 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, | |||
1418 | /* Expect a negative dentry */ | 1398 | /* Expect a negative dentry */ |
1419 | BUG_ON(dentry->d_inode); | 1399 | BUG_ON(dentry->d_inode); |
1420 | 1400 | ||
1421 | dfprintk(VFS, "NFS: atomic_open(%s/%ld), %s\n", | 1401 | dfprintk(VFS, "NFS: atomic_open(%s/%ld), %pd\n", |
1422 | dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); | 1402 | dir->i_sb->s_id, dir->i_ino, dentry); |
1423 | 1403 | ||
1424 | err = nfs_check_flags(open_flags); | 1404 | err = nfs_check_flags(open_flags); |
1425 | if (err) | 1405 | if (err) |
@@ -1608,8 +1588,8 @@ int nfs_create(struct inode *dir, struct dentry *dentry, | |||
1608 | int open_flags = excl ? O_CREAT | O_EXCL : O_CREAT; | 1588 | int open_flags = excl ? O_CREAT | O_EXCL : O_CREAT; |
1609 | int error; | 1589 | int error; |
1610 | 1590 | ||
1611 | dfprintk(VFS, "NFS: create(%s/%ld), %s\n", | 1591 | dfprintk(VFS, "NFS: create(%s/%ld), %pd\n", |
1612 | dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); | 1592 | dir->i_sb->s_id, dir->i_ino, dentry); |
1613 | 1593 | ||
1614 | attr.ia_mode = mode; | 1594 | attr.ia_mode = mode; |
1615 | attr.ia_valid = ATTR_MODE; | 1595 | attr.ia_valid = ATTR_MODE; |
@@ -1635,8 +1615,8 @@ nfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) | |||
1635 | struct iattr attr; | 1615 | struct iattr attr; |
1636 | int status; | 1616 | int status; |
1637 | 1617 | ||
1638 | dfprintk(VFS, "NFS: mknod(%s/%ld), %s\n", | 1618 | dfprintk(VFS, "NFS: mknod(%s/%ld), %pd\n", |
1639 | dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); | 1619 | dir->i_sb->s_id, dir->i_ino, dentry); |
1640 | 1620 | ||
1641 | if (!new_valid_dev(rdev)) | 1621 | if (!new_valid_dev(rdev)) |
1642 | return -EINVAL; | 1622 | return -EINVAL; |
@@ -1664,8 +1644,8 @@ int nfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
1664 | struct iattr attr; | 1644 | struct iattr attr; |
1665 | int error; | 1645 | int error; |
1666 | 1646 | ||
1667 | dfprintk(VFS, "NFS: mkdir(%s/%ld), %s\n", | 1647 | dfprintk(VFS, "NFS: mkdir(%s/%ld), %pd\n", |
1668 | dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); | 1648 | dir->i_sb->s_id, dir->i_ino, dentry); |
1669 | 1649 | ||
1670 | attr.ia_valid = ATTR_MODE; | 1650 | attr.ia_valid = ATTR_MODE; |
1671 | attr.ia_mode = mode | S_IFDIR; | 1651 | attr.ia_mode = mode | S_IFDIR; |
@@ -1692,8 +1672,8 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
1692 | { | 1672 | { |
1693 | int error; | 1673 | int error; |
1694 | 1674 | ||
1695 | dfprintk(VFS, "NFS: rmdir(%s/%ld), %s\n", | 1675 | dfprintk(VFS, "NFS: rmdir(%s/%ld), %pd\n", |
1696 | dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); | 1676 | dir->i_sb->s_id, dir->i_ino, dentry); |
1697 | 1677 | ||
1698 | trace_nfs_rmdir_enter(dir, dentry); | 1678 | trace_nfs_rmdir_enter(dir, dentry); |
1699 | if (dentry->d_inode) { | 1679 | if (dentry->d_inode) { |
@@ -1728,8 +1708,7 @@ static int nfs_safe_remove(struct dentry *dentry) | |||
1728 | struct inode *inode = dentry->d_inode; | 1708 | struct inode *inode = dentry->d_inode; |
1729 | int error = -EBUSY; | 1709 | int error = -EBUSY; |
1730 | 1710 | ||
1731 | dfprintk(VFS, "NFS: safe_remove(%s/%s)\n", | 1711 | dfprintk(VFS, "NFS: safe_remove(%pd2)\n", dentry); |
1732 | dentry->d_parent->d_name.name, dentry->d_name.name); | ||
1733 | 1712 | ||
1734 | /* If the dentry was sillyrenamed, we simply call d_delete() */ | 1713 | /* If the dentry was sillyrenamed, we simply call d_delete() */ |
1735 | if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { | 1714 | if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { |
@@ -1762,8 +1741,8 @@ int nfs_unlink(struct inode *dir, struct dentry *dentry) | |||
1762 | int error; | 1741 | int error; |
1763 | int need_rehash = 0; | 1742 | int need_rehash = 0; |
1764 | 1743 | ||
1765 | dfprintk(VFS, "NFS: unlink(%s/%ld, %s)\n", dir->i_sb->s_id, | 1744 | dfprintk(VFS, "NFS: unlink(%s/%ld, %pd)\n", dir->i_sb->s_id, |
1766 | dir->i_ino, dentry->d_name.name); | 1745 | dir->i_ino, dentry); |
1767 | 1746 | ||
1768 | trace_nfs_unlink_enter(dir, dentry); | 1747 | trace_nfs_unlink_enter(dir, dentry); |
1769 | spin_lock(&dentry->d_lock); | 1748 | spin_lock(&dentry->d_lock); |
@@ -1813,8 +1792,8 @@ int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) | |||
1813 | unsigned int pathlen = strlen(symname); | 1792 | unsigned int pathlen = strlen(symname); |
1814 | int error; | 1793 | int error; |
1815 | 1794 | ||
1816 | dfprintk(VFS, "NFS: symlink(%s/%ld, %s, %s)\n", dir->i_sb->s_id, | 1795 | dfprintk(VFS, "NFS: symlink(%s/%ld, %pd, %s)\n", dir->i_sb->s_id, |
1817 | dir->i_ino, dentry->d_name.name, symname); | 1796 | dir->i_ino, dentry, symname); |
1818 | 1797 | ||
1819 | if (pathlen > PAGE_SIZE) | 1798 | if (pathlen > PAGE_SIZE) |
1820 | return -ENAMETOOLONG; | 1799 | return -ENAMETOOLONG; |
@@ -1836,9 +1815,9 @@ int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) | |||
1836 | error = NFS_PROTO(dir)->symlink(dir, dentry, page, pathlen, &attr); | 1815 | error = NFS_PROTO(dir)->symlink(dir, dentry, page, pathlen, &attr); |
1837 | trace_nfs_symlink_exit(dir, dentry, error); | 1816 | trace_nfs_symlink_exit(dir, dentry, error); |
1838 | if (error != 0) { | 1817 | if (error != 0) { |
1839 | dfprintk(VFS, "NFS: symlink(%s/%ld, %s, %s) error %d\n", | 1818 | dfprintk(VFS, "NFS: symlink(%s/%ld, %pd, %s) error %d\n", |
1840 | dir->i_sb->s_id, dir->i_ino, | 1819 | dir->i_sb->s_id, dir->i_ino, |
1841 | dentry->d_name.name, symname, error); | 1820 | dentry, symname, error); |
1842 | d_drop(dentry); | 1821 | d_drop(dentry); |
1843 | __free_page(page); | 1822 | __free_page(page); |
1844 | return error; | 1823 | return error; |
@@ -1865,9 +1844,8 @@ nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) | |||
1865 | struct inode *inode = old_dentry->d_inode; | 1844 | struct inode *inode = old_dentry->d_inode; |
1866 | int error; | 1845 | int error; |
1867 | 1846 | ||
1868 | dfprintk(VFS, "NFS: link(%s/%s -> %s/%s)\n", | 1847 | dfprintk(VFS, "NFS: link(%pd2 -> %pd2)\n", |
1869 | old_dentry->d_parent->d_name.name, old_dentry->d_name.name, | 1848 | old_dentry, dentry); |
1870 | dentry->d_parent->d_name.name, dentry->d_name.name); | ||
1871 | 1849 | ||
1872 | trace_nfs_link_enter(inode, dir, dentry); | 1850 | trace_nfs_link_enter(inode, dir, dentry); |
1873 | NFS_PROTO(inode)->return_delegation(inode); | 1851 | NFS_PROTO(inode)->return_delegation(inode); |
@@ -1915,9 +1893,8 @@ int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1915 | struct dentry *dentry = NULL, *rehash = NULL; | 1893 | struct dentry *dentry = NULL, *rehash = NULL; |
1916 | int error = -EBUSY; | 1894 | int error = -EBUSY; |
1917 | 1895 | ||
1918 | dfprintk(VFS, "NFS: rename(%s/%s -> %s/%s, ct=%d)\n", | 1896 | dfprintk(VFS, "NFS: rename(%pd2 -> %pd2, ct=%d)\n", |
1919 | old_dentry->d_parent->d_name.name, old_dentry->d_name.name, | 1897 | old_dentry, new_dentry, |
1920 | new_dentry->d_parent->d_name.name, new_dentry->d_name.name, | ||
1921 | d_count(new_dentry)); | 1898 | d_count(new_dentry)); |
1922 | 1899 | ||
1923 | trace_nfs_rename_enter(old_dir, old_dentry, new_dir, new_dentry); | 1900 | trace_nfs_rename_enter(old_dir, old_dentry, new_dir, new_dentry); |
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 91ff089d3412..d71d66c9e0a1 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -124,9 +124,8 @@ static inline int put_dreq(struct nfs_direct_req *dreq) | |||
124 | ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t pos, unsigned long nr_segs) | 124 | ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t pos, unsigned long nr_segs) |
125 | { | 125 | { |
126 | #ifndef CONFIG_NFS_SWAP | 126 | #ifndef CONFIG_NFS_SWAP |
127 | dprintk("NFS: nfs_direct_IO (%s) off/no(%Ld/%lu) EINVAL\n", | 127 | dprintk("NFS: nfs_direct_IO (%pD) off/no(%Ld/%lu) EINVAL\n", |
128 | iocb->ki_filp->f_path.dentry->d_name.name, | 128 | iocb->ki_filp, (long long) pos, nr_segs); |
129 | (long long) pos, nr_segs); | ||
130 | 129 | ||
131 | return -EINVAL; | 130 | return -EINVAL; |
132 | #else | 131 | #else |
@@ -909,10 +908,8 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov, | |||
909 | count = iov_length(iov, nr_segs); | 908 | count = iov_length(iov, nr_segs); |
910 | nfs_add_stats(mapping->host, NFSIOS_DIRECTREADBYTES, count); | 909 | nfs_add_stats(mapping->host, NFSIOS_DIRECTREADBYTES, count); |
911 | 910 | ||
912 | dfprintk(FILE, "NFS: direct read(%s/%s, %zd@%Ld)\n", | 911 | dfprintk(FILE, "NFS: direct read(%pD2, %zd@%Ld)\n", |
913 | file->f_path.dentry->d_parent->d_name.name, | 912 | file, count, (long long) pos); |
914 | file->f_path.dentry->d_name.name, | ||
915 | count, (long long) pos); | ||
916 | 913 | ||
917 | retval = 0; | 914 | retval = 0; |
918 | if (!count) | 915 | if (!count) |
@@ -965,10 +962,8 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov, | |||
965 | count = iov_length(iov, nr_segs); | 962 | count = iov_length(iov, nr_segs); |
966 | nfs_add_stats(mapping->host, NFSIOS_DIRECTWRITTENBYTES, count); | 963 | nfs_add_stats(mapping->host, NFSIOS_DIRECTWRITTENBYTES, count); |
967 | 964 | ||
968 | dfprintk(FILE, "NFS: direct write(%s/%s, %zd@%Ld)\n", | 965 | dfprintk(FILE, "NFS: direct write(%pD2, %zd@%Ld)\n", |
969 | file->f_path.dentry->d_parent->d_name.name, | 966 | file, count, (long long) pos); |
970 | file->f_path.dentry->d_name.name, | ||
971 | count, (long long) pos); | ||
972 | 967 | ||
973 | retval = generic_write_checks(file, &pos, &count, 0); | 968 | retval = generic_write_checks(file, &pos, &count, 0); |
974 | if (retval) | 969 | if (retval) |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 1e6bfdbc1aff..e2fcacf07de3 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -65,9 +65,7 @@ nfs_file_open(struct inode *inode, struct file *filp) | |||
65 | { | 65 | { |
66 | int res; | 66 | int res; |
67 | 67 | ||
68 | dprintk("NFS: open file(%s/%s)\n", | 68 | dprintk("NFS: open file(%pD2)\n", filp); |
69 | filp->f_path.dentry->d_parent->d_name.name, | ||
70 | filp->f_path.dentry->d_name.name); | ||
71 | 69 | ||
72 | nfs_inc_stats(inode, NFSIOS_VFSOPEN); | 70 | nfs_inc_stats(inode, NFSIOS_VFSOPEN); |
73 | res = nfs_check_flags(filp->f_flags); | 71 | res = nfs_check_flags(filp->f_flags); |
@@ -81,9 +79,7 @@ nfs_file_open(struct inode *inode, struct file *filp) | |||
81 | int | 79 | int |
82 | nfs_file_release(struct inode *inode, struct file *filp) | 80 | nfs_file_release(struct inode *inode, struct file *filp) |
83 | { | 81 | { |
84 | dprintk("NFS: release(%s/%s)\n", | 82 | dprintk("NFS: release(%pD2)\n", filp); |
85 | filp->f_path.dentry->d_parent->d_name.name, | ||
86 | filp->f_path.dentry->d_name.name); | ||
87 | 83 | ||
88 | nfs_inc_stats(inode, NFSIOS_VFSRELEASE); | 84 | nfs_inc_stats(inode, NFSIOS_VFSRELEASE); |
89 | return nfs_release(inode, filp); | 85 | return nfs_release(inode, filp); |
@@ -123,10 +119,8 @@ force_reval: | |||
123 | 119 | ||
124 | loff_t nfs_file_llseek(struct file *filp, loff_t offset, int whence) | 120 | loff_t nfs_file_llseek(struct file *filp, loff_t offset, int whence) |
125 | { | 121 | { |
126 | dprintk("NFS: llseek file(%s/%s, %lld, %d)\n", | 122 | dprintk("NFS: llseek file(%pD2, %lld, %d)\n", |
127 | filp->f_path.dentry->d_parent->d_name.name, | 123 | filp, offset, whence); |
128 | filp->f_path.dentry->d_name.name, | ||
129 | offset, whence); | ||
130 | 124 | ||
131 | /* | 125 | /* |
132 | * whence == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate | 126 | * whence == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate |
@@ -150,12 +144,9 @@ EXPORT_SYMBOL_GPL(nfs_file_llseek); | |||
150 | int | 144 | int |
151 | nfs_file_flush(struct file *file, fl_owner_t id) | 145 | nfs_file_flush(struct file *file, fl_owner_t id) |
152 | { | 146 | { |
153 | struct dentry *dentry = file->f_path.dentry; | 147 | struct inode *inode = file_inode(file); |
154 | struct inode *inode = dentry->d_inode; | ||
155 | 148 | ||
156 | dprintk("NFS: flush(%s/%s)\n", | 149 | dprintk("NFS: flush(%pD2)\n", file); |
157 | dentry->d_parent->d_name.name, | ||
158 | dentry->d_name.name); | ||
159 | 150 | ||
160 | nfs_inc_stats(inode, NFSIOS_VFSFLUSH); | 151 | nfs_inc_stats(inode, NFSIOS_VFSFLUSH); |
161 | if ((file->f_mode & FMODE_WRITE) == 0) | 152 | if ((file->f_mode & FMODE_WRITE) == 0) |
@@ -177,15 +168,14 @@ ssize_t | |||
177 | nfs_file_read(struct kiocb *iocb, const struct iovec *iov, | 168 | nfs_file_read(struct kiocb *iocb, const struct iovec *iov, |
178 | unsigned long nr_segs, loff_t pos) | 169 | unsigned long nr_segs, loff_t pos) |
179 | { | 170 | { |
180 | struct dentry * dentry = iocb->ki_filp->f_path.dentry; | 171 | struct inode *inode = file_inode(iocb->ki_filp); |
181 | struct inode * inode = dentry->d_inode; | ||
182 | ssize_t result; | 172 | ssize_t result; |
183 | 173 | ||
184 | if (iocb->ki_filp->f_flags & O_DIRECT) | 174 | if (iocb->ki_filp->f_flags & O_DIRECT) |
185 | return nfs_file_direct_read(iocb, iov, nr_segs, pos, true); | 175 | return nfs_file_direct_read(iocb, iov, nr_segs, pos, true); |
186 | 176 | ||
187 | dprintk("NFS: read(%s/%s, %lu@%lu)\n", | 177 | dprintk("NFS: read(%pD2, %lu@%lu)\n", |
188 | dentry->d_parent->d_name.name, dentry->d_name.name, | 178 | iocb->ki_filp, |
189 | (unsigned long) iov_length(iov, nr_segs), (unsigned long) pos); | 179 | (unsigned long) iov_length(iov, nr_segs), (unsigned long) pos); |
190 | 180 | ||
191 | result = nfs_revalidate_mapping(inode, iocb->ki_filp->f_mapping); | 181 | result = nfs_revalidate_mapping(inode, iocb->ki_filp->f_mapping); |
@@ -203,13 +193,11 @@ nfs_file_splice_read(struct file *filp, loff_t *ppos, | |||
203 | struct pipe_inode_info *pipe, size_t count, | 193 | struct pipe_inode_info *pipe, size_t count, |
204 | unsigned int flags) | 194 | unsigned int flags) |
205 | { | 195 | { |
206 | struct dentry *dentry = filp->f_path.dentry; | 196 | struct inode *inode = file_inode(filp); |
207 | struct inode *inode = dentry->d_inode; | ||
208 | ssize_t res; | 197 | ssize_t res; |
209 | 198 | ||
210 | dprintk("NFS: splice_read(%s/%s, %lu@%Lu)\n", | 199 | dprintk("NFS: splice_read(%pD2, %lu@%Lu)\n", |
211 | dentry->d_parent->d_name.name, dentry->d_name.name, | 200 | filp, (unsigned long) count, (unsigned long long) *ppos); |
212 | (unsigned long) count, (unsigned long long) *ppos); | ||
213 | 201 | ||
214 | res = nfs_revalidate_mapping(inode, filp->f_mapping); | 202 | res = nfs_revalidate_mapping(inode, filp->f_mapping); |
215 | if (!res) { | 203 | if (!res) { |
@@ -224,12 +212,10 @@ EXPORT_SYMBOL_GPL(nfs_file_splice_read); | |||
224 | int | 212 | int |
225 | nfs_file_mmap(struct file * file, struct vm_area_struct * vma) | 213 | nfs_file_mmap(struct file * file, struct vm_area_struct * vma) |
226 | { | 214 | { |
227 | struct dentry *dentry = file->f_path.dentry; | 215 | struct inode *inode = file_inode(file); |
228 | struct inode *inode = dentry->d_inode; | ||
229 | int status; | 216 | int status; |
230 | 217 | ||
231 | dprintk("NFS: mmap(%s/%s)\n", | 218 | dprintk("NFS: mmap(%pD2)\n", file); |
232 | dentry->d_parent->d_name.name, dentry->d_name.name); | ||
233 | 219 | ||
234 | /* Note: generic_file_mmap() returns ENOSYS on nommu systems | 220 | /* Note: generic_file_mmap() returns ENOSYS on nommu systems |
235 | * so we call that before revalidating the mapping | 221 | * so we call that before revalidating the mapping |
@@ -258,15 +244,12 @@ EXPORT_SYMBOL_GPL(nfs_file_mmap); | |||
258 | int | 244 | int |
259 | nfs_file_fsync_commit(struct file *file, loff_t start, loff_t end, int datasync) | 245 | nfs_file_fsync_commit(struct file *file, loff_t start, loff_t end, int datasync) |
260 | { | 246 | { |
261 | struct dentry *dentry = file->f_path.dentry; | ||
262 | struct nfs_open_context *ctx = nfs_file_open_context(file); | 247 | struct nfs_open_context *ctx = nfs_file_open_context(file); |
263 | struct inode *inode = dentry->d_inode; | 248 | struct inode *inode = file_inode(file); |
264 | int have_error, do_resend, status; | 249 | int have_error, do_resend, status; |
265 | int ret = 0; | 250 | int ret = 0; |
266 | 251 | ||
267 | dprintk("NFS: fsync file(%s/%s) datasync %d\n", | 252 | dprintk("NFS: fsync file(%pD2) datasync %d\n", file, datasync); |
268 | dentry->d_parent->d_name.name, dentry->d_name.name, | ||
269 | datasync); | ||
270 | 253 | ||
271 | nfs_inc_stats(inode, NFSIOS_VFSFSYNC); | 254 | nfs_inc_stats(inode, NFSIOS_VFSFSYNC); |
272 | do_resend = test_and_clear_bit(NFS_CONTEXT_RESEND_WRITES, &ctx->flags); | 255 | do_resend = test_and_clear_bit(NFS_CONTEXT_RESEND_WRITES, &ctx->flags); |
@@ -371,10 +354,8 @@ static int nfs_write_begin(struct file *file, struct address_space *mapping, | |||
371 | struct page *page; | 354 | struct page *page; |
372 | int once_thru = 0; | 355 | int once_thru = 0; |
373 | 356 | ||
374 | dfprintk(PAGECACHE, "NFS: write_begin(%s/%s(%ld), %u@%lld)\n", | 357 | dfprintk(PAGECACHE, "NFS: write_begin(%pD2(%ld), %u@%lld)\n", |
375 | file->f_path.dentry->d_parent->d_name.name, | 358 | file, mapping->host->i_ino, len, (long long) pos); |
376 | file->f_path.dentry->d_name.name, | ||
377 | mapping->host->i_ino, len, (long long) pos); | ||
378 | 359 | ||
379 | start: | 360 | start: |
380 | /* | 361 | /* |
@@ -414,10 +395,8 @@ static int nfs_write_end(struct file *file, struct address_space *mapping, | |||
414 | struct nfs_open_context *ctx = nfs_file_open_context(file); | 395 | struct nfs_open_context *ctx = nfs_file_open_context(file); |
415 | int status; | 396 | int status; |
416 | 397 | ||
417 | dfprintk(PAGECACHE, "NFS: write_end(%s/%s(%ld), %u@%lld)\n", | 398 | dfprintk(PAGECACHE, "NFS: write_end(%pD2(%ld), %u@%lld)\n", |
418 | file->f_path.dentry->d_parent->d_name.name, | 399 | file, mapping->host->i_ino, len, (long long) pos); |
419 | file->f_path.dentry->d_name.name, | ||
420 | mapping->host->i_ino, len, (long long) pos); | ||
421 | 400 | ||
422 | /* | 401 | /* |
423 | * Zero any uninitialised parts of the page, and then mark the page | 402 | * Zero any uninitialised parts of the page, and then mark the page |
@@ -601,22 +580,21 @@ static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
601 | { | 580 | { |
602 | struct page *page = vmf->page; | 581 | struct page *page = vmf->page; |
603 | struct file *filp = vma->vm_file; | 582 | struct file *filp = vma->vm_file; |
604 | struct dentry *dentry = filp->f_path.dentry; | 583 | struct inode *inode = file_inode(filp); |
605 | unsigned pagelen; | 584 | unsigned pagelen; |
606 | int ret = VM_FAULT_NOPAGE; | 585 | int ret = VM_FAULT_NOPAGE; |
607 | struct address_space *mapping; | 586 | struct address_space *mapping; |
608 | 587 | ||
609 | dfprintk(PAGECACHE, "NFS: vm_page_mkwrite(%s/%s(%ld), offset %lld)\n", | 588 | dfprintk(PAGECACHE, "NFS: vm_page_mkwrite(%pD2(%ld), offset %lld)\n", |
610 | dentry->d_parent->d_name.name, dentry->d_name.name, | 589 | filp, filp->f_mapping->host->i_ino, |
611 | filp->f_mapping->host->i_ino, | ||
612 | (long long)page_offset(page)); | 590 | (long long)page_offset(page)); |
613 | 591 | ||
614 | /* make sure the cache has finished storing the page */ | 592 | /* make sure the cache has finished storing the page */ |
615 | nfs_fscache_wait_on_page_write(NFS_I(dentry->d_inode), page); | 593 | nfs_fscache_wait_on_page_write(NFS_I(inode), page); |
616 | 594 | ||
617 | lock_page(page); | 595 | lock_page(page); |
618 | mapping = page_file_mapping(page); | 596 | mapping = page_file_mapping(page); |
619 | if (mapping != dentry->d_inode->i_mapping) | 597 | if (mapping != inode->i_mapping) |
620 | goto out_unlock; | 598 | goto out_unlock; |
621 | 599 | ||
622 | wait_on_page_writeback(page); | 600 | wait_on_page_writeback(page); |
@@ -659,22 +637,21 @@ static int nfs_need_sync_write(struct file *filp, struct inode *inode) | |||
659 | ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov, | 637 | ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov, |
660 | unsigned long nr_segs, loff_t pos) | 638 | unsigned long nr_segs, loff_t pos) |
661 | { | 639 | { |
662 | struct dentry * dentry = iocb->ki_filp->f_path.dentry; | 640 | struct file *file = iocb->ki_filp; |
663 | struct inode * inode = dentry->d_inode; | 641 | struct inode *inode = file_inode(file); |
664 | unsigned long written = 0; | 642 | unsigned long written = 0; |
665 | ssize_t result; | 643 | ssize_t result; |
666 | size_t count = iov_length(iov, nr_segs); | 644 | size_t count = iov_length(iov, nr_segs); |
667 | 645 | ||
668 | result = nfs_key_timeout_notify(iocb->ki_filp, inode); | 646 | result = nfs_key_timeout_notify(file, inode); |
669 | if (result) | 647 | if (result) |
670 | return result; | 648 | return result; |
671 | 649 | ||
672 | if (iocb->ki_filp->f_flags & O_DIRECT) | 650 | if (file->f_flags & O_DIRECT) |
673 | return nfs_file_direct_write(iocb, iov, nr_segs, pos, true); | 651 | return nfs_file_direct_write(iocb, iov, nr_segs, pos, true); |
674 | 652 | ||
675 | dprintk("NFS: write(%s/%s, %lu@%Ld)\n", | 653 | dprintk("NFS: write(%pD2, %lu@%Ld)\n", |
676 | dentry->d_parent->d_name.name, dentry->d_name.name, | 654 | file, (unsigned long) count, (long long) pos); |
677 | (unsigned long) count, (long long) pos); | ||
678 | 655 | ||
679 | result = -EBUSY; | 656 | result = -EBUSY; |
680 | if (IS_SWAPFILE(inode)) | 657 | if (IS_SWAPFILE(inode)) |
@@ -682,8 +659,8 @@ ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov, | |||
682 | /* | 659 | /* |
683 | * O_APPEND implies that we must revalidate the file length. | 660 | * O_APPEND implies that we must revalidate the file length. |
684 | */ | 661 | */ |
685 | if (iocb->ki_filp->f_flags & O_APPEND) { | 662 | if (file->f_flags & O_APPEND) { |
686 | result = nfs_revalidate_file_size(inode, iocb->ki_filp); | 663 | result = nfs_revalidate_file_size(inode, file); |
687 | if (result) | 664 | if (result) |
688 | goto out; | 665 | goto out; |
689 | } | 666 | } |
@@ -697,8 +674,8 @@ ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov, | |||
697 | written = result; | 674 | written = result; |
698 | 675 | ||
699 | /* Return error values for O_DSYNC and IS_SYNC() */ | 676 | /* Return error values for O_DSYNC and IS_SYNC() */ |
700 | if (result >= 0 && nfs_need_sync_write(iocb->ki_filp, inode)) { | 677 | if (result >= 0 && nfs_need_sync_write(file, inode)) { |
701 | int err = vfs_fsync(iocb->ki_filp, 0); | 678 | int err = vfs_fsync(file, 0); |
702 | if (err < 0) | 679 | if (err < 0) |
703 | result = err; | 680 | result = err; |
704 | } | 681 | } |
@@ -717,14 +694,12 @@ ssize_t nfs_file_splice_write(struct pipe_inode_info *pipe, | |||
717 | struct file *filp, loff_t *ppos, | 694 | struct file *filp, loff_t *ppos, |
718 | size_t count, unsigned int flags) | 695 | size_t count, unsigned int flags) |
719 | { | 696 | { |
720 | struct dentry *dentry = filp->f_path.dentry; | 697 | struct inode *inode = file_inode(filp); |
721 | struct inode *inode = dentry->d_inode; | ||
722 | unsigned long written = 0; | 698 | unsigned long written = 0; |
723 | ssize_t ret; | 699 | ssize_t ret; |
724 | 700 | ||
725 | dprintk("NFS splice_write(%s/%s, %lu@%llu)\n", | 701 | dprintk("NFS splice_write(%pD2, %lu@%llu)\n", |
726 | dentry->d_parent->d_name.name, dentry->d_name.name, | 702 | filp, (unsigned long) count, (unsigned long long) *ppos); |
727 | (unsigned long) count, (unsigned long long) *ppos); | ||
728 | 703 | ||
729 | /* | 704 | /* |
730 | * The combination of splice and an O_APPEND destination is disallowed. | 705 | * The combination of splice and an O_APPEND destination is disallowed. |
@@ -883,10 +858,8 @@ int nfs_lock(struct file *filp, int cmd, struct file_lock *fl) | |||
883 | int ret = -ENOLCK; | 858 | int ret = -ENOLCK; |
884 | int is_local = 0; | 859 | int is_local = 0; |
885 | 860 | ||
886 | dprintk("NFS: lock(%s/%s, t=%x, fl=%x, r=%lld:%lld)\n", | 861 | dprintk("NFS: lock(%pD2, t=%x, fl=%x, r=%lld:%lld)\n", |
887 | filp->f_path.dentry->d_parent->d_name.name, | 862 | filp, fl->fl_type, fl->fl_flags, |
888 | filp->f_path.dentry->d_name.name, | ||
889 | fl->fl_type, fl->fl_flags, | ||
890 | (long long)fl->fl_start, (long long)fl->fl_end); | 863 | (long long)fl->fl_start, (long long)fl->fl_end); |
891 | 864 | ||
892 | nfs_inc_stats(inode, NFSIOS_VFSLOCK); | 865 | nfs_inc_stats(inode, NFSIOS_VFSLOCK); |
@@ -923,10 +896,8 @@ int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) | |||
923 | struct inode *inode = filp->f_mapping->host; | 896 | struct inode *inode = filp->f_mapping->host; |
924 | int is_local = 0; | 897 | int is_local = 0; |
925 | 898 | ||
926 | dprintk("NFS: flock(%s/%s, t=%x, fl=%x)\n", | 899 | dprintk("NFS: flock(%pD2, t=%x, fl=%x)\n", |
927 | filp->f_path.dentry->d_parent->d_name.name, | 900 | filp, fl->fl_type, fl->fl_flags); |
928 | filp->f_path.dentry->d_name.name, | ||
929 | fl->fl_type, fl->fl_flags); | ||
930 | 901 | ||
931 | if (!(fl->fl_flags & FL_FLOCK)) | 902 | if (!(fl->fl_flags & FL_FLOCK)) |
932 | return -ENOLCK; | 903 | return -ENOLCK; |
@@ -960,9 +931,7 @@ EXPORT_SYMBOL_GPL(nfs_flock); | |||
960 | */ | 931 | */ |
961 | int nfs_setlease(struct file *file, long arg, struct file_lock **fl) | 932 | int nfs_setlease(struct file *file, long arg, struct file_lock **fl) |
962 | { | 933 | { |
963 | dprintk("NFS: setlease(%s/%s, arg=%ld)\n", | 934 | dprintk("NFS: setlease(%pD2, arg=%ld)\n", file, arg); |
964 | file->f_path.dentry->d_parent->d_name.name, | ||
965 | file->f_path.dentry->d_name.name, arg); | ||
966 | return -EINVAL; | 935 | return -EINVAL; |
967 | } | 936 | } |
968 | EXPORT_SYMBOL_GPL(nfs_setlease); | 937 | EXPORT_SYMBOL_GPL(nfs_setlease); |
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index 348b535cd786..b5a0afc3ee10 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c | |||
@@ -253,9 +253,8 @@ struct vfsmount *nfs_do_submount(struct dentry *dentry, struct nfs_fh *fh, | |||
253 | 253 | ||
254 | dprintk("--> nfs_do_submount()\n"); | 254 | dprintk("--> nfs_do_submount()\n"); |
255 | 255 | ||
256 | dprintk("%s: submounting on %s/%s\n", __func__, | 256 | dprintk("%s: submounting on %pd2\n", __func__, |
257 | dentry->d_parent->d_name.name, | 257 | dentry); |
258 | dentry->d_name.name); | ||
259 | if (page == NULL) | 258 | if (page == NULL) |
260 | goto out; | 259 | goto out; |
261 | devname = nfs_devname(dentry, page, PAGE_SIZE); | 260 | devname = nfs_devname(dentry, page, PAGE_SIZE); |
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 90cb10d7b693..01b6f6a49d16 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -321,7 +321,7 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, | |||
321 | umode_t mode = sattr->ia_mode; | 321 | umode_t mode = sattr->ia_mode; |
322 | int status = -ENOMEM; | 322 | int status = -ENOMEM; |
323 | 323 | ||
324 | dprintk("NFS call create %s\n", dentry->d_name.name); | 324 | dprintk("NFS call create %pd\n", dentry); |
325 | 325 | ||
326 | data = nfs3_alloc_createdata(); | 326 | data = nfs3_alloc_createdata(); |
327 | if (data == NULL) | 327 | if (data == NULL) |
@@ -548,7 +548,7 @@ nfs3_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page, | |||
548 | if (len > NFS3_MAXPATHLEN) | 548 | if (len > NFS3_MAXPATHLEN) |
549 | return -ENAMETOOLONG; | 549 | return -ENAMETOOLONG; |
550 | 550 | ||
551 | dprintk("NFS call symlink %s\n", dentry->d_name.name); | 551 | dprintk("NFS call symlink %pd\n", dentry); |
552 | 552 | ||
553 | data = nfs3_alloc_createdata(); | 553 | data = nfs3_alloc_createdata(); |
554 | if (data == NULL) | 554 | if (data == NULL) |
@@ -576,7 +576,7 @@ nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr) | |||
576 | umode_t mode = sattr->ia_mode; | 576 | umode_t mode = sattr->ia_mode; |
577 | int status = -ENOMEM; | 577 | int status = -ENOMEM; |
578 | 578 | ||
579 | dprintk("NFS call mkdir %s\n", dentry->d_name.name); | 579 | dprintk("NFS call mkdir %pd\n", dentry); |
580 | 580 | ||
581 | sattr->ia_mode &= ~current_umask(); | 581 | sattr->ia_mode &= ~current_umask(); |
582 | 582 | ||
@@ -695,7 +695,7 @@ nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr, | |||
695 | umode_t mode = sattr->ia_mode; | 695 | umode_t mode = sattr->ia_mode; |
696 | int status = -ENOMEM; | 696 | int status = -ENOMEM; |
697 | 697 | ||
698 | dprintk("NFS call mknod %s %u:%u\n", dentry->d_name.name, | 698 | dprintk("NFS call mknod %pd %u:%u\n", dentry, |
699 | MAJOR(rdev), MINOR(rdev)); | 699 | MAJOR(rdev), MINOR(rdev)); |
700 | 700 | ||
701 | sattr->ia_mode &= ~current_umask(); | 701 | sattr->ia_mode &= ~current_umask(); |
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index 77efaf15ec90..9c8f09a2156f 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c | |||
@@ -31,9 +31,7 @@ nfs4_file_open(struct inode *inode, struct file *filp) | |||
31 | * -EOPENSTALE. The VFS will retry the lookup/create/open. | 31 | * -EOPENSTALE. The VFS will retry the lookup/create/open. |
32 | */ | 32 | */ |
33 | 33 | ||
34 | dprintk("NFS: open file(%s/%s)\n", | 34 | dprintk("NFS: open file(%pd2)\n", dentry); |
35 | dentry->d_parent->d_name.name, | ||
36 | dentry->d_name.name); | ||
37 | 35 | ||
38 | if ((openflags & O_ACCMODE) == 3) | 36 | if ((openflags & O_ACCMODE) == 3) |
39 | openflags--; | 37 | openflags--; |
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 2288cd3c9278..049b9fb0d2c9 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c | |||
@@ -283,8 +283,7 @@ static struct vfsmount *nfs_follow_referral(struct dentry *dentry, | |||
283 | if (locations == NULL || locations->nlocations <= 0) | 283 | if (locations == NULL || locations->nlocations <= 0) |
284 | goto out; | 284 | goto out; |
285 | 285 | ||
286 | dprintk("%s: referral at %s/%s\n", __func__, | 286 | dprintk("%s: referral at %pd2\n", __func__, dentry); |
287 | dentry->d_parent->d_name.name, dentry->d_name.name); | ||
288 | 287 | ||
289 | page = (char *) __get_free_page(GFP_USER); | 288 | page = (char *) __get_free_page(GFP_USER); |
290 | if (!page) | 289 | if (!page) |
@@ -348,8 +347,8 @@ static struct vfsmount *nfs_do_refmount(struct rpc_clnt *client, struct dentry * | |||
348 | mnt = ERR_PTR(-ENOENT); | 347 | mnt = ERR_PTR(-ENOENT); |
349 | 348 | ||
350 | parent = dget_parent(dentry); | 349 | parent = dget_parent(dentry); |
351 | dprintk("%s: getting locations for %s/%s\n", | 350 | dprintk("%s: getting locations for %pd2\n", |
352 | __func__, parent->d_name.name, dentry->d_name.name); | 351 | __func__, dentry); |
353 | 352 | ||
354 | err = nfs4_proc_fs_locations(client, parent->d_inode, &dentry->d_name, fs_locations, page); | 353 | err = nfs4_proc_fs_locations(client, parent->d_inode, &dentry->d_name, fs_locations, page); |
355 | dput(parent); | 354 | dput(parent); |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index d53d6785cba2..75e46bbf7f41 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3738,9 +3738,8 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, | |||
3738 | }; | 3738 | }; |
3739 | int status; | 3739 | int status; |
3740 | 3740 | ||
3741 | dprintk("%s: dentry = %s/%s, cookie = %Lu\n", __func__, | 3741 | dprintk("%s: dentry = %pd2, cookie = %Lu\n", __func__, |
3742 | dentry->d_parent->d_name.name, | 3742 | dentry, |
3743 | dentry->d_name.name, | ||
3744 | (unsigned long long)cookie); | 3743 | (unsigned long long)cookie); |
3745 | nfs4_setup_readdir(cookie, NFS_I(dir)->cookieverf, dentry, &args); | 3744 | nfs4_setup_readdir(cookie, NFS_I(dir)->cookieverf, dentry, &args); |
3746 | res.pgbase = args.pgbase; | 3745 | res.pgbase = args.pgbase; |
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index a8f57c728df5..fddbba2d9eff 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
@@ -235,7 +235,7 @@ nfs_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, | |||
235 | }; | 235 | }; |
236 | int status = -ENOMEM; | 236 | int status = -ENOMEM; |
237 | 237 | ||
238 | dprintk("NFS call create %s\n", dentry->d_name.name); | 238 | dprintk("NFS call create %pd\n", dentry); |
239 | data = nfs_alloc_createdata(dir, dentry, sattr); | 239 | data = nfs_alloc_createdata(dir, dentry, sattr); |
240 | if (data == NULL) | 240 | if (data == NULL) |
241 | goto out; | 241 | goto out; |
@@ -265,7 +265,7 @@ nfs_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr, | |||
265 | umode_t mode; | 265 | umode_t mode; |
266 | int status = -ENOMEM; | 266 | int status = -ENOMEM; |
267 | 267 | ||
268 | dprintk("NFS call mknod %s\n", dentry->d_name.name); | 268 | dprintk("NFS call mknod %pd\n", dentry); |
269 | 269 | ||
270 | mode = sattr->ia_mode; | 270 | mode = sattr->ia_mode; |
271 | if (S_ISFIFO(mode)) { | 271 | if (S_ISFIFO(mode)) { |
@@ -423,7 +423,7 @@ nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page, | |||
423 | }; | 423 | }; |
424 | int status = -ENAMETOOLONG; | 424 | int status = -ENAMETOOLONG; |
425 | 425 | ||
426 | dprintk("NFS call symlink %s\n", dentry->d_name.name); | 426 | dprintk("NFS call symlink %pd\n", dentry); |
427 | 427 | ||
428 | if (len > NFS2_MAXPATHLEN) | 428 | if (len > NFS2_MAXPATHLEN) |
429 | goto out; | 429 | goto out; |
@@ -462,7 +462,7 @@ nfs_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr) | |||
462 | }; | 462 | }; |
463 | int status = -ENOMEM; | 463 | int status = -ENOMEM; |
464 | 464 | ||
465 | dprintk("NFS call mkdir %s\n", dentry->d_name.name); | 465 | dprintk("NFS call mkdir %pd\n", dentry); |
466 | data = nfs_alloc_createdata(dir, dentry, sattr); | 466 | data = nfs_alloc_createdata(dir, dentry, sattr); |
467 | if (data == NULL) | 467 | if (data == NULL) |
468 | goto out; | 468 | goto out; |
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c index bb939edd4c99..8285de9eaad2 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c | |||
@@ -495,9 +495,8 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry) | |||
495 | struct rpc_task *task; | 495 | struct rpc_task *task; |
496 | int error = -EIO; | 496 | int error = -EIO; |
497 | 497 | ||
498 | dfprintk(VFS, "NFS: silly-rename(%s/%s, ct=%d)\n", | 498 | dfprintk(VFS, "NFS: silly-rename(%pd2, ct=%d)\n", |
499 | dentry->d_parent->d_name.name, dentry->d_name.name, | 499 | dentry, d_count(dentry)); |
500 | d_count(dentry)); | ||
501 | nfs_inc_stats(dir, NFSIOS_SILLYRENAME); | 500 | nfs_inc_stats(dir, NFSIOS_SILLYRENAME); |
502 | 501 | ||
503 | /* | 502 | /* |
@@ -522,8 +521,8 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry) | |||
522 | SILLYNAME_FILEID_LEN, fileid, | 521 | SILLYNAME_FILEID_LEN, fileid, |
523 | SILLYNAME_COUNTER_LEN, sillycounter); | 522 | SILLYNAME_COUNTER_LEN, sillycounter); |
524 | 523 | ||
525 | dfprintk(VFS, "NFS: trying to rename %s to %s\n", | 524 | dfprintk(VFS, "NFS: trying to rename %pd to %s\n", |
526 | dentry->d_name.name, silly); | 525 | dentry, silly); |
527 | 526 | ||
528 | sdentry = lookup_one_len(silly, dentry->d_parent, slen); | 527 | sdentry = lookup_one_len(silly, dentry->d_parent, slen); |
529 | /* | 528 | /* |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index ac1dc331ba31..c1d548211c31 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -954,10 +954,8 @@ int nfs_updatepage(struct file *file, struct page *page, | |||
954 | 954 | ||
955 | nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE); | 955 | nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE); |
956 | 956 | ||
957 | dprintk("NFS: nfs_updatepage(%s/%s %d@%lld)\n", | 957 | dprintk("NFS: nfs_updatepage(%pD2 %d@%lld)\n", |
958 | file->f_path.dentry->d_parent->d_name.name, | 958 | file, count, (long long)(page_file_offset(page) + offset)); |
959 | file->f_path.dentry->d_name.name, count, | ||
960 | (long long)(page_file_offset(page) + offset)); | ||
961 | 959 | ||
962 | if (nfs_can_extend_write(file, page, inode)) { | 960 | if (nfs_can_extend_write(file, page, inode)) { |
963 | count = max(count + offset, nfs_page_length(page)); | 961 | count = max(count + offset, nfs_page_length(page)); |