@@ -542,8 +542,8 @@ static const struct file_operations hppfs_file_fops = {
542542};
543543
544544struct hppfs_dirent {
545- void * vfs_dirent ;
546- filldir_t filldir ;
545+ struct dir_context ctx ;
546+ struct dir_context * caller ;
547547 struct dentry * dentry ;
548548};
549549
@@ -555,34 +555,29 @@ static int hppfs_filldir(void *d, const char *name, int size,
555555 if (file_removed (dirent -> dentry , name ))
556556 return 0 ;
557557
558- return ( * dirent -> filldir )( dirent -> vfs_dirent , name , size , offset ,
559- inode , type );
558+ dirent -> caller -> pos = dirent -> ctx . pos ;
559+ return ! dir_emit ( dirent -> caller , name , size , inode , type );
560560}
561561
562- static int hppfs_readdir (struct file * file , void * ent , filldir_t filldir )
562+ static int hppfs_readdir (struct file * file , struct dir_context * ctx )
563563{
564564 struct hppfs_private * data = file -> private_data ;
565565 struct file * proc_file = data -> proc_file ;
566- int (* readdir )(struct file * , void * , filldir_t );
567- struct hppfs_dirent dirent = ((struct hppfs_dirent )
568- { .vfs_dirent = ent ,
569- .filldir = filldir ,
570- .dentry = file -> f_path .dentry
571- });
566+ struct hppfs_dirent d = {
567+ .ctx .actor = hppfs_filldir ,
568+ .caller = ctx ,
569+ .dentry = file -> f_path .dentry
570+ };
572571 int err ;
573-
574- readdir = file_inode (proc_file )-> i_fop -> readdir ;
575-
576- proc_file -> f_pos = file -> f_pos ;
577- err = (* readdir )(proc_file , & dirent , hppfs_filldir );
578- file -> f_pos = proc_file -> f_pos ;
579-
572+ proc_file -> f_pos = ctx -> pos ;
573+ err = iterate_dir (proc_file , & d .ctx );
574+ ctx -> pos = d .ctx .pos ;
580575 return err ;
581576}
582577
583578static const struct file_operations hppfs_dir_fops = {
584579 .owner = NULL ,
585- .readdir = hppfs_readdir ,
580+ .iterate = hppfs_readdir ,
586581 .open = hppfs_dir_open ,
587582 .llseek = default_llseek ,
588583 .release = hppfs_release ,
0 commit comments