summaryrefslogtreecommitdiffstats
path: root/fs/ubifs
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/ubifs
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/ubifs')
-rw-r--r--fs/ubifs/tnc.c2
-rw-r--r--fs/ubifs/xattr.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c
index 16ad84d8402f..abd51331345e 100644
--- a/fs/ubifs/tnc.c
+++ b/fs/ubifs/tnc.c
@@ -2361,7 +2361,7 @@ int ubifs_tnc_add_nm(struct ubifs_info *c, const union ubifs_key *key,
2361 * by passing 'ubifs_tnc_remove_nm()' the same key but 2361 * by passing 'ubifs_tnc_remove_nm()' the same key but
2362 * an unmatchable name. 2362 * an unmatchable name.
2363 */ 2363 */
2364 struct qstr noname = { .len = 0, .name = "" }; 2364 struct qstr noname = { .name = "" };
2365 2365
2366 err = dbg_check_tnc(c, 0); 2366 err = dbg_check_tnc(c, 0);
2367 mutex_unlock(&c->tnc_mutex); 2367 mutex_unlock(&c->tnc_mutex);
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
index 85b272268754..7a8bafa19c9f 100644
--- a/fs/ubifs/xattr.c
+++ b/fs/ubifs/xattr.c
@@ -298,7 +298,7 @@ int ubifs_setxattr(struct dentry *dentry, const char *name,
298{ 298{
299 struct inode *inode, *host = dentry->d_inode; 299 struct inode *inode, *host = dentry->d_inode;
300 struct ubifs_info *c = host->i_sb->s_fs_info; 300 struct ubifs_info *c = host->i_sb->s_fs_info;
301 struct qstr nm = { .name = name, .len = strlen(name) }; 301 struct qstr nm = QSTR_INIT(name, strlen(name));
302 struct ubifs_dent_node *xent; 302 struct ubifs_dent_node *xent;
303 union ubifs_key key; 303 union ubifs_key key;
304 int err, type; 304 int err, type;
@@ -361,7 +361,7 @@ ssize_t ubifs_getxattr(struct dentry *dentry, const char *name, void *buf,
361{ 361{
362 struct inode *inode, *host = dentry->d_inode; 362 struct inode *inode, *host = dentry->d_inode;
363 struct ubifs_info *c = host->i_sb->s_fs_info; 363 struct ubifs_info *c = host->i_sb->s_fs_info;
364 struct qstr nm = { .name = name, .len = strlen(name) }; 364 struct qstr nm = QSTR_INIT(name, strlen(name));
365 struct ubifs_inode *ui; 365 struct ubifs_inode *ui;
366 struct ubifs_dent_node *xent; 366 struct ubifs_dent_node *xent;
367 union ubifs_key key; 367 union ubifs_key key;
@@ -524,7 +524,7 @@ int ubifs_removexattr(struct dentry *dentry, const char *name)
524{ 524{
525 struct inode *inode, *host = dentry->d_inode; 525 struct inode *inode, *host = dentry->d_inode;
526 struct ubifs_info *c = host->i_sb->s_fs_info; 526 struct ubifs_info *c = host->i_sb->s_fs_info;
527 struct qstr nm = { .name = name, .len = strlen(name) }; 527 struct qstr nm = QSTR_INIT(name, strlen(name));
528 struct ubifs_dent_node *xent; 528 struct ubifs_dent_node *xent;
529 union ubifs_key key; 529 union ubifs_key key;
530 int err; 530 int err;