aboutsummaryrefslogtreecommitdiffstats
path: root/fs/qnx4/namei.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /fs/qnx4/namei.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'fs/qnx4/namei.c')
-rw-r--r--fs/qnx4/namei.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/qnx4/namei.c b/fs/qnx4/namei.c
index d024505ba00..275327b5615 100644
--- a/fs/qnx4/namei.c
+++ b/fs/qnx4/namei.c
@@ -39,6 +39,10 @@ static int qnx4_match(int len, const char *name,
39 } else { 39 } else {
40 namelen = QNX4_SHORT_NAME_MAX; 40 namelen = QNX4_SHORT_NAME_MAX;
41 } 41 }
42 /* "" means "." ---> so paths like "/usr/lib//libc.a" work */
43 if (!len && (de->di_fname[0] == '.') && (de->di_fname[1] == '\0')) {
44 return 1;
45 }
42 thislen = strlen( de->di_fname ); 46 thislen = strlen( de->di_fname );
43 if ( thislen > namelen ) 47 if ( thislen > namelen )
44 thislen = namelen; 48 thislen = namelen;
@@ -68,9 +72,7 @@ static struct buffer_head *qnx4_find_entry(int len, struct inode *dir,
68 block = offset = blkofs = 0; 72 block = offset = blkofs = 0;
69 while (blkofs * QNX4_BLOCK_SIZE + offset < dir->i_size) { 73 while (blkofs * QNX4_BLOCK_SIZE + offset < dir->i_size) {
70 if (!bh) { 74 if (!bh) {
71 block = qnx4_block_map(dir, blkofs); 75 bh = qnx4_bread(dir, blkofs, 0);
72 if (block)
73 bh = sb_bread(dir->i_sb, block);
74 if (!bh) { 76 if (!bh) {
75 blkofs++; 77 blkofs++;
76 continue; 78 continue;
@@ -78,6 +80,7 @@ static struct buffer_head *qnx4_find_entry(int len, struct inode *dir,
78 } 80 }
79 *res_dir = (struct qnx4_inode_entry *) (bh->b_data + offset); 81 *res_dir = (struct qnx4_inode_entry *) (bh->b_data + offset);
80 if (qnx4_match(len, name, bh, &offset)) { 82 if (qnx4_match(len, name, bh, &offset)) {
83 block = qnx4_block_map( dir, blkofs );
81 *ino = block * QNX4_INODES_PER_BLOCK + 84 *ino = block * QNX4_INODES_PER_BLOCK +
82 (offset / QNX4_DIR_ENTRY_SIZE) - 1; 85 (offset / QNX4_DIR_ENTRY_SIZE) - 1;
83 return bh; 86 return bh;
@@ -95,7 +98,7 @@ static struct buffer_head *qnx4_find_entry(int len, struct inode *dir,
95 return NULL; 98 return NULL;
96} 99}
97 100
98struct dentry * qnx4_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) 101struct dentry * qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
99{ 102{
100 int ino; 103 int ino;
101 struct qnx4_inode_entry *de; 104 struct qnx4_inode_entry *de;