Lines Matching refs:od
238 static void ovl_cache_put(struct ovl_dir_file *od, struct dentry *dentry) 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, dentry); 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()
677 struct ovl_dir_file *od = file->private_data; in ovl_is_impure_dir() local
686 return od->is_upper && ovl_test_flag(OVL_IMPURE, dir); in ovl_is_impure_dir()
693 struct ovl_dir_file *od = file->private_data; in ovl_iterate_real() local
725 err = iterate_dir(od->realfile, &rdt.ctx); in ovl_iterate_real()
734 struct ovl_dir_file *od = file->private_data; in ovl_iterate() local
744 if (od->is_real) { in ovl_iterate()
756 err = iterate_dir(od->realfile, ctx); in ovl_iterate()
761 if (!od->cache) { in ovl_iterate()
769 od->cache = cache; in ovl_iterate()
770 ovl_seek_cursor(od, ctx->pos); in ovl_iterate()
773 while (od->cursor != &od->cache->entries) { in ovl_iterate()
774 p = list_entry(od->cursor, struct ovl_cache_entry, l_node); in ovl_iterate()
787 od->cursor = p->l_node.next; in ovl_iterate()
799 struct ovl_dir_file *od = file->private_data; in ovl_dir_llseek() local
805 if (od->is_real) { in ovl_dir_llseek()
806 res = vfs_llseek(od->realfile, offset, origin); in ovl_dir_llseek()
807 file->f_pos = od->realfile->f_pos; in ovl_dir_llseek()
825 if (od->cache) in ovl_dir_llseek()
826 ovl_seek_cursor(od, offset); in ovl_dir_llseek()
859 struct ovl_dir_file *od = file->private_data; in ovl_dir_real_file() local
861 struct file *old, *realfile = od->realfile; in ovl_dir_real_file()
869 if (!od->is_upper) { in ovl_dir_real_file()
870 realfile = READ_ONCE(od->upperfile); in ovl_dir_real_file()
879 old = cmpxchg_release(&od->upperfile, NULL, realfile); in ovl_dir_real_file()
912 struct ovl_dir_file *od = file->private_data; in ovl_dir_release() local
914 if (od->cache) { in ovl_dir_release()
916 ovl_cache_put(od, file->f_path.dentry); in ovl_dir_release()
919 fput(od->realfile); in ovl_dir_release()
920 if (od->upperfile) in ovl_dir_release()
921 fput(od->upperfile); in ovl_dir_release()
922 kfree(od); in ovl_dir_release()
931 struct ovl_dir_file *od; in ovl_dir_open() local
934 od = kzalloc(sizeof(struct ovl_dir_file), GFP_KERNEL); in ovl_dir_open()
935 if (!od) in ovl_dir_open()
941 kfree(od); in ovl_dir_open()
944 od->realfile = realfile; in ovl_dir_open()
945 od->is_real = ovl_dir_is_real(file->f_path.dentry); in ovl_dir_open()
946 od->is_upper = OVL_TYPE_UPPER(type); in ovl_dir_open()
947 file->private_data = od; in ovl_dir_open()