[Devel,RHEL7,COMMIT] ploop: drop the obsolete drivers/block/ploop/compat.c

Submitted by Konstantin Khorenko on Feb. 20, 2017, 1:38 p.m.

Details

Message ID 201702201338.v1KDcMv5009547@finist_cl7.x64_64.work.ct
State New
Series "ploop: drop the obsolete drivers/block/ploop/compat.c"
Headers show

Commit Message

Konstantin Khorenko Feb. 20, 2017, 1:38 p.m.
The commit is pushed to "branch-rh7-3.10.0-514.6.1.vz7.28.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.6.1.vz7.28.6
------>
commit f5c33bf8f656123d6d2b34cfcb1e8c9706b336c4
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Mon Feb 20 17:38:21 2017 +0400

    ploop: drop the obsolete drivers/block/ploop/compat.c
    
    It contained functions missing in 2.6.18-x kernels.
    
    https://jira.sw.ru/browse/PSBM-51358
    
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 drivers/block/ploop/Makefile |   2 +-
 drivers/block/ploop/compat.c | 118 -------------------------------------------
 2 files changed, 1 insertion(+), 119 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/Makefile b/drivers/block/ploop/Makefile
index 0bfc903..e572dd5 100644
--- a/drivers/block/ploop/Makefile
+++ b/drivers/block/ploop/Makefile
@@ -17,7 +17,7 @@  obj-$(CONFIG_BLK_DEV_PLOOP)	+= pfmt_raw.o
 pfmt_raw-objs := fmt_raw.o
 
 obj-$(CONFIG_BLK_DEV_PLOOP)	+= pio_direct.o
-pio_direct-objs := io_direct.o io_direct_map.o compat.o
+pio_direct-objs := io_direct.o io_direct_map.o
 
 obj-$(CONFIG_BLK_DEV_PLOOP)	+= pio_kaio.o
 pio_kaio-objs := io_kaio.o io_kaio_map.o
diff --git a/drivers/block/ploop/compat.c b/drivers/block/ploop/compat.c
deleted file mode 100644
index c40f759..0000000
--- a/drivers/block/ploop/compat.c
+++ /dev/null
@@ -1,118 +0,0 @@ 
-/*
- *  drivers/block/ploop/compat.c
- *
- *  Copyright (c) 2010-2015 Parallels IP Holdings GmbH
- *
- */
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
-#include <linux/fs.h>
-#include <linux/file.h>
-#include <linux/pagemap.h>
-#include <linux/pagevec.h>
-
-/* These functions compensate for nice features, which are present
- * in new kernels and absent in 2.6.18.
- */
-
-static int _add_to_page_cache_lru(struct page *page, struct address_space *mapping,
-				  pgoff_t offset, gfp_t gfp_mask)
-{
-	int ret = add_to_page_cache(page, mapping, offset, gfp_mask);
-	if (ret == 0) {
-		struct pagevec lru_pvec;
-		pagevec_init(&lru_pvec, 0);
-
-		page_cache_get(page);
-		if (!pagevec_add(&lru_pvec, page))
-			__pagevec_lru_add(&lru_pvec);
-		pagevec_lru_add(&lru_pvec);
-	}
-	return ret;
-}
-
-
-static struct page *
-__grab_cache_page(struct address_space *mapping, pgoff_t index)
-{
-	int status;
-	struct page *page;
-repeat:
-	page = find_lock_page(mapping, index);
-	if (likely(page))
-		return page;
-
-	page = page_cache_alloc(mapping);
-	if (!page)
-		return NULL;
-	status = _add_to_page_cache_lru(page, mapping, index, mapping_gfp_mask(mapping));
-	if (unlikely(status)) {
-		page_cache_release(page);
-		if (status == -EEXIST)
-			goto repeat;
-		return NULL;
-	}
-	return page;
-}
-
-
-int pagecache_write_begin(struct file *file, struct address_space *mapping,
-				loff_t pos, unsigned len, unsigned flags,
-				struct page **pagep, void **fsdata)
-{
-	const struct address_space_operations *aops = mapping->a_ops;
-
-	int ret;
-	pgoff_t index = pos >> PAGE_CACHE_SHIFT;
-	unsigned offset = pos & (PAGE_CACHE_SIZE - 1);
-	struct inode *inode = mapping->host;
-	struct page *page;
-
-	page = __grab_cache_page(mapping, index);
-	*pagep = page;
-	if (!page)
-		return -ENOMEM;
-
-	ret = aops->prepare_write(file, page, offset, offset+len);
-	if (ret) {
-		unlock_page(page);
-		page_cache_release(page);
-		if (pos + len > inode->i_size)
-			vmtruncate(inode, inode->i_size);
-	}
-	return ret;
-}
-
-int pagecache_write_end(struct file *file, struct address_space *mapping,
-				loff_t pos, unsigned len, unsigned copied,
-				struct page *page, void *fsdata)
-{
-	const struct address_space_operations *aops = mapping->a_ops;
-	int ret;
-
-	unsigned offset = pos & (PAGE_CACHE_SIZE - 1);
-	struct inode *inode = mapping->host;
-
-	flush_dcache_page(page);
-	ret = aops->commit_write(file, page, offset, offset+len);
-	unlock_page(page);
-#if 0
-	/* Not really, we are not interested. */
-	mark_page_accessed(page);
-#endif
-	page_cache_release(page);
-
-	if (ret < 0) {
-		if (pos + len > inode->i_size)
-			vmtruncate(inode, inode->i_size);
-	} else if (ret > 0)
-		ret = min_t(size_t, copied, ret);
-	else
-		ret = copied;
-
-	return ret;
-}
-
-#endif