Lines Matching refs:od

238 static void ovl_cache_put(struct ovl_dir_file *od, struct dentry *dentry)
240 struct ovl_dir_cache *cache = od->cache;
324 struct ovl_dir_file *od = file->private_data;
325 struct ovl_dir_cache *cache = od->cache;
330 ovl_cache_put(od, dentry);
331 od->cache = NULL;
332 od->cursor = NULL;
335 if (od->is_real != is_real) {
339 od->is_real = false;
379 static void ovl_seek_cursor(struct ovl_dir_file *od, loff_t pos)
384 list_for_each(p, &od->cache->entries) {
390 od->cursor = p;
675 struct ovl_dir_file *od = file->private_data;
684 return od->is_upper && ovl_test_flag(OVL_IMPURE, dir);
691 struct ovl_dir_file *od = file->private_data;
723 err = iterate_dir(od->realfile, &rdt.ctx);
732 struct ovl_dir_file *od = file->private_data;
742 if (od->is_real) {
754 err = iterate_dir(od->realfile, ctx);
759 if (!od->cache) {
767 od->cache = cache;
768 ovl_seek_cursor(od, ctx->pos);
771 while (od->cursor != &od->cache->entries) {
772 p = list_entry(od->cursor, struct ovl_cache_entry, l_node);
782 od->cursor = p->l_node.next;
794 struct ovl_dir_file *od = file->private_data;
800 if (od->is_real) {
801 res = vfs_llseek(od->realfile, offset, origin);
802 file->f_pos = od->realfile->f_pos;
820 if (od->cache)
821 ovl_seek_cursor(od, offset);
854 struct ovl_dir_file *od = file->private_data;
856 struct file *old, *realfile = od->realfile;
864 if (!od->is_upper) {
865 realfile = READ_ONCE(od->upperfile);
874 old = cmpxchg_release(&od->upperfile, NULL, realfile);
907 struct ovl_dir_file *od = file->private_data;
909 if (od->cache) {
911 ovl_cache_put(od, file->f_path.dentry);
914 fput(od->realfile);
915 if (od->upperfile)
916 fput(od->upperfile);
917 kfree(od);
926 struct ovl_dir_file *od;
929 od = kzalloc(sizeof(struct ovl_dir_file), GFP_KERNEL);
930 if (!od)
936 kfree(od);
939 od->realfile = realfile;
940 od->is_real = ovl_dir_is_real(file->f_path.dentry);
941 od->is_upper = OVL_TYPE_UPPER(type);
942 file->private_data = od;