1478 |
error_t err; |
error_t err; |
1479 |
FUNC_PROLOGUE_NODE("get_dirents_readdir", dir); |
FUNC_PROLOGUE_NODE("get_dirents_readdir", dir); |
1480 |
|
|
1481 |
if(! (fuse_ops |
if(! (fuse_ops && fuse_ops->readdir)) |
|
&& fuse_ops->readdir |
|
|
&& fuse_ops->opendir |
|
|
&& fuse_ops->releasedir)) |
|
1482 |
FUNC_RETURN(EOPNOTSUPP); |
FUNC_RETURN(EOPNOTSUPP); |
1483 |
|
|
1484 |
fuse_dirh_t handle; |
fuse_dirh_t handle; |
1508 |
handle->parent = dir->nn; |
handle->parent = dir->nn; |
1509 |
handle->hdrpos = (struct dirent*) *data; |
handle->hdrpos = (struct dirent*) *data; |
1510 |
|
|
1511 |
if((err = fuse_ops->opendir(dir->nn->path, &dir->nn->info))) |
if(fuse_ops->opendir |
1512 |
|
&& (err = fuse_ops->opendir(dir->nn->path, &dir->nn->info))) |
1513 |
goto out; |
goto out; |
1514 |
|
|
1515 |
if((err = fuse_ops->readdir(dir->nn->path, handle, |
if((err = fuse_ops->readdir(dir->nn->path, handle, |
1520 |
goto out; |
goto out; |
1521 |
} |
} |
1522 |
|
|
1523 |
if((err = fuse_ops->releasedir(dir->nn->path, &dir->nn->info))) |
if(fuse_ops->releasedir |
1524 |
|
&& (err = fuse_ops->releasedir(dir->nn->path, &dir->nn->info))) |
1525 |
goto out; |
goto out; |
1526 |
|
|
1527 |
*data_len -= handle->size; /* subtract number of bytes left in the |
*data_len -= handle->size; /* subtract number of bytes left in the |