Lines Matching refs:ofs
167 static inline const char *ovl_xattr(struct ovl_fs *ofs, enum ovl_xattr ox)
169 return ovl_xattr_table[ox][ofs->config.userxattr];
184 static inline int ovl_do_notify_change(struct ovl_fs *ofs,
188 return notify_change(ovl_upper_mnt_idmap(ofs), upperdentry, attr, NULL);
191 static inline int ovl_do_rmdir(struct ovl_fs *ofs,
194 int err = vfs_rmdir(ovl_upper_mnt_idmap(ofs), dir, dentry);
200 static inline int ovl_do_unlink(struct ovl_fs *ofs, struct inode *dir,
203 int err = vfs_unlink(ovl_upper_mnt_idmap(ofs), dir, dentry, NULL);
209 static inline int ovl_do_link(struct ovl_fs *ofs, struct dentry *old_dentry,
212 int err = vfs_link(old_dentry, ovl_upper_mnt_idmap(ofs), dir,
219 static inline int ovl_do_create(struct ovl_fs *ofs,
223 int err = vfs_create(ovl_upper_mnt_idmap(ofs), dir, dentry, mode, true);
229 static inline int ovl_do_mkdir(struct ovl_fs *ofs,
233 int err = vfs_mkdir(ovl_upper_mnt_idmap(ofs), dir, dentry, mode);
238 static inline int ovl_do_mknod(struct ovl_fs *ofs,
242 int err = vfs_mknod(ovl_upper_mnt_idmap(ofs), dir, dentry, mode, dev);
248 static inline int ovl_do_symlink(struct ovl_fs *ofs,
252 int err = vfs_symlink(ovl_upper_mnt_idmap(ofs), dir, dentry, oldname);
274 static inline ssize_t ovl_getxattr_upper(struct ovl_fs *ofs,
281 .mnt = ovl_upper_mnt(ofs),
284 return ovl_do_getxattr(&upperpath, ovl_xattr(ofs, ox), value, size);
287 static inline ssize_t ovl_path_getxattr(struct ovl_fs *ofs,
292 return ovl_do_getxattr(path, ovl_xattr(ofs, ox), value, size);
295 static inline int ovl_do_setxattr(struct ovl_fs *ofs, struct dentry *dentry,
299 int err = vfs_setxattr(ovl_upper_mnt_idmap(ofs), dentry, name,
307 static inline int ovl_setxattr(struct ovl_fs *ofs, struct dentry *dentry,
311 return ovl_do_setxattr(ofs, dentry, ovl_xattr(ofs, ox), value, size, 0);
314 static inline int ovl_do_removexattr(struct ovl_fs *ofs, struct dentry *dentry,
317 int err = vfs_removexattr(ovl_upper_mnt_idmap(ofs), dentry, name);
322 static inline int ovl_removexattr(struct ovl_fs *ofs, struct dentry *dentry,
325 return ovl_do_removexattr(ofs, dentry, ovl_xattr(ofs, ox));
328 static inline int ovl_do_set_acl(struct ovl_fs *ofs, struct dentry *dentry,
331 return vfs_set_acl(ovl_upper_mnt_idmap(ofs), dentry, acl_name, acl);
334 static inline int ovl_do_remove_acl(struct ovl_fs *ofs, struct dentry *dentry,
337 return vfs_remove_acl(ovl_upper_mnt_idmap(ofs), dentry, acl_name);
340 static inline int ovl_do_rename(struct ovl_fs *ofs, struct inode *olddir,
346 .old_mnt_idmap = ovl_upper_mnt_idmap(ofs),
349 .new_mnt_idmap = ovl_upper_mnt_idmap(ofs),
364 static inline int ovl_do_whiteout(struct ovl_fs *ofs,
367 int err = vfs_whiteout(ovl_upper_mnt_idmap(ofs), dir, dentry);
372 static inline struct file *ovl_do_tmpfile(struct ovl_fs *ofs,
375 struct path path = { .mnt = ovl_upper_mnt(ofs), .dentry = dentry };
376 struct file *file = kernel_tmpfile_open(ovl_upper_mnt_idmap(ofs), &path,
385 static inline struct dentry *ovl_lookup_upper(struct ovl_fs *ofs,
389 return lookup_one(ovl_upper_mnt_idmap(ofs), name, base, len);
475 bool ovl_path_check_dir_xattr(struct ovl_fs *ofs, const struct path *path,
477 bool ovl_path_check_origin_xattr(struct ovl_fs *ofs, const struct path *path);
478 bool ovl_init_uuid_xattr(struct super_block *sb, struct ovl_fs *ofs,
481 static inline bool ovl_check_origin_xattr(struct ovl_fs *ofs,
486 .mnt = ovl_upper_mnt(ofs),
488 return ovl_path_check_origin_xattr(ofs, &upperpath);
491 int ovl_check_setxattr(struct ovl_fs *ofs, struct dentry *upperdentry,
502 int ovl_check_metacopy_xattr(struct ovl_fs *ofs, const struct path *path,
504 int ovl_set_metacopy_xattr(struct ovl_fs *ofs, struct dentry *d,
507 char *ovl_get_redirect_xattr(struct ovl_fs *ofs, const struct path *path, int padding);
509 int ovl_get_verity_xattr(struct ovl_fs *ofs, const struct path *path,
511 int ovl_validate_verity(struct ovl_fs *ofs,
514 int ovl_get_verity_digest(struct ovl_fs *ofs, struct path *src,
516 int ovl_sync_status(struct ovl_fs *ofs);
536 struct ovl_fs *ofs = OVL_FS(sb);
539 .mnt = ovl_upper_mnt(ofs),
542 return ovl_path_check_dir_xattr(ofs, &upperpath, OVL_XATTR_IMPURE);
545 static inline bool ovl_redirect_follow(struct ovl_fs *ofs)
547 return ofs->config.redirect_mode != OVL_REDIRECT_NOFOLLOW;
550 static inline bool ovl_redirect_dir(struct ovl_fs *ofs)
552 return ofs->config.redirect_mode == OVL_REDIRECT_ON;
555 static inline bool ovl_origin_uuid(struct ovl_fs *ofs)
557 return ofs->config.uuid != OVL_UUID_OFF;
560 static inline bool ovl_has_fsid(struct ovl_fs *ofs)
562 return ofs->config.uuid == OVL_UUID_ON ||
563 ofs->config.uuid == OVL_UUID_AUTO;
571 static inline bool ovl_xino_warn(struct ovl_fs *ofs)
573 return ofs->config.xino == OVL_XINO_ON;
580 static inline bool ovl_allow_offline_changes(struct ovl_fs *ofs)
582 return (!ofs->config.index && !ofs->config.metacopy &&
583 !ovl_redirect_dir(ofs) && !ovl_xino_warn(ofs));
587 static inline bool ovl_same_fs(struct ovl_fs *ofs)
589 return ofs->xino_mode == 0;
593 static inline bool ovl_same_dev(struct ovl_fs *ofs)
595 return ofs->xino_mode >= 0;
598 static inline unsigned int ovl_xino_bits(struct ovl_fs *ofs)
600 return ovl_same_dev(ofs) ? ofs->xino_mode : 0;
630 struct dentry *ovl_decode_real_fh(struct ovl_fs *ofs, struct ovl_fh *fh,
632 int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected,
634 int ovl_verify_set_fh(struct ovl_fs *ofs, struct dentry *dentry,
637 struct dentry *ovl_index_upper(struct ovl_fs *ofs, struct dentry *index,
639 int ovl_verify_index(struct ovl_fs *ofs, struct dentry *index);
640 int ovl_get_index_name(struct ovl_fs *ofs, struct dentry *origin,
642 struct dentry *ovl_get_index_fh(struct ovl_fs *ofs, struct ovl_fh *fh);
643 struct dentry *ovl_lookup_index(struct ovl_fs *ofs, struct dentry *upper,
651 static inline int ovl_verify_origin(struct ovl_fs *ofs, struct dentry *upper,
654 return ovl_verify_set_fh(ofs, upper, OVL_XATTR_ORIGIN, origin,
658 static inline int ovl_verify_upper(struct ovl_fs *ofs, struct dentry *index,
661 return ovl_verify_set_fh(ofs, index, OVL_XATTR_UPPER, upper, true, set);
668 void ovl_cleanup_whiteouts(struct ovl_fs *ofs, struct dentry *upper,
673 int ovl_workdir_cleanup(struct ovl_fs *ofs, struct inode *dir,
675 int ovl_indexdir_cleanup(struct ovl_fs *ofs);
692 unsigned int ovl_get_nlink(struct ovl_fs *ofs, struct dentry *lowerdentry,
787 int ovl_cleanup_and_whiteout(struct ovl_fs *ofs, struct inode *dir,
798 int ovl_mkdir_real(struct ovl_fs *ofs, struct inode *dir,
800 struct dentry *ovl_create_real(struct ovl_fs *ofs,
803 int ovl_cleanup(struct ovl_fs *ofs, struct inode *dir, struct dentry *dentry);
804 struct dentry *ovl_lookup_temp(struct ovl_fs *ofs, struct dentry *workdir);
805 struct dentry *ovl_create_temp(struct ovl_fs *ofs, struct dentry *workdir,
823 int ovl_set_attr(struct ovl_fs *ofs, struct dentry *upper, struct kstat *stat);
824 struct ovl_fh *ovl_encode_real_fh(struct ovl_fs *ofs, struct dentry *real,
826 int ovl_set_origin(struct ovl_fs *ofs, struct dentry *lower,
837 static inline bool ovl_force_readonly(struct ovl_fs *ofs)
839 return (!ovl_upper_mnt(ofs) || !ofs->workdir);