namei.c (42249094f79422fbf5ed4b54eeb48ff096809b8f) | namei.c (f643ff550afbc82a2bc7026f4a6d64427e4fbc99) |
---|---|
1/* 2 * linux/fs/isofs/namei.c 3 * 4 * (C) 1992 Eric Youngdale Modified for ISO 9660 filesystem. 5 * 6 * (C) 1991 Linus Torvalds - minix filesystem 7 */ 8 --- 4 unchanged lines hidden (view full) --- 13 * ok, we cannot use strncmp, as the name is not in our data space. 14 * Thus we'll have to use isofs_match. No big problem. Match also makes 15 * some sanity tests. 16 */ 17static int 18isofs_cmp(struct dentry *dentry, const char *compare, int dlen) 19{ 20 struct qstr qstr; | 1/* 2 * linux/fs/isofs/namei.c 3 * 4 * (C) 1992 Eric Youngdale Modified for ISO 9660 filesystem. 5 * 6 * (C) 1991 Linus Torvalds - minix filesystem 7 */ 8 --- 4 unchanged lines hidden (view full) --- 13 * ok, we cannot use strncmp, as the name is not in our data space. 14 * Thus we'll have to use isofs_match. No big problem. Match also makes 15 * some sanity tests. 16 */ 17static int 18isofs_cmp(struct dentry *dentry, const char *compare, int dlen) 19{ 20 struct qstr qstr; |
21 22 if (!compare) 23 return 1; 24 25 /* check special "." and ".." files */ 26 if (dlen == 1) { 27 /* "." */ 28 if (compare[0] == 0) { 29 if (!dentry->d_name.len) 30 return 0; 31 compare = "."; 32 } else if (compare[0] == 1) { 33 compare = ".."; 34 dlen = 2; 35 } 36 } 37 | |
38 qstr.name = compare; 39 qstr.len = dlen; 40 return dentry->d_op->d_compare(NULL, NULL, dentry->d_name.len, dentry->d_name.name, &qstr); 41} 42 43/* 44 * isofs_find_entry() 45 * --- 95 unchanged lines hidden (view full) --- 141 * respectively, is set 142 */ 143 match = 0; 144 if (dlen > 0 && 145 (!sbi->s_hide || 146 (!(de->flags[-sbi->s_high_sierra] & 1))) && 147 (sbi->s_showassoc || 148 (!(de->flags[-sbi->s_high_sierra] & 4)))) { | 21 qstr.name = compare; 22 qstr.len = dlen; 23 return dentry->d_op->d_compare(NULL, NULL, dentry->d_name.len, dentry->d_name.name, &qstr); 24} 25 26/* 27 * isofs_find_entry() 28 * --- 95 unchanged lines hidden (view full) --- 124 * respectively, is set 125 */ 126 match = 0; 127 if (dlen > 0 && 128 (!sbi->s_hide || 129 (!(de->flags[-sbi->s_high_sierra] & 1))) && 130 (sbi->s_showassoc || 131 (!(de->flags[-sbi->s_high_sierra] & 4)))) { |
149 match = (isofs_cmp(dentry, dpnt, dlen) == 0); | 132 if (dpnt && (dlen > 1 || dpnt[0] > 1)) 133 match = (isofs_cmp(dentry, dpnt, dlen) == 0); |
150 } 151 if (match) { 152 isofs_normalize_block_and_offset(de, 153 &block_saved, 154 &offset_saved); 155 *block_rv = block_saved; 156 *offset_rv = offset_saved; 157 brelse(bh); --- 29 unchanged lines hidden --- | 134 } 135 if (match) { 136 isofs_normalize_block_and_offset(de, 137 &block_saved, 138 &offset_saved); 139 *block_rv = block_saved; 140 *offset_rv = offset_saved; 141 brelse(bh); --- 29 unchanged lines hidden --- |