File tree Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Original file line number Diff line number Diff line change 26
26
static int qnx4_match (int len , const char * name ,
27
27
struct buffer_head * bh , unsigned long * offset )
28
28
{
29
- struct qnx4_inode_entry * de ;
30
- int namelen , thislen ;
29
+ union qnx4_directory_entry * de ;
30
+ const char * fname ;
31
+ int fnamelen ;
31
32
32
33
if (bh == NULL ) {
33
34
printk (KERN_WARNING "qnx4: matching unassigned buffer !\n" );
34
35
return 0 ;
35
36
}
36
- de = (struct qnx4_inode_entry * ) (bh -> b_data + * offset );
37
+ de = (union qnx4_directory_entry * ) (bh -> b_data + * offset );
37
38
* offset += QNX4_DIR_ENTRY_SIZE ;
38
- if ((de -> di_status & QNX4_FILE_LINK ) != 0 ) {
39
- namelen = QNX4_NAME_MAX ;
40
- } else {
41
- namelen = QNX4_SHORT_NAME_MAX ;
42
- }
43
- thislen = strlen ( de -> di_fname );
44
- if ( thislen > namelen )
45
- thislen = namelen ;
46
- if (len != thislen ) {
39
+
40
+ fname = get_entry_fname (de , & fnamelen );
41
+ if (!fname || len != fnamelen )
47
42
return 0 ;
48
- }
49
- if (strncmp (name , de -> di_fname , len ) == 0 ) {
50
- if ((de -> di_status & (QNX4_FILE_USED |QNX4_FILE_LINK )) != 0 ) {
51
- return 1 ;
52
- }
53
- }
43
+
44
+ if (strncmp (name , fname , len ) == 0 )
45
+ return 1 ;
46
+
54
47
return 0 ;
55
48
}
56
49
You can’t perform that action at this time.
0 commit comments