Commit 08f4c7c8 authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

ovl: add accessor for ofs->upper_mnt



Next patch will remove ofs->upper_mnt, so add an accessor function for this
field.

Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 520da69d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ static int ovl_check_encode_origin(struct dentry *dentry)
	 * ovl_connect_layer() will try to make origin's layer "connected" by
	 * copying up a "connectable" ancestor.
	 */
	if (d_is_dir(dentry) && ofs->upper_mnt)
	if (d_is_dir(dentry) && ovl_upper_mnt(ofs))
		return ovl_connect_layer(dentry);

	/* Lower file handle for indexed and non-upper dir/non-dir */
@@ -677,10 +677,10 @@ static struct dentry *ovl_upper_fh_to_d(struct super_block *sb,
	struct dentry *dentry;
	struct dentry *upper;

	if (!ofs->upper_mnt)
	if (!ovl_upper_mnt(ofs))
		return ERR_PTR(-EACCES);

	upper = ovl_decode_real_fh(fh, ofs->upper_mnt, true);
	upper = ovl_decode_real_fh(fh, ovl_upper_mnt(ofs), true);
	if (IS_ERR_OR_NULL(upper))
		return upper;

+2 −2
Original line number Diff line number Diff line
@@ -456,7 +456,7 @@ int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags)
	if (flags & S_ATIME) {
		struct ovl_fs *ofs = inode->i_sb->s_fs_info;
		struct path upperpath = {
			.mnt = ofs->upper_mnt,
			.mnt = ovl_upper_mnt(ofs),
			.dentry = ovl_upperdentry_dereference(OVL_I(inode)),
		};

@@ -921,7 +921,7 @@ static bool ovl_hash_bylower(struct super_block *sb, struct dentry *upper,
		return true;

	/* Yes, if won't be copied up */
	if (!ofs->upper_mnt)
	if (!ovl_upper_mnt(ofs))
		return true;

	/* No, if lower hardlink is or will be broken on copy up */
+1 −1
Original line number Diff line number Diff line
@@ -489,7 +489,7 @@ struct dentry *ovl_index_upper(struct ovl_fs *ofs, struct dentry *index)
	if (IS_ERR_OR_NULL(fh))
		return ERR_CAST(fh);

	upper = ovl_decode_real_fh(fh, ofs->upper_mnt, true);
	upper = ovl_decode_real_fh(fh, ovl_upper_mnt(ofs), true);
	kfree(fh);

	if (IS_ERR_OR_NULL(upper))
+5 −0
Original line number Diff line number Diff line
@@ -82,6 +82,11 @@ struct ovl_fs {
	struct dentry *whiteout;
};

static inline struct vfsmount *ovl_upper_mnt(struct ovl_fs *ofs)
{
	return ofs->upper_mnt;
}

static inline struct ovl_fs *OVL_FS(struct super_block *sb)
{
	return (struct ovl_fs *)sb->s_fs_info;
+1 −1
Original line number Diff line number Diff line
@@ -1120,7 +1120,7 @@ int ovl_indexdir_cleanup(struct ovl_fs *ofs)
	struct dentry *indexdir = ofs->indexdir;
	struct dentry *index = NULL;
	struct inode *dir = indexdir->d_inode;
	struct path path = { .mnt = ofs->upper_mnt, .dentry = indexdir };
	struct path path = { .mnt = ovl_upper_mnt(ofs), .dentry = indexdir };
	LIST_HEAD(list);
	struct rb_root root = RB_ROOT;
	struct ovl_cache_entry *p;
Loading