Commit 4f357295 authored by Miklos Szeredi's avatar Miklos Szeredi

ovl: copy up inode flags

On inode creation copy certain inode flags from the underlying real inode
to the overlay inode.

This is in preparation for moving overlay functionality out of the VFS.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent d9854c87
...@@ -350,6 +350,13 @@ static inline void ovl_copyattr(struct inode *from, struct inode *to) ...@@ -350,6 +350,13 @@ static inline void ovl_copyattr(struct inode *from, struct inode *to)
to->i_ctime = from->i_ctime; to->i_ctime = from->i_ctime;
} }
static inline void ovl_copyflags(struct inode *from, struct inode *to)
{
unsigned int mask = S_SYNC | S_IMMUTABLE | S_APPEND | S_NOATIME;
inode_set_flags(to, from->i_flags & mask, mask);
}
/* dir.c */ /* dir.c */
extern const struct inode_operations ovl_dir_inode_operations; extern const struct inode_operations ovl_dir_inode_operations;
int ovl_cleanup_and_whiteout(struct dentry *workdir, struct inode *dir, int ovl_cleanup_and_whiteout(struct dentry *workdir, struct inode *dir,
......
...@@ -310,6 +310,7 @@ void ovl_inode_init(struct inode *inode, struct dentry *upperdentry, ...@@ -310,6 +310,7 @@ void ovl_inode_init(struct inode *inode, struct dentry *upperdentry,
OVL_I(inode)->lower = igrab(d_inode(lowerdentry)); OVL_I(inode)->lower = igrab(d_inode(lowerdentry));
ovl_copyattr(realinode, inode); ovl_copyattr(realinode, inode);
ovl_copyflags(realinode, inode);
if (!inode->i_ino) if (!inode->i_ino)
inode->i_ino = realinode->i_ino; inode->i_ino = realinode->i_ino;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment