[Devel] [PATCH RH7] ploop: kaio: Clear swapfile flag
Kirill Tkhai
ktkhai at virtuozzo.com
Thu Oct 8 18:10:25 MSK 2020
This allows to call defrag on image file.
https://jira.sw.ru/browse/PSBM-107743
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
drivers/block/ploop/io_kaio.c | 2 --
drivers/block/ploop/io_kaio_map.c | 2 --
2 files changed, 4 deletions(-)
diff --git a/drivers/block/ploop/io_kaio.c b/drivers/block/ploop/io_kaio.c
index 2c2fb90d2b53..4c4a0c6a908c 100644
--- a/drivers/block/ploop/io_kaio.c
+++ b/drivers/block/ploop/io_kaio.c
@@ -1119,9 +1119,7 @@ static int __kaio_truncate(struct ploop_io * io, struct file * file, u64 pos)
newattrs.ia_valid = ATTR_SIZE;
mutex_lock(&io->files.inode->i_mutex);
- io->files.inode->i_flags &= ~S_SWAPFILE;
err = notify_change(F_DENTRY(file), &newattrs, NULL);
- io->files.inode->i_flags |= S_SWAPFILE;
mutex_unlock(&io->files.inode->i_mutex);
if (err) {
diff --git a/drivers/block/ploop/io_kaio_map.c b/drivers/block/ploop/io_kaio_map.c
index 09add482db8b..d4ff39d95e74 100644
--- a/drivers/block/ploop/io_kaio_map.c
+++ b/drivers/block/ploop/io_kaio_map.c
@@ -58,7 +58,6 @@ int ploop_kaio_open(struct file * file, int rdonly)
pm->readers = rdonly ? 1 : -1;
list_add(&pm->list, &ploop_mappings);
pm = NULL;
- mapping->host->i_flags |= S_SWAPFILE;
kaio_open_done:
spin_unlock(&ploop_mappings_lock);
@@ -82,7 +81,6 @@ int ploop_kaio_close(struct address_space * mapping, int rdonly)
}
if (m->readers == 0) {
- mapping->host->i_flags &= ~S_SWAPFILE;
list_del(&m->list);
pm = m;
}
More information about the Devel
mailing list