ovl: allocate anon bdev per unique lower fs
Instead of allocating an anonymous bdev per lower layer, allocate one anonymous bdev per every unique lower fs that is different than upper fs. Every unique lower fs is assigned an fsid > 0 and the number of unique lower fs are stored in ofs->numlowerfs. The assigned fsid is stored in the lower layer struct and will be used also for inode number multiplexing. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:

committad av
Miklos Szeredi

förälder
da309e8c05
incheckning
5148626b80
@@ -83,14 +83,15 @@ static int ovl_map_dev_ino(struct dentry *dentry, struct kstat *stat,
|
||||
*/
|
||||
stat->dev = dentry->d_sb->s_dev;
|
||||
stat->ino = dentry->d_inode->i_ino;
|
||||
} else if (lower_layer) {
|
||||
} else if (lower_layer && lower_layer->fsid) {
|
||||
/*
|
||||
* For non-samefs setup, if we cannot map all layers st_ino
|
||||
* to a unified address space, we need to make sure that st_dev
|
||||
* is unique per layer. Upper layer uses real st_dev and lower
|
||||
* layers use the unique anonymous bdev.
|
||||
* is unique per lower fs. Upper layer uses real st_dev and
|
||||
* lower layers use the unique anonymous bdev assigned to the
|
||||
* lower fs.
|
||||
*/
|
||||
stat->dev = lower_layer->pseudo_dev;
|
||||
stat->dev = lower_layer->fs->pseudo_dev;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Referens i nytt ärende
Block a user