Lines Matching defs:od

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