Lines Matching full:od

238 static void ovl_cache_put(struct ovl_dir_file *od, struct inode *inode)  in ovl_cache_put()  argument
240 struct ovl_dir_cache *cache = od->cache; in ovl_cache_put()
324 struct ovl_dir_file *od = file->private_data; in ovl_dir_reset() local
325 struct ovl_dir_cache *cache = od->cache; in ovl_dir_reset()
330 ovl_cache_put(od, inode); in ovl_dir_reset()
331 od->cache = NULL; in ovl_dir_reset()
332 od->cursor = NULL; in ovl_dir_reset()
335 if (od->is_real != is_real) { in ovl_dir_reset()
339 od->is_real = false; in ovl_dir_reset()
379 static void ovl_seek_cursor(struct ovl_dir_file *od, loff_t pos) in ovl_seek_cursor() argument
384 list_for_each(p, &od->cache->entries) { in ovl_seek_cursor()
390 od->cursor = p; in ovl_seek_cursor()
680 struct ovl_dir_file *od = file->private_data; in ovl_is_impure_dir() local
689 return od->is_upper && ovl_test_flag(OVL_IMPURE, dir); in ovl_is_impure_dir()
696 struct ovl_dir_file *od = file->private_data; in ovl_iterate_real() local
729 err = iterate_dir(od->realfile, &rdt.ctx); in ovl_iterate_real()
738 struct ovl_dir_file *od = file->private_data; in ovl_iterate() local
749 if (od->is_real) { in ovl_iterate()
761 err = iterate_dir(od->realfile, ctx); in ovl_iterate()
766 if (!od->cache) { in ovl_iterate()
774 od->cache = cache; in ovl_iterate()
775 ovl_seek_cursor(od, ctx->pos); in ovl_iterate()
778 while (od->cursor != &od->cache->entries) { in ovl_iterate()
779 p = list_entry(od->cursor, struct ovl_cache_entry, l_node); in ovl_iterate()
792 od->cursor = p->l_node.next; in ovl_iterate()
804 struct ovl_dir_file *od = file->private_data; in ovl_dir_llseek() local
810 if (od->is_real) { in ovl_dir_llseek()
811 res = vfs_llseek(od->realfile, offset, origin); in ovl_dir_llseek()
812 file->f_pos = od->realfile->f_pos; in ovl_dir_llseek()
830 if (od->cache) in ovl_dir_llseek()
831 ovl_seek_cursor(od, offset); in ovl_dir_llseek()
864 struct ovl_dir_file *od = file->private_data; in ovl_dir_real_file() local
866 struct file *old, *realfile = od->realfile; in ovl_dir_real_file()
874 if (!od->is_upper) { in ovl_dir_real_file()
875 realfile = READ_ONCE(od->upperfile); in ovl_dir_real_file()
884 old = cmpxchg_release(&od->upperfile, NULL, realfile); in ovl_dir_real_file()
917 struct ovl_dir_file *od = file->private_data; in ovl_dir_release() local
919 if (od->cache) { in ovl_dir_release()
921 ovl_cache_put(od, inode); in ovl_dir_release()
924 fput(od->realfile); in ovl_dir_release()
925 if (od->upperfile) in ovl_dir_release()
926 fput(od->upperfile); in ovl_dir_release()
927 kfree(od); in ovl_dir_release()
936 struct ovl_dir_file *od; in ovl_dir_open() local
939 od = kzalloc(sizeof(struct ovl_dir_file), GFP_KERNEL); in ovl_dir_open()
940 if (!od) in ovl_dir_open()
946 kfree(od); in ovl_dir_open()
949 od->realfile = realfile; in ovl_dir_open()
950 od->is_real = ovl_dir_is_real(inode); in ovl_dir_open()
951 od->is_upper = OVL_TYPE_UPPER(type); in ovl_dir_open()
952 file->private_data = od; in ovl_dir_open()