Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1039114pxu; Mon, 23 Nov 2020 10:03:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyR59w0eWbgkj6OJsz5P0s+ccVJ7E4JsXtmP+HGgXAIf1Kgp8McbvufAZPDxZ+ArDA+eaXA X-Received: by 2002:a17:906:5945:: with SMTP id g5mr673388ejr.553.1606154622025; Mon, 23 Nov 2020 10:03:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606154622; cv=none; d=google.com; s=arc-20160816; b=UsPnw0r6+2oD5Bw8VuZzgxhnxmfBJaqPD5Ucj2wXeRcM8szxuj1KRdMm8kg3MkqAa8 Oh4o0N4EiI87aSfJrkNV1zsLftN5M+zrxX5QIcTiBmjKlyArhX66HSlhCDTHstdisfr5 1duogiUJXeT5Vqaae1WoLsN5WIZbXKi779uwPejmISh78HKAydVLGx1ZyHYy15zGTewY Xsr3bsxH0BbCLZ6GpRPzva+NFrTpUwoGMuQKHYPzx6I71hXfEiAlfMN11Wa2IP4ucbso 7T5xzE+fgezXL5pqc9Mdxm5DO36zq56vHm00l2zwd0DBbicVrA7dFStFozQ/bWl6JL/X v71w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=xHQWCCzlPMxJJRb9V8vXr6KD9Whv3/QxzqUQ4c2gP90=; b=dUDnBPJ6D84w1+0Va0R15iemM2mxBjoAfKR4nCgCUZKePnevviKXZ90RaiOCTfGcV3 vkwUBnoZ7PxcE8PTtMRu4HM1BANgy5Gpd3mtxtPAV04BVHn21FZ4G0MV/ax3jbKnnJQZ x5O4SAMu4dWVesv4pBRYkqEaKgpRFL3A5ow4oAp3cLo/k5Pxf2wswpvCJ2/rePXwfPs/ CO5U0oUmO60fhyY03HCFGEMAZ+T/0QoXaI72IbHGmdX7kqWbXIvS1ug30+20pW8RFZWS hIXmfJwsKVSYoVLPipSKtyKeZq5QKmdWl0UeKiXNdODOuTR4M2QGvbYNWYfCAqDS3SFn bGgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm13si7075637edb.281.2020.11.23.10.03.18; Mon, 23 Nov 2020 10:03:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390605AbgKWR7r (ORCPT + 99 others); Mon, 23 Nov 2020 12:59:47 -0500 Received: from mga03.intel.com ([134.134.136.65]:48279 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729881AbgKWR7q (ORCPT ); Mon, 23 Nov 2020 12:59:46 -0500 IronPort-SDR: N5gDOl7bD9ieYlP/6HBGVbj0UPe7YsnF/9Kc0d8jPvMG7bPGNnNt08AHA8j/NEo1sFpTeZ5AJF J7NkFoQ9Kbbw== X-IronPort-AV: E=McAfee;i="6000,8403,9814"; a="171910730" X-IronPort-AV: E=Sophos;i="5.78,364,1599548400"; d="scan'208";a="171910730" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2020 09:59:46 -0800 IronPort-SDR: cVJlUx226TutJ1urM3hh1FKTuGqwYeaVHyxUZToqaCQy7KJzWFdBCOtESBwyZFVLu3ZPyTZneR rfiDBksfXBLQ== X-IronPort-AV: E=Sophos;i="5.78,364,1599548400"; d="scan'208";a="546504794" Received: from suygunge-mobl.ger.corp.intel.com (HELO localhost) ([10.249.40.108]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2020 09:59:43 -0800 From: Jani Nikula To: linux-kernel@vger.kernel.org Cc: Christoph Hellwig , Andrew Morton , intel-gfx@lists.freedesktop.org, jani.nikula@intel.com Subject: [PATCH 1/9] relay: remove unused buf_mapped and buf_unmapped callbacks Date: Mon, 23 Nov 2020 19:59:21 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No relay client uses the buf_mapped or buf_unmapped callbacks. Remove them. This makes relay's vm_operations_struct close callback a dummy, remove it as well. Suggested-by: Christoph Hellwig Cc: Christoph Hellwig Signed-off-by: Jani Nikula --- include/linux/relay.h | 19 ------------------- kernel/relay.c | 34 ---------------------------------- 2 files changed, 53 deletions(-) diff --git a/include/linux/relay.h b/include/linux/relay.h index e13a333e7c37..b3c4f49f6951 100644 --- a/include/linux/relay.h +++ b/include/linux/relay.h @@ -101,25 +101,6 @@ struct rchan_callbacks void *prev_subbuf, size_t prev_padding); - /* - * buf_mapped - relay buffer mmap notification - * @buf: the channel buffer - * @filp: relay file pointer - * - * Called when a relay file is successfully mmapped - */ - void (*buf_mapped)(struct rchan_buf *buf, - struct file *filp); - - /* - * buf_unmapped - relay buffer unmap notification - * @buf: the channel buffer - * @filp: relay file pointer - * - * Called when a relay file is successfully unmapped - */ - void (*buf_unmapped)(struct rchan_buf *buf, - struct file *filp); /* * create_buf_file - create file to represent a relay channel buffer * @filename: the name of the file to create diff --git a/kernel/relay.c b/kernel/relay.c index b08d936d5fa7..b51343642bf4 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -27,15 +27,6 @@ static DEFINE_MUTEX(relay_channels_mutex); static LIST_HEAD(relay_channels); -/* - * close() vm_op implementation for relay file mapping. - */ -static void relay_file_mmap_close(struct vm_area_struct *vma) -{ - struct rchan_buf *buf = vma->vm_private_data; - buf->chan->cb->buf_unmapped(buf, vma->vm_file); -} - /* * fault() vm_op implementation for relay file mapping. */ @@ -62,7 +53,6 @@ static vm_fault_t relay_buf_fault(struct vm_fault *vmf) */ static const struct vm_operations_struct relay_file_mmap_ops = { .fault = relay_buf_fault, - .close = relay_file_mmap_close, }; /* @@ -96,7 +86,6 @@ static void relay_free_page_array(struct page **array) static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma) { unsigned long length = vma->vm_end - vma->vm_start; - struct file *filp = vma->vm_file; if (!buf) return -EBADF; @@ -107,7 +96,6 @@ static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma) vma->vm_ops = &relay_file_mmap_ops; vma->vm_flags |= VM_DONTEXPAND; vma->vm_private_data = buf; - buf->chan->cb->buf_mapped(buf, filp); return 0; } @@ -283,22 +271,6 @@ static int subbuf_start_default_callback (struct rchan_buf *buf, return 1; } -/* - * buf_mapped() default callback. Does nothing. - */ -static void buf_mapped_default_callback(struct rchan_buf *buf, - struct file *filp) -{ -} - -/* - * buf_unmapped() default callback. Does nothing. - */ -static void buf_unmapped_default_callback(struct rchan_buf *buf, - struct file *filp) -{ -} - /* * create_buf_file_create() default callback. Does nothing. */ @@ -322,8 +294,6 @@ static int remove_buf_file_default_callback(struct dentry *dentry) /* relay channel default callbacks */ static struct rchan_callbacks default_channel_callbacks = { .subbuf_start = subbuf_start_default_callback, - .buf_mapped = buf_mapped_default_callback, - .buf_unmapped = buf_unmapped_default_callback, .create_buf_file = create_buf_file_default_callback, .remove_buf_file = remove_buf_file_default_callback, }; @@ -509,10 +479,6 @@ static void setup_callbacks(struct rchan *chan, if (!cb->subbuf_start) cb->subbuf_start = subbuf_start_default_callback; - if (!cb->buf_mapped) - cb->buf_mapped = buf_mapped_default_callback; - if (!cb->buf_unmapped) - cb->buf_unmapped = buf_unmapped_default_callback; if (!cb->create_buf_file) cb->create_buf_file = create_buf_file_default_callback; if (!cb->remove_buf_file) -- 2.20.1