summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/readdir.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2014-12-12 18:59:42 -0500
committerMiklos Szeredi <mszeredi@suse.cz>2014-12-12 18:59:42 -0500
commit1afaba1ecb5299cdd0f69b5bad98b0185fe71e79 (patch)
tree19b3bdd7c514de98a9131665fcb360fda3178d4e /fs/overlayfs/readdir.c
parent49c21e1cacd74a8c83407c70ad860c994e606e25 (diff)
ovl: make path-type a bitmap
OVL_PATH_PURE_UPPER -> __OVL_PATH_UPPER | __OVL_PATH_PURE OVL_PATH_UPPER -> __OVL_PATH_UPPER OVL_PATH_MERGE -> __OVL_PATH_UPPER | __OVL_PATH_MERGE OVL_PATH_LOWER -> 0 Multiple R/O layers will allow __OVL_PATH_MERGE without __OVL_PATH_UPPER. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/overlayfs/readdir.c')
-rw-r--r--fs/overlayfs/readdir.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index 3efa44acf98b..481e44873b65 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -253,8 +253,8 @@ static void ovl_dir_reset(struct file *file)
253 ovl_cache_put(od, dentry); 253 ovl_cache_put(od, dentry);
254 od->cache = NULL; 254 od->cache = NULL;
255 } 255 }
256 WARN_ON(!od->is_real && type != OVL_PATH_MERGE); 256 WARN_ON(!od->is_real && !OVL_TYPE_MERGE(type));
257 if (od->is_real && type == OVL_PATH_MERGE) 257 if (od->is_real && OVL_TYPE_MERGE(type))
258 od->is_real = false; 258 od->is_real = false;
259} 259}
260 260
@@ -429,7 +429,7 @@ static int ovl_dir_fsync(struct file *file, loff_t start, loff_t end,
429 /* 429 /*
430 * Need to check if we started out being a lower dir, but got copied up 430 * Need to check if we started out being a lower dir, but got copied up
431 */ 431 */
432 if (!od->is_upper && ovl_path_type(dentry) != OVL_PATH_LOWER) { 432 if (!od->is_upper && OVL_TYPE_UPPER(ovl_path_type(dentry))) {
433 struct inode *inode = file_inode(file); 433 struct inode *inode = file_inode(file);
434 434
435 realfile = lockless_dereference(od->upperfile); 435 realfile = lockless_dereference(od->upperfile);
@@ -495,8 +495,8 @@ static int ovl_dir_open(struct inode *inode, struct file *file)
495 } 495 }
496 INIT_LIST_HEAD(&od->cursor.l_node); 496 INIT_LIST_HEAD(&od->cursor.l_node);
497 od->realfile = realfile; 497 od->realfile = realfile;
498 od->is_real = (type != OVL_PATH_MERGE); 498 od->is_real = !OVL_TYPE_MERGE(type);
499 od->is_upper = (type != OVL_PATH_LOWER); 499 od->is_upper = OVL_TYPE_UPPER(type);
500 od->cursor.is_cursor = true; 500 od->cursor.is_cursor = true;
501 file->private_data = od; 501 file->private_data = od;
502 502