Lines Matching refs:ctx
766 static int zonefs_readdir_root(struct file *file, struct dir_context *ctx)
774 if (ctx->pos >= inode->i_size)
777 if (!dir_emit_dots(file, ctx))
780 if (ctx->pos == 2) {
784 if (!dir_emit(ctx, zonefs_zgroup_name(ztype), 3,
787 ctx->pos++;
790 if (ctx->pos == 3 && ztype != ZONEFS_ZTYPE_SEQ) {
792 if (!dir_emit(ctx, zonefs_zgroup_name(ztype), 3,
795 ctx->pos++;
802 struct dir_context *ctx)
819 if (ctx->pos >= inode->i_size + 2)
822 if (!dir_emit_dots(file, ctx))
829 for (f = ctx->pos - 2; f < zgroup->g_nr_zones; f++) {
833 if (!dir_emit(ctx, fname, fname_len, ino, DT_REG))
835 ctx->pos++;
843 static int zonefs_readdir(struct file *file, struct dir_context *ctx)
848 return zonefs_readdir_root(file, ctx);
850 return zonefs_readdir_zgroup(file, ctx);