[Devel] [PATCH RH7 1/2] ploop: Kill unused truncate ioctl()
Kirill Tkhai
ktkhai at virtuozzo.com
Wed Sep 16 23:14:17 MSK 2020
This was never used.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
drivers/block/ploop/dev.c | 49 ----------------------------------------
include/linux/ploop/ploop_if.h | 2 +-
2 files changed, 1 insertion(+), 50 deletions(-)
diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 24e69e0..c09cafc 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -4159,52 +4159,6 @@ static int ploop_merge(struct ploop_device * plo)
return err;
}
-static int ploop_truncate(struct ploop_device * plo, unsigned long arg)
-{
- int err;
- struct ploop_truncate_ctl ctl;
- struct ploop_delta * delta;
- struct file * file;
-
- if (copy_from_user(&ctl, (void*)arg, sizeof(struct ploop_truncate_ctl)))
- return -EFAULT;
-
- if (ctl.fd < 0)
- return -EBADF;
-
- if (list_empty(&plo->map.delta_list))
- return -ENOENT;
-
- delta = find_delta(plo, ctl.level);
- if (delta == NULL)
- return -ENOENT;
-
- if (!(delta->flags & PLOOP_FMT_RDONLY))
- return -EBUSY;
-
- if (delta->ops->truncate == NULL)
- return -EOPNOTSUPP;
-
- file = fget(ctl.fd);
- if (file == NULL)
- return -EBADF;
-
- ploop_quiesce(plo);
-
- ploop_map_destroy(&plo->map);
-
- err = delta->ops->truncate(delta, file, ctl.alloc_head);
- if (!err)
- /* See comment in dio_release_prealloced */
- delta->io.prealloced_size = 0;
-
- ploop_relax(plo);
-
- fput(file);
-
- return err;
-}
-
static int ploop_bd_full(struct backing_dev_info *bdi, long long nr, int root)
{
struct ploop_device *plo = bdi->congested_data;
@@ -5581,9 +5535,6 @@ static int ploop_ioctl(struct block_device *bdev, fmode_t fmode, unsigned int cm
case PLOOP_IOC_MERGE:
err = ploop_merge(plo);
break;
- case PLOOP_IOC_TRUNCATE:
- err = ploop_truncate(plo, arg);
- break;
case PLOOP_IOC_UPDATE_INDEX:
err = ploop_index_update_ioc(plo, arg);
break;
diff --git a/include/linux/ploop/ploop_if.h b/include/linux/ploop/ploop_if.h
index 213fc3a..34fbd17 100644
--- a/include/linux/ploop/ploop_if.h
+++ b/include/linux/ploop/ploop_if.h
@@ -321,7 +321,7 @@ struct ploop_track_extent
/* Replace alive delta with equivalent one. */
#define PLOOP_IOC_REPLACE_DELTA _IOW(PLOOPCTLTYPE, 13, struct ploop_ctl)
-/* Replace alive delta with equivalent one. */
+/* This was never used */
#define PLOOP_IOC_TRUNCATE _IOW(PLOOPCTLTYPE, 14, struct ploop_truncate_ctl)
/* Update in-core copy of L2 table */
More information about the Devel
mailing list