From patchwork Fri Jul 29 14:34:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 73041 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1422731qga; Fri, 29 Jul 2016 07:35:08 -0700 (PDT) X-Received: by 10.66.74.133 with SMTP id t5mr70328454pav.114.1469802908308; Fri, 29 Jul 2016 07:35:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sj4si18624311pab.213.2016.07.29.07.35.08; Fri, 29 Jul 2016 07:35:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753130AbcG2OfF (ORCPT + 29 others); Fri, 29 Jul 2016 10:35:05 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.140]:58833 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751547AbcG2OfD (ORCPT ); Fri, 29 Jul 2016 10:35:03 -0400 Received: from e106497-lin.cambridge.arm.com (e106497-lin.cambridge.arm.com [10.2.131.153]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id u6TEZ0h2031576; Fri, 29 Jul 2016 15:35:00 +0100 From: Liviu Dudau To: Greg Kroah-Hartman Cc: Brian Starkey , LKML , Nicolai Stange Subject: [PATCH] debugfs: Add proxy function for the mmap file operation Date: Fri, 29 Jul 2016 15:34:59 +0100 Message-Id: <20160729143459.2672-1-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.9.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add proxy function for the mmap file_operations hook under the full_proxy_fops structure. This is useful for providing a custom mmap routine in a driver's debugfs implementation. Cc: Nicolai Stange Signed-off-by: Liviu Dudau --- fs/debugfs/file.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.9.0 diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 592059f..d87148a 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -168,6 +168,10 @@ FULL_PROXY_FUNC(write, ssize_t, filp, loff_t *ppos), ARGS(filp, buf, size, ppos)); +FULL_PROXY_FUNC(mmap, int, filp, + PROTO(struct file *filp, struct vm_area_struct *vma), + ARGS(filp, vma)); + FULL_PROXY_FUNC(unlocked_ioctl, long, filp, PROTO(struct file *filp, unsigned int cmd, unsigned long arg), ARGS(filp, cmd, arg)); @@ -224,6 +228,8 @@ static void __full_proxy_fops_init(struct file_operations *proxy_fops, proxy_fops->write = full_proxy_write; if (real_fops->poll) proxy_fops->poll = full_proxy_poll; + if (real_fops->mmap) + proxy_fops->mmap = full_proxy_mmap; if (real_fops->unlocked_ioctl) proxy_fops->unlocked_ioctl = full_proxy_unlocked_ioctl; }