[06/10] ploop: Introduce data_off_in_clusters() helper

Submitted by Kirill Tkhai on March 26, 2019, 3:19 p.m.

Details

Message ID 155361354800.12708.8771957110466781340.stgit@localhost.localdomain
State New
Series "ploop: Discard with zeroing of ploop1 indexes support"
Headers show

Commit Message

Kirill Tkhai March 26, 2019, 3:19 p.m.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/fmt_ploop1.c |    7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/fmt_ploop1.c b/drivers/block/ploop/fmt_ploop1.c
index eea15aac8790..370aa6369a8a 100644
--- a/drivers/block/ploop/fmt_ploop1.c
+++ b/drivers/block/ploop/fmt_ploop1.c
@@ -25,6 +25,13 @@  struct ploop1_private
 	sector_t	l1_off;
 };
 
+static unsigned int data_off_in_clusters(struct ploop_delta *delta)
+{
+	struct ploop1_private *ph = delta->priv;
+
+	return (ph->l1_off >> delta->cluster_log);
+}
+
 int ploop1_map_index(struct ploop_delta * delta, unsigned long block, sector_t *sec)
 {
 	struct ploop1_private * ph = delta->priv;