|
|
| version 1.161, 2007/12/20 15:08:23 | version 1.162, 2008/01/08 05:14:19 |
|---|---|
| Line 262 xfs_file_readdir( | Line 262 xfs_file_readdir( |
| #else | #else |
| struct hack_dirent { | struct hack_dirent { |
| int namlen; | |
| loff_t offset; | |
| u64 ino; | u64 ino; |
| loff_t offset; | |
| int namlen; | |
| unsigned int d_type; | unsigned int d_type; |
| char name[]; | char name[]; |
| }; | }; |
| Line 286 xfs_hack_filldir( | Line 286 xfs_hack_filldir( |
| { | { |
| struct hack_callback *buf = __buf; | struct hack_callback *buf = __buf; |
| struct hack_dirent *de = (struct hack_dirent *)(buf->dirent + buf->used); | struct hack_dirent *de = (struct hack_dirent *)(buf->dirent + buf->used); |
| unsigned int reclen; | |
| if (buf->used + sizeof(struct hack_dirent) + namlen > buf->len) | reclen = ALIGN(sizeof(struct hack_dirent) + namlen, sizeof(u64)); |
| if (buf->used + reclen > buf->len) | |
| return -EINVAL; | return -EINVAL; |
| de->namlen = namlen; | de->namlen = namlen; |
| Line 295 xfs_hack_filldir( | Line 297 xfs_hack_filldir( |
| de->ino = ino; | de->ino = ino; |
| de->d_type = d_type; | de->d_type = d_type; |
| memcpy(de->name, name, namlen); | memcpy(de->name, name, namlen); |
| buf->used += sizeof(struct hack_dirent) + namlen; | buf->used += reclen; |
| return 0; | return 0; |
| } | } |
| Line 335 xfs_file_readdir( | Line 337 xfs_file_readdir( |
| offset = filp->f_pos; | offset = filp->f_pos; |
| while (!eof) { | while (!eof) { |
| int reclen; | unsigned int reclen; |
| start_offset = offset; | start_offset = offset; |
| buf.used = 0; | buf.used = 0; |
| Line 356 xfs_file_readdir( | Line 359 xfs_file_readdir( |
| goto done; | goto done; |
| } | } |
| reclen = sizeof(struct hack_dirent) + de->namlen; | reclen = ALIGN(sizeof(struct hack_dirent) + de->namlen, |
| sizeof(u64)); | |
| size -= reclen; | size -= reclen; |
| de = (struct hack_dirent *)((char *)de + reclen); | de = (struct hack_dirent *)((char *)de + reclen); |
| curr_offset = de->offset /* & 0x7fffffff */; | curr_offset = de->offset /* & 0x7fffffff */; |