From patchwork Tue Feb 26 09:36:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yufen Yu X-Patchwork-Id: 10829797 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53BD217EF for ; Tue, 26 Feb 2019 09:35:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4238B2AF1F for ; Tue, 26 Feb 2019 09:35:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 364EF2B18F; Tue, 26 Feb 2019 09:35:53 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 CFBE92AF1F for ; Tue, 26 Feb 2019 09:35:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727633AbfBZJfw (ORCPT ); Tue, 26 Feb 2019 04:35:52 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:4167 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726223AbfBZJfv (ORCPT ); Tue, 26 Feb 2019 04:35:51 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 699E25D1651812B0C529; Tue, 26 Feb 2019 17:32:49 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.408.0; Tue, 26 Feb 2019 17:32:44 +0800 From: Yufen Yu To: CC: Subject: [PATCH] fs/libfs.c: let lseek use SEEK_SET and SEEK_CUR Date: Tue, 26 Feb 2019 17:36:59 +0800 Message-ID: <20190226093659.111125-1-yuyufen@huawei.com> X-Mailer: git-send-email 2.16.2.dirty MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected 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 Let dcache_dir_lseek() use SEEK_SET and SEEK_CUR to make code more unify. Signed-off-by: Yufen Yu --- fs/libfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/libfs.c b/fs/libfs.c index 0fb590d79f30..37654d33bd29 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -144,9 +144,9 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence) { struct dentry *dentry = file->f_path.dentry; switch (whence) { - case 1: + case SEEK_CUR: offset += file->f_pos; - case 0: + case SEEK_SET: if (offset >= 0) break; default: