From patchwork Mon Sep 12 19:29:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9327855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ED87F6089F for ; Mon, 12 Sep 2016 19:32:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0FF328E59 for ; Mon, 12 Sep 2016 19:32:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D578228E98; Mon, 12 Sep 2016 19:32:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4837228E6F for ; Mon, 12 Sep 2016 19:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758043AbcILTbv (ORCPT ); Mon, 12 Sep 2016 15:31:51 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:38736 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932561AbcILT3o (ORCPT ); Mon, 12 Sep 2016 15:29:44 -0400 Received: by mail-wm0-f47.google.com with SMTP id 1so163061177wmz.1 for ; Mon, 12 Sep 2016 12:29:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2PZnG8J3yh8ZY5QJPUq/1iWGKbnGcLVKxVotXoerNPQ=; b=VF/HdmzXyxma4kdSI70HoLAokoEbmOdJsQueApnoX11Ijx3J02Tf/ykpJ1pDmpbmqG ucJhwrk2/81Q5tRSu9AcvuHNFkDOhAKfSY0gfkshIBWODCfMw0BT9Ul65+HecanRTx/+ aOgC1tU4UNBKt6GTyTeHt2EGYRIKB5shWqdwOtzuMA833oYT42ia1wntd1ObMdjqsQne HGfXQQjlVOSsxvnBqrGnv3hL2QqA4kaUmKrwq/nJZDem3/Oq5T+6gqavmYMAWFM2raxF Sy30ERO1HjdfiUgX+v1fr0fV2FN4Trw5sOI3/WcIDG3+BWbWJyMqEMx4AFKYD+TgOjcH WX1g== X-Gm-Message-State: AE9vXwOLo0YuEBnPjdIGJAwpKdoy1xZ28jCfHHc/WKr2FVjZtXZQKjR3DFlK0UZRip/olHIb X-Received: by 10.28.152.149 with SMTP id a143mr1390802wme.66.1473708582736; Mon, 12 Sep 2016 12:29:42 -0700 (PDT) Received: from veci.piliscsaba.szeredi.hu (pool-dsl-2c-0018.externet.hu. [217.173.44.24]) by smtp.gmail.com with ESMTPSA id f8sm19250418wjh.45.2016.09.12.12.29.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2016 12:29:41 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Al Viro Subject: [PATCH 14/17] vfs: remove unused generic_readlink() Date: Mon, 12 Sep 2016 21:29:16 +0200 Message-Id: <1473708559-12714-15-git-send-email-mszeredi@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1473708559-12714-1-git-send-email-mszeredi@redhat.com> References: <1473708559-12714-1-git-send-email-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Which is now known as vfs_readlink(). Signed-off-by: Miklos Szeredi --- fs/namei.c | 22 ++++++++++++++++------ include/linux/fs.h | 7 +------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index a93424178634..76d1f061de3c 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -4659,12 +4659,22 @@ out: return len; } -/* - * A helper for ->readlink(). This should be used *ONLY* for symlinks that - * have ->get_link() not calling nd_jump_link(). Using (or not using) it - * for any given inode is up to filesystem. +/** + * vfs_readlink - read symlink body + * @dentry: read symlink from this dentry + * @buffer: userspace buffer + * @buflen: size of userspace buffer + * + * Copy contents of symlink to userspace buffer. If the buffer is smaller than + * the length of the symlink, then the symlink is truncated. On success the + * function returns the number of bytes actually copied to the buffer. The + * terminating null character is never copied. + * + * The inode's access time is not updated. That's up to the caller if + * necessary. The caller also needs to make sure that i_op->get_link is + * non-NULL before calling this helper. */ -int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) +int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen) { DEFINE_DELAYED_CALL(done); struct inode *inode = d_inode(dentry); @@ -4684,7 +4694,7 @@ int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) do_delayed_call(&done); return res; } -EXPORT_SYMBOL(generic_readlink); +EXPORT_SYMBOL(vfs_readlink); /* get the link contents into pagecache */ const char *page_get_link(struct dentry *dentry, struct inode *inode, diff --git a/include/linux/fs.h b/include/linux/fs.h index 31e940cb7a4f..f71e70e3017b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2895,7 +2895,6 @@ extern int __page_symlink(struct inode *inode, const char *symname, int len, extern int page_symlink(struct inode *inode, const char *symname, int len); extern const struct inode_operations page_symlink_inode_operations; extern void kfree_link(void *); -extern int generic_readlink(struct dentry *, char __user *, int); extern void generic_fillattr(struct inode *, struct kstat *); int vfs_getattr_nosec(struct path *path, struct kstat *stat); extern int vfs_getattr(struct path *, struct kstat *); @@ -2916,11 +2915,7 @@ extern int vfs_lstat(const char __user *, struct kstat *); extern int vfs_fstat(unsigned int, struct kstat *); extern int vfs_fstatat(int , const char __user *, struct kstat *, int); -static inline int vfs_readlink(struct dentry *dentry, char __user *buffer, - int buflen) -{ - return generic_readlink(dentry, buffer, buflen); -} +extern int vfs_readlink(struct dentry *, char __user *, int); extern int __generic_block_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,