Lines Matching refs:ofs

26 int ovl_cleanup(struct ovl_fs *ofs, struct inode *wdir, struct dentry *wdentry)  in ovl_cleanup()  argument
32 err = ovl_do_rmdir(ofs, wdir, wdentry); in ovl_cleanup()
34 err = ovl_do_unlink(ofs, wdir, wdentry); in ovl_cleanup()
45 struct dentry *ovl_lookup_temp(struct ovl_fs *ofs, struct dentry *workdir) in ovl_lookup_temp() argument
54 temp = ovl_lookup_upper(ofs, name, workdir, strlen(name)); in ovl_lookup_temp()
65 static struct dentry *ovl_whiteout(struct ovl_fs *ofs) in ovl_whiteout() argument
69 struct dentry *workdir = ofs->workdir; in ovl_whiteout()
72 if (!ofs->whiteout) { in ovl_whiteout()
73 whiteout = ovl_lookup_temp(ofs, workdir); in ovl_whiteout()
77 err = ovl_do_whiteout(ofs, wdir, whiteout); in ovl_whiteout()
83 ofs->whiteout = whiteout; in ovl_whiteout()
86 if (ofs->share_whiteout) { in ovl_whiteout()
87 whiteout = ovl_lookup_temp(ofs, workdir); in ovl_whiteout()
91 err = ovl_do_link(ofs, ofs->whiteout, wdir, whiteout); in ovl_whiteout()
97 ofs->whiteout->d_inode->i_nlink, err); in ovl_whiteout()
98 ofs->share_whiteout = false; in ovl_whiteout()
102 whiteout = ofs->whiteout; in ovl_whiteout()
103 ofs->whiteout = NULL; in ovl_whiteout()
109 int ovl_cleanup_and_whiteout(struct ovl_fs *ofs, struct inode *dir, in ovl_cleanup_and_whiteout() argument
112 struct inode *wdir = ofs->workdir->d_inode; in ovl_cleanup_and_whiteout()
117 whiteout = ovl_whiteout(ofs); in ovl_cleanup_and_whiteout()
125 err = ovl_do_rename(ofs, wdir, whiteout, dir, dentry, flags); in ovl_cleanup_and_whiteout()
129 ovl_cleanup(ofs, wdir, dentry); in ovl_cleanup_and_whiteout()
136 ovl_cleanup(ofs, wdir, whiteout); in ovl_cleanup_and_whiteout()
140 int ovl_mkdir_real(struct ovl_fs *ofs, struct inode *dir, in ovl_mkdir_real() argument
146 err = ovl_do_mkdir(ofs, dir, dentry, mode); in ovl_mkdir_real()
158 d = ovl_lookup_upper(ofs, dentry->d_name.name, dentry->d_parent, in ovl_mkdir_real()
171 struct dentry *ovl_create_real(struct ovl_fs *ofs, struct inode *dir, in ovl_create_real() argument
184 err = ovl_do_link(ofs, attr->hardlink, dir, newdentry); in ovl_create_real()
188 err = ovl_do_create(ofs, dir, newdentry, attr->mode); in ovl_create_real()
193 err = ovl_mkdir_real(ofs, dir, &newdentry, attr->mode); in ovl_create_real()
200 err = ovl_do_mknod(ofs, dir, newdentry, attr->mode, in ovl_create_real()
205 err = ovl_do_symlink(ofs, dir, newdentry, attr->link); in ovl_create_real()
227 struct dentry *ovl_create_temp(struct ovl_fs *ofs, struct dentry *workdir, in ovl_create_temp() argument
230 return ovl_create_real(ofs, d_inode(workdir), in ovl_create_temp()
231 ovl_lookup_temp(ofs, workdir), attr); in ovl_create_temp()
237 struct ovl_fs *ofs = OVL_FS(dentry->d_sb); in ovl_set_opaque_xerr() local
240 err = ovl_check_setxattr(ofs, upper, OVL_XATTR_OPAQUE, "y", 1, xerr); in ovl_set_opaque_xerr()
325 struct ovl_fs *ofs = OVL_FS(dentry->d_sb); in ovl_create_upper() local
335 newdentry = ovl_create_real(ofs, udir, in ovl_create_upper()
336 ovl_lookup_upper(ofs, dentry->d_name.name, in ovl_create_upper()
344 !ovl_allow_offline_changes(ofs)) { in ovl_create_upper()
357 ovl_cleanup(ofs, udir, newdentry); in ovl_create_upper()
365 struct ovl_fs *ofs = OVL_FS(dentry->d_sb); in ovl_clear_empty() local
396 opaquedir = ovl_create_temp(ofs, workdir, OVL_CATTR(stat.mode)); in ovl_clear_empty()
410 err = ovl_set_attr(ofs, opaquedir, &stat); in ovl_clear_empty()
415 err = ovl_do_rename(ofs, wdir, opaquedir, udir, upper, RENAME_EXCHANGE); in ovl_clear_empty()
419 ovl_cleanup_whiteouts(ofs, upper, list); in ovl_clear_empty()
420 ovl_cleanup(ofs, wdir, upper); in ovl_clear_empty()
429 ovl_cleanup(ofs, wdir, opaquedir); in ovl_clear_empty()
437 static int ovl_set_upper_acl(struct ovl_fs *ofs, struct dentry *upperdentry, in ovl_set_upper_acl() argument
456 err = ovl_do_setxattr(ofs, upperdentry, name, buffer, size, XATTR_CREATE); in ovl_set_upper_acl()
465 struct ovl_fs *ofs = OVL_FS(dentry->d_sb); in ovl_create_over_whiteout() local
490 upper = ovl_lookup_upper(ofs, dentry->d_name.name, upperdir, in ovl_create_over_whiteout()
500 newdentry = ovl_create_temp(ofs, workdir, cattr); in ovl_create_over_whiteout()
516 err = ovl_do_notify_change(ofs, newdentry, &attr); in ovl_create_over_whiteout()
522 err = ovl_set_upper_acl(ofs, newdentry, in ovl_create_over_whiteout()
527 err = ovl_set_upper_acl(ofs, newdentry, in ovl_create_over_whiteout()
538 err = ovl_do_rename(ofs, wdir, newdentry, udir, upper, in ovl_create_over_whiteout()
543 ovl_cleanup(ofs, wdir, upper); in ovl_create_over_whiteout()
545 err = ovl_do_rename(ofs, wdir, newdentry, udir, upper, 0); in ovl_create_over_whiteout()
551 ovl_cleanup(ofs, udir, newdentry); in ovl_create_over_whiteout()
566 ovl_cleanup(ofs, wdir, newdentry); in ovl_create_over_whiteout()
766 struct ovl_fs *ofs = OVL_FS(dentry->d_sb); in ovl_remove_and_whiteout() local
787 upper = ovl_lookup_upper(ofs, dentry->d_name.name, upperdir, in ovl_remove_and_whiteout()
800 err = ovl_cleanup_and_whiteout(ofs, d_inode(upperdir), upper); in ovl_remove_and_whiteout()
820 struct ovl_fs *ofs = OVL_FS(dentry->d_sb); in ovl_remove_upper() local
835 upper = ovl_lookup_upper(ofs, dentry->d_name.name, upperdir, in ovl_remove_upper()
847 err = ovl_do_rmdir(ofs, dir, upper); in ovl_remove_upper()
849 err = ovl_do_unlink(ofs, dir, upper); in ovl_remove_upper()
1066 struct ovl_fs *ofs = OVL_FS(dentry->d_sb); in ovl_set_redirect() local
1077 err = ovl_check_setxattr(ofs, ovl_dentry_upper(dentry), in ovl_set_redirect()
1114 struct ovl_fs *ofs = OVL_FS(old->d_sb); in ovl_rename() local
1209 olddentry = ovl_lookup_upper(ofs, old->d_name.name, old_upperdir, in ovl_rename()
1219 newdentry = ovl_lookup_upper(ofs, new->d_name.name, new_upperdir, in ovl_rename()
1271 err = ovl_do_rename(ofs, old_upperdir->d_inode, olddentry, in ovl_rename()
1277 ovl_cleanup(ofs, old_upperdir->d_inode, newdentry); in ovl_rename()