aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-10 16:14:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-10 22:54:35 -0400
commit26fe575028703948880fce4355a210c76bb0536e (patch)
tree0a7d04289e1eb1f1739659ebc9498d40f2add5da /fs/nfs
parentee983e89670704b2a05e897b161f2674a42d1508 (diff)
vfs: make it possible to access the dentry hash/len as one 64-bit entry
This allows comparing hash and len in one operation on 64-bit architectures. Right now only __d_lookup_rcu() takes advantage of this, since that is the case we care most about. The use of anonymous struct/unions hides the alternate 64-bit approach from most users, the exception being a few cases where we initialize a 'struct qstr' with a static initializer. This makes the problematic cases use a new QSTR_INIT() helper function for that (but initializing just the name pointer with a "{ .name = xyzzy }" initializer remains valid, as does just copying another qstr structure). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/dir.c5
-rw-r--r--fs/nfs/nfs3proc.c3
-rw-r--r--fs/nfs/nfs4proc.c3
-rw-r--r--fs/nfs/proc.c3
4 files changed, 4 insertions, 10 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 8789210c6905..eedd24d0ad2e 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -477,10 +477,7 @@ different:
477static 477static
478void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry) 478void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry)
479{ 479{
480 struct qstr filename = { 480 struct qstr filename = QSTR_INIT(entry->name, entry->len);
481 .len = entry->len,
482 .name = entry->name,
483 };
484 struct dentry *dentry; 481 struct dentry *dentry;
485 struct dentry *alias; 482 struct dentry *alias;
486 struct inode *dir = parent->d_inode; 483 struct inode *dir = parent->d_inode;
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 5242eae6711a..75c68299358e 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -398,8 +398,7 @@ nfs3_proc_remove(struct inode *dir, struct qstr *name)
398{ 398{
399 struct nfs_removeargs arg = { 399 struct nfs_removeargs arg = {
400 .fh = NFS_FH(dir), 400 .fh = NFS_FH(dir),
401 .name.len = name->len, 401 .name = *name,
402 .name.name = name->name,
403 }; 402 };
404 struct nfs_removeres res; 403 struct nfs_removeres res;
405 struct rpc_message msg = { 404 struct rpc_message msg = {
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 99650aaf8937..ab985f6f0da8 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2782,8 +2782,7 @@ static int _nfs4_proc_remove(struct inode *dir, struct qstr *name)
2782 struct nfs_server *server = NFS_SERVER(dir); 2782 struct nfs_server *server = NFS_SERVER(dir);
2783 struct nfs_removeargs args = { 2783 struct nfs_removeargs args = {
2784 .fh = NFS_FH(dir), 2784 .fh = NFS_FH(dir),
2785 .name.len = name->len, 2785 .name = *name,
2786 .name.name = name->name,
2787 .bitmask = server->attr_bitmask, 2786 .bitmask = server->attr_bitmask,
2788 }; 2787 };
2789 struct nfs_removeres res = { 2788 struct nfs_removeres res = {
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index b63b6f4d14fb..d6408b6437de 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -335,8 +335,7 @@ nfs_proc_remove(struct inode *dir, struct qstr *name)
335{ 335{
336 struct nfs_removeargs arg = { 336 struct nfs_removeargs arg = {
337 .fh = NFS_FH(dir), 337 .fh = NFS_FH(dir),
338 .name.len = name->len, 338 .name = *name,
339 .name.name = name->name,
340 }; 339 };
341 struct rpc_message msg = { 340 struct rpc_message msg = {
342 .rpc_proc = &nfs_procedures[NFSPROC_REMOVE], 341 .rpc_proc = &nfs_procedures[NFSPROC_REMOVE],