Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3648989ybg; Fri, 25 Oct 2019 07:05:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWtV930K/ZcND8EBr9wnfq5NnL1NYgPLtOxO1634M5Dzrg5k/iZpY/b6BU80FPFCUXSd7l X-Received: by 2002:a17:906:5e08:: with SMTP id n8mr3687135eju.20.1572012357224; Fri, 25 Oct 2019 07:05:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572012357; cv=none; d=google.com; s=arc-20160816; b=PzEeRBQ+09vzoIh9mdmBdzs7f6BE9GCmewGoVXIRwuL6jUpnk9GeuTtcxBEeU17bdo q37JU80EQ7WJstVs5POJSNuXqDZXkVtwaWGXwJTuVauGl3RHkS5LcUE6TZNvrNLDb9zP qces/IKlGaod5CKARAjYlYGaSv5LrnX6nI6O1Bu2UpKtkvAh/XspSIJ5YzMZGxsiBXue 0cLriRlM13KeX1JJDP2ZeHmZzXhiKH1kwkVroyb33dkLzKFflih5Hlpbrd2Dqt9kX6so rTmHHf72iiROAdnbufz2WWakMhAQ6BTq9vQeI0mhhr0XqaGSJla+9iuJ3RUD+ya4vpZW OQxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=y2kqeSz6fnHPq1JqCLRz1dPQKvUyqY/VKk0ymtbQ1zc=; b=PDEQqdhYZWONAAg5YpYApgwGoWlBgma8Ga6FgAf4NK0/LNIz/AWv/bUmOnokmtVTEe 76/kyl+v7MxBFhQ2vyT9QqRVkM3KDmJNlXmXjD4/hRmLblnWbBMazZfSyRg4VzgpuWcN 7mlzC+LhYKnoDgoIjroJSh+IINvmC2+aJ7/Qv2xIM0OSEa7c/cNOyzHa9nwuJDiiRuk9 ZdbWlmVN0od6MERWECBt4znYxDNKzSY1OwT8kEA+k4xNgLA9ZstvdSm7d/lnnvyqQnk8 iQoIPWli43lCxd39/OVLFdWwVaqGGKuYMQsAm9X2Tb7aX2SRF0Sm126OrmpVkn0TRG65 X9Hg== ARC-Authentication-Results: i=1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vt.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u16si1240620edi.310.2019.10.25.07.05.31; Fri, 25 Oct 2019 07:05:57 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vt.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409850AbfJXPyb (ORCPT + 99 others); Thu, 24 Oct 2019 11:54:31 -0400 Received: from outbound.smtp.vt.edu ([198.82.183.121]:54450 "EHLO omr2.cc.vt.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2409841AbfJXPy2 (ORCPT ); Thu, 24 Oct 2019 11:54:28 -0400 Received: from mr1.cc.vt.edu (mr1.cc.vt.edu [IPv6:2607:b400:92:8300:0:31:1732:8aa4]) by omr2.cc.vt.edu (8.14.4/8.14.4) with ESMTP id x9OFsRoR026872 for ; Thu, 24 Oct 2019 11:54:27 -0400 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mr1.cc.vt.edu (8.14.7/8.14.7) with ESMTP id x9OFsLud023262 for ; Thu, 24 Oct 2019 11:54:26 -0400 Received: by mail-qk1-f199.google.com with SMTP id x186so23865950qke.13 for ; Thu, 24 Oct 2019 08:54:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=y2kqeSz6fnHPq1JqCLRz1dPQKvUyqY/VKk0ymtbQ1zc=; b=oBY08cecn7vC0AmdJBjg6nXWu5VGmZypiOdJClGBA5RvTmNipEF66BIyojh1G6bss2 5bOgjUjPG6NcYCMzqq6fZbhvrchYZ4SFgPPlNgJveSLrve1kgGepP5gGCYkKb4CdT9Ce Z/KL7/Nzya12R3duyWYdB7JuteuwL8r9fvD+QjlmvGWb48rp+ey+Qhi0NhcY9yiOFdPD 1BCcYlqzPUnyWnlZXww6sJbttD/a60sgnakWwvxz1ljnhfCvWoxDx4RRVIwvVpo9Xo4A 9xOoO0SYASz2NEYxuOHdyNqjwyVCjsn/0YIF0W7lPY3FWNQhlT9bwjVQrtbscNezTGmi yEAQ== X-Gm-Message-State: APjAAAVmXHhnaso6W9GWm5dB08/8DYfCSAAi7VX1qKMX60IcduUfxURR Ko5xVXgYX3nbg4p2/JydE0trMBS8X/kgn1svDdwocvnCmfpcZBjo+h4UobYwDUZWljXHapbrQ1w 9hbsB7onYZGZFI7jDKJuGdcVMFPOOkhzO8Js= X-Received: by 2002:ac8:237b:: with SMTP id b56mr5044135qtb.264.1571932461742; Thu, 24 Oct 2019 08:54:21 -0700 (PDT) X-Received: by 2002:ac8:237b:: with SMTP id b56mr5044105qtb.264.1571932461413; Thu, 24 Oct 2019 08:54:21 -0700 (PDT) Received: from turing-police.lan ([2601:5c0:c001:c9e1::359]) by smtp.gmail.com with ESMTPSA id x133sm12693274qka.44.2019.10.24.08.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 08:54:20 -0700 (PDT) From: Valdis Kletnieks X-Google-Original-From: Valdis Kletnieks To: Greg Kroah-Hartman Cc: Valdis Kletnieks , Valdis Kletnieks , linux-fsdevel@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/15] staging: exfat: Clean up return codes - FFS_FILEEXIST Date: Thu, 24 Oct 2019 11:53:17 -0400 Message-Id: <20191024155327.1095907-7-Valdis.Kletnieks@vt.edu> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191024155327.1095907-1-Valdis.Kletnieks@vt.edu> References: <20191024155327.1095907-1-Valdis.Kletnieks@vt.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert FFS_FILEEXIST to -EEXIST Signed-off-by: Valdis Kletnieks --- drivers/staging/exfat/exfat.h | 1 - drivers/staging/exfat/exfat_core.c | 2 +- drivers/staging/exfat/exfat_super.c | 14 +++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h index a2b865788697..c56363652c5d 100644 --- a/drivers/staging/exfat/exfat.h +++ b/drivers/staging/exfat/exfat.h @@ -216,7 +216,6 @@ static inline u16 get_row_index(u16 i) #define FFS_SEMAPHOREERR 6 #define FFS_INVALIDPATH 7 #define FFS_INVALIDFID 8 -#define FFS_FILEEXIST 10 #define FFS_NOTOPENED 12 #define FFS_MAXOPENED 13 #define FFS_EOF 15 diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c index af1ccd686e01..ba5680123b0f 100644 --- a/drivers/staging/exfat/exfat_core.c +++ b/drivers/staging/exfat/exfat_core.c @@ -2103,7 +2103,7 @@ static s32 fat_generate_dos_name(struct super_block *sb, struct chain_t *p_dir, } if ((count == 0) || (count >= 1024)) - return FFS_FILEEXIST; + return -EEXIST; fat_attach_count_to_dos_name(p_dosname->name, count); /* Now dos_name has DOS~????.EXT */ diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index eb3c3642abca..2c294e238d7b 100644 --- a/drivers/staging/exfat/exfat_super.c +++ b/drivers/staging/exfat/exfat_super.c @@ -1288,7 +1288,7 @@ static int ffsMoveFile(struct inode *old_parent_inode, struct file_id_t *fid, new_clu.flags = new_fid->flags; if (!is_dir_empty(sb, &new_clu)) { - ret = FFS_FILEEXIST; + ret = -EEXIST; goto out; } } @@ -2156,7 +2156,7 @@ static int ffsRemoveDir(struct inode *inode, struct file_id_t *fid) clu_to_free.flags = fid->flags; if (!is_dir_empty(sb, &clu_to_free)) { - ret = FFS_FILEEXIST; + ret = -EEXIST; goto out; } @@ -2358,7 +2358,7 @@ static int exfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, if (err) { if (err == FFS_INVALIDPATH) err = -EINVAL; - else if (err == FFS_FILEEXIST) + else if (err == -EEXIST) err = -EEXIST; else if (err == -ENOSPC) err = -ENOSPC; @@ -2569,7 +2569,7 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry, if (err) { if (err == FFS_INVALIDPATH) err = -EINVAL; - else if (err == FFS_FILEEXIST) + else if (err == -EEXIST) err = -EEXIST; else if (err == -ENOSPC) err = -ENOSPC; @@ -2639,7 +2639,7 @@ static int exfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) if (err) { if (err == FFS_INVALIDPATH) err = -EINVAL; - else if (err == FFS_FILEEXIST) + else if (err == -EEXIST) err = -EEXIST; else if (err == -ENOSPC) err = -ENOSPC; @@ -2693,7 +2693,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) if (err) { if (err == FFS_INVALIDPATH) err = -EINVAL; - else if (err == FFS_FILEEXIST) + else if (err == -EEXIST) err = -ENOTEMPTY; else if (err == -ENOENT) err = -ENOENT; @@ -2750,7 +2750,7 @@ static int exfat_rename(struct inode *old_dir, struct dentry *old_dentry, err = -EPERM; else if (err == FFS_INVALIDPATH) err = -EINVAL; - else if (err == FFS_FILEEXIST) + else if (err == -EEXIST) err = -EEXIST; else if (err == -ENOENT) err = -ENOENT; -- 2.23.0