summaryrefslogtreecommitdiff
path: root/fs/overlayfs/overlayfs.h
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2018-07-18 16:44:41 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2018-07-18 16:44:41 +0300
commit4f3572954a9d4cbf992072713af284d990b65d87 (patch)
treed83d72a2c9d7ce17857631ab07cd53d68e874fc9 /fs/overlayfs/overlayfs.h
parentd9854c87f0ed1a5f32fec24bb5b5fb426ad79c26 (diff)
downloadlinux-4f3572954a9d4cbf992072713af284d990b65d87.tar.xz
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: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/overlayfs.h')
-rw-r--r--fs/overlayfs/overlayfs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
index 008420e834d8..25cf26e57cdb 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -350,6 +350,13 @@ static inline void ovl_copyattr(struct inode *from, struct inode *to)
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 */
extern const struct inode_operations ovl_dir_inode_operations;
int ovl_cleanup_and_whiteout(struct dentry *workdir, struct inode *dir,