aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/namei.c')
-rw-r--r--fs/jfs/namei.c49
1 files changed, 17 insertions, 32 deletions
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index eaaf2b511e89..03787ef6a118 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1456,34 +1456,23 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
1456 ino_t inum; 1456 ino_t inum;
1457 struct inode *ip; 1457 struct inode *ip;
1458 struct component_name key; 1458 struct component_name key;
1459 const char *name = dentry->d_name.name;
1460 int len = dentry->d_name.len;
1461 int rc; 1459 int rc;
1462 1460
1463 jfs_info("jfs_lookup: name = %s", name); 1461 jfs_info("jfs_lookup: name = %s", dentry->d_name.name);
1464 1462
1465 if ((name[0] == '.') && (len == 1)) 1463 if ((rc = get_UCSname(&key, dentry)))
1466 inum = dip->i_ino; 1464 return ERR_PTR(rc);
1467 else if (strcmp(name, "..") == 0) 1465 rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP);
1468 inum = PARENT(dip); 1466 free_UCSname(&key);
1469 else { 1467 if (rc == -ENOENT) {
1470 if ((rc = get_UCSname(&key, dentry))) 1468 ip = NULL;
1471 return ERR_PTR(rc); 1469 } else if (rc) {
1472 rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP); 1470 jfs_err("jfs_lookup: dtSearch returned %d", rc);
1473 free_UCSname(&key); 1471 ip = ERR_PTR(rc);
1474 if (rc == -ENOENT) { 1472 } else {
1475 d_add(dentry, NULL); 1473 ip = jfs_iget(dip->i_sb, inum);
1476 return NULL; 1474 if (IS_ERR(ip))
1477 } else if (rc) { 1475 jfs_err("jfs_lookup: iget failed on inum %d", (uint)inum);
1478 jfs_err("jfs_lookup: dtSearch returned %d", rc);
1479 return ERR_PTR(rc);
1480 }
1481 }
1482
1483 ip = jfs_iget(dip->i_sb, inum);
1484 if (IS_ERR(ip)) {
1485 jfs_err("jfs_lookup: iget failed on inum %d", (uint) inum);
1486 return ERR_CAST(ip);
1487 } 1476 }
1488 1477
1489 return d_splice_alias(ip, dentry); 1478 return d_splice_alias(ip, dentry);
@@ -1597,8 +1586,6 @@ out:
1597 1586
1598static int jfs_ci_revalidate(struct dentry *dentry, struct nameidata *nd) 1587static int jfs_ci_revalidate(struct dentry *dentry, struct nameidata *nd)
1599{ 1588{
1600 if (nd && nd->flags & LOOKUP_RCU)
1601 return -ECHILD;
1602 /* 1589 /*
1603 * This is not negative dentry. Always valid. 1590 * This is not negative dentry. Always valid.
1604 * 1591 *
@@ -1624,10 +1611,8 @@ static int jfs_ci_revalidate(struct dentry *dentry, struct nameidata *nd)
1624 * case sensitive name which is specified by user if this is 1611 * case sensitive name which is specified by user if this is
1625 * for creation. 1612 * for creation.
1626 */ 1613 */
1627 if (!(nd->flags & (LOOKUP_CONTINUE | LOOKUP_PARENT))) { 1614 if (nd->flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET))
1628 if (nd->flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET)) 1615 return 0;
1629 return 0;
1630 }
1631 return 1; 1616 return 1;
1632} 1617}
1633 1618