Lines Matching full:od
242 static void ovl_cache_put(struct ovl_dir_file *od, struct inode *inode) in ovl_cache_put() argument
244 struct ovl_dir_cache *cache = od->cache; in ovl_cache_put()
328 struct ovl_dir_file *od = file->private_data; in ovl_dir_reset() local
329 struct ovl_dir_cache *cache = od->cache; in ovl_dir_reset()
334 ovl_cache_put(od, inode); in ovl_dir_reset()
335 od->cache = NULL; in ovl_dir_reset()
336 od->cursor = NULL; in ovl_dir_reset()
339 if (od->is_real != is_real) { in ovl_dir_reset()
343 od->is_real = false; in ovl_dir_reset()
386 static void ovl_seek_cursor(struct ovl_dir_file *od, loff_t pos) in ovl_seek_cursor() argument
391 list_for_each(p, &od->cache->entries) { in ovl_seek_cursor()
397 od->cursor = p; in ovl_seek_cursor()
694 struct ovl_dir_file *od = file->private_data; in ovl_is_impure_dir() local
703 return od->is_upper && ovl_test_flag(OVL_IMPURE, dir); in ovl_is_impure_dir()
710 struct ovl_dir_file *od = file->private_data; in ovl_iterate_real() local
743 err = iterate_dir(od->realfile, &rdt.ctx); in ovl_iterate_real()
752 struct ovl_dir_file *od = file->private_data; in ovl_iterate() local
763 if (od->is_real) { in ovl_iterate()
775 err = iterate_dir(od->realfile, ctx); in ovl_iterate()
780 if (!od->cache) { in ovl_iterate()
788 od->cache = cache; in ovl_iterate()
789 ovl_seek_cursor(od, ctx->pos); in ovl_iterate()
792 while (od->cursor != &od->cache->entries) { in ovl_iterate()
793 p = list_entry(od->cursor, struct ovl_cache_entry, l_node); in ovl_iterate()
806 od->cursor = p->l_node.next; in ovl_iterate()
818 struct ovl_dir_file *od = file->private_data; in ovl_dir_llseek() local
824 if (od->is_real) { in ovl_dir_llseek()
825 res = vfs_llseek(od->realfile, offset, origin); in ovl_dir_llseek()
826 file->f_pos = od->realfile->f_pos; in ovl_dir_llseek()
844 if (od->cache) in ovl_dir_llseek()
845 ovl_seek_cursor(od, offset); in ovl_dir_llseek()
878 struct ovl_dir_file *od = file->private_data; in ovl_dir_real_file() local
880 struct file *old, *realfile = od->realfile; in ovl_dir_real_file()
888 if (!od->is_upper) { in ovl_dir_real_file()
889 realfile = READ_ONCE(od->upperfile); in ovl_dir_real_file()
898 old = cmpxchg_release(&od->upperfile, NULL, realfile); in ovl_dir_real_file()
931 struct ovl_dir_file *od = file->private_data; in ovl_dir_release() local
933 if (od->cache) { in ovl_dir_release()
935 ovl_cache_put(od, inode); in ovl_dir_release()
938 fput(od->realfile); in ovl_dir_release()
939 if (od->upperfile) in ovl_dir_release()
940 fput(od->upperfile); in ovl_dir_release()
941 kfree(od); in ovl_dir_release()
950 struct ovl_dir_file *od; in ovl_dir_open() local
953 od = kzalloc(sizeof(struct ovl_dir_file), GFP_KERNEL); in ovl_dir_open()
954 if (!od) in ovl_dir_open()
960 kfree(od); in ovl_dir_open()
963 od->realfile = realfile; in ovl_dir_open()
964 od->is_real = ovl_dir_is_real(inode); in ovl_dir_open()
965 od->is_upper = OVL_TYPE_UPPER(type); in ovl_dir_open()
966 file->private_data = od; in ovl_dir_open()