LINUX: Remove unused osi_fetchstore.c 61/13061/4
authorAndrew Deason <adeason@sinenomine.net>
Wed, 9 May 2018 00:09:42 +0000 (19:09 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 11 May 2018 15:21:15 +0000 (11:21 -0400)
Ever since commit ae5f411c (Linux 4.4: Do not use splice()), most of
osi_fetchstore.c has been '#if 0'd out. The only portion that isn't is
a function definition that is unreferenced (afs_linux_read_actor).

Remove the unused code, and other '#if 0' references to it; the code
can always be added back later when we can actually use it.

Change-Id: Ifc062d5665393aa6693eb0db63aa23e4feb44df4
Reviewed-on: https://gerrit.openafs.org/13061
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/afs/LINUX/osi_fetchstore.c [deleted file]
src/afs/afs_fetchstore.c
src/afs/afs_prototypes.h
src/libafs/Makefile.common.in
src/libafs/MakefileProto.LINUX.in

diff --git a/src/afs/LINUX/osi_fetchstore.c b/src/afs/LINUX/osi_fetchstore.c
deleted file mode 100644 (file)
index 997c1aa..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 2009 Simon Wilkinson. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* Linux specific store operations
- *
- * The idea of these operations is to reduce the number of copies
- * that data incurs when passing from the disk cache through to the
- * RX layer, and vice versa.
- *
- * In kernels which support it, we use the splice() operation - in
- * older kernels, the filesystem's sendpage() operation is used directly.
- * Either way, this means that we can get direct access to the page contents,
- * rather than getting a copy.
- */
-
-#include <afsconfig.h>
-#include "afs/param.h"
-
-#include <linux/fs.h>
-#if 0 && defined(HAVE_LINUX_SPLICE_DIRECT_TO_ACTOR)
-# include <linux/splice.h>
-#else
-# include <linux/pipe_fs_i.h>
-#endif
-
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-
-#if 0 && defined(HAVE_LINUX_SPLICE_DIRECT_TO_ACTOR)
-static int
-afs_linux_splice_actor(struct pipe_inode_info *pipe,
-                      struct pipe_buffer *buf,
-                      struct splice_desc *sd)
-{
-    struct rxfs_storeVariables *svar = sd->u.data;
-    size_t size;
-    int code;
-
-    code = buf->ops->confirm(pipe, buf);
-    if (code)
-       return code;
-
-    size = sd->len;
-
-    /* Eventually, this could be rx_WritePage */
-    code = rx_Write(svar->call, kmap(buf->page), size);
-
-    if (code != size)
-       size = -33; /* Can't get a proper rx error out from here */
-
-    kunmap(buf->page);
-
-    return size;
-}
-
-static int
-afs_linux_ds_actor(struct pipe_inode_info *pipe, struct splice_desc *sd)
-{
-    return __splice_from_pipe(pipe, sd, afs_linux_splice_actor);
-}
-
-/* This is a store proc which uses splice to reduce the number
- * of page copies. */
-afs_int32
-afs_linux_storeproc(struct storeOps *ops, void *rock, struct dcache *tdc,
-                   int *shouldwake, afs_size_t *bytesXferred)
-{
-    struct rxfs_storeVariables *svar = rock;
-    struct file *cacheFp;
-    struct splice_desc sd = {
-       .len    = 0,
-       .total_len = tdc->f.chunkBytes,
-       .pos    = 0,
-       .u.data = rock
-    };
-    int code;
-
-    /* Open the file, splice its contents */
-    AFS_GUNLOCK();
-    cacheFp = afs_linux_raw_open(&tdc->f.inode);
-    code = splice_direct_to_actor(cacheFp, &sd, afs_linux_ds_actor);
-    filp_close(cacheFp, NULL);
-    AFS_GLOCK();
-
-    /* If we're being called from a backing request, then wake up that
-     * request once the file server says its happy. Potentially, we should
-     * do this each time we rx_Write, but that would mean acquiring the
-     * GLOCK in the middle of our actor */
-    if (shouldwake && *shouldwake && ((*ops->status)(rock) == 0)) {
-       *shouldwake = 0;
-       afs_wakeup(svar->vcache);
-    }
-
-    if (code > 0) {
-       *bytesXferred+=code;
-        return 0;
-    }
-
-    return code;
-}
-
-# else
-
-static int
-afs_linux_read_actor(read_descriptor_t *desc, struct page *page,
-                    unsigned long offset, unsigned long size)
-{
-#ifdef READ_DESCRIPTOR_T_HAS_BUF
-    struct rxfs_storeVariables *svar = (void *) desc->buf;
-#else
-    struct rxfs_storeVariables *svar = desc->arg.data;
-#endif
-    unsigned long count = desc->count;
-    int code;
-
-    if (size > count)
-       size = count;
-
-    /* Eventually, this could be rx_WritePage */
-    code = rx_Write(svar->call, kmap(page) + offset, size);
-    kunmap(page);
-
-    if (code != size) {
-        return -33; /* Can't get a proper rx error out from here */
-    }
-
-    desc->count = count - size;
-    desc->written += size;
-
-    return size;
-}
-
-#if 0
-afs_int32
-afs_linux_storeproc(struct storeOps *ops, void *rock, struct dcache *tdc,
-                    int *shouldwake, afs_size_t *bytesXferred)
-{
-    struct rxfs_storeVariables *svar = rock;
-    struct file *cacheFp;
-    int code;
-    loff_t offset = 0;
-
-    /* Open the file, splice its contents */
-    AFS_GUNLOCK();
-    cacheFp = afs_linux_raw_open(&tdc->f.inode);
-    code = cacheFp->f_op->sendfile(cacheFp, &offset, tdc->f.chunkBytes,
-                                  afs_linux_read_actor, rock);
-    filp_close(cacheFp, NULL);
-    AFS_GLOCK();
-
-    /* If we're being called from a backing request, then wake up that
-     * request once the file server says its happy. Potentially, we should
-     * do this each time we rx_Write, but that would mean acquiring the
-     * GLOCK in the middle of our actor */
-    if (shouldwake && *shouldwake && ((*ops->status)(rock) == 0)) {
-       *shouldwake = 0;
-       afs_wakeup(svar->vcache);
-    }
-
-    if (code > 0) {
-       *bytesXferred+=code;
-        return 0;
-    }
-
-    return code;
-}
-#endif
-
-#endif
index c9a73a8..eb32bbe 100644 (file)
@@ -324,12 +324,8 @@ struct storeOps rxfs_storeUfsOps = {
     .padd =    rxfs_storePadd,
     .close =   rxfs_storeClose,
     .destroy = rxfs_storeDestroy,
-#if 0 && defined(AFS_LINUX26_ENV)
-    .storeproc = afs_linux_storeproc
-#else
     .storeproc = afs_GenericStoreProc
 #endif
-#endif
 };
 
 static
index e51f62b..fb8ddf4 100644 (file)
@@ -626,12 +626,6 @@ extern void osi_ReleaseVM(struct vcache *avc, afs_ucred_t *acred);
 #endif
 
 
-/* LINUX/osi_fetchstore.c */
-#ifdef AFS_LINUX26_ENV
-extern int afs_linux_storeproc(struct storeOps *, void *, struct dcache *,
-                              int *, afs_size_t *);
-#endif
-
 /* ARCH/osi_crypto.c */
 extern int osi_readRandom(void *, afs_size_t);
 
index 406b8e0..d9bd90b 100644 (file)
@@ -712,8 +712,6 @@ osi_timeout.o: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_timeout.c
        $(CRULE_NOOPT) $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_timeout.c
 osi_pagecopy.o: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_pagecopy.c
        $(CRULE_NOOPT) $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_pagecopy.c
-osi_fetchstore.o: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_fetchstore.c
-       $(CRULE_NOOPT) $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_fetchstore.c
 osi_vcache.o: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_vcache.c
        $(CRULE_NOOPT) $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_vcache.c
 osi_crypto.o: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_crypto.c
index 564b2ef..ed687f1 100644 (file)
@@ -42,8 +42,7 @@ AFS_OS_OBJS = \
        osi_ioctl.o \
        osi_proc.o \
        osi_vnodeops.o \
-       osi_pagecopy.o \
-       osi_fetchstore.o
+       osi_pagecopy.o
 
 AFS_OS_PAGOBJS = \
        osi_alloc.o \