From patchwork Tue Jan 15 10:19:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10764249 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 2F9A3186E for ; Tue, 15 Jan 2019 10:19:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D95B2B2ED for ; Tue, 15 Jan 2019 10:19:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 121692B2FF; Tue, 15 Jan 2019 10:19:52 +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 A8A252B2ED for ; Tue, 15 Jan 2019 10:19:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728439AbfAOKTv (ORCPT ); Tue, 15 Jan 2019 05:19:51 -0500 Received: from relay.sw.ru ([185.231.240.75]:36314 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728202AbfAOKTu (ORCPT ); Tue, 15 Jan 2019 05:19:50 -0500 Received: from [172.16.25.169] (helo=localhost.localdomain) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gjLoy-000130-9F; Tue, 15 Jan 2019 13:19:48 +0300 Subject: [PATCH 6/7] fuse: Kill unused FR_ABORTED, FR_LOCKED and FR_PRIVATE flags From: Kirill Tkhai To: miklos@szeredi.hu, ktkhai@virtuozzo.com, linux-fsdevel@vger.kernel.org Date: Tue, 15 Jan 2019 13:19:47 +0300 Message-ID: <154754758730.4244.17451195008535612523.stgit@localhost.localdomain> In-Reply-To: <154754701031.4244.8089449938935364463.stgit@localhost.localdomain> References: <154754701031.4244.8089449938935364463.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 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 Signed-off-by: Kirill Tkhai --- fs/fuse/dev.c | 9 ++------- fs/fuse/fuse_i.h | 14 +------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 4905abfb279e..c3bacf9191a6 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1349,7 +1349,6 @@ static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file, (struct fuse_arg *) in->args, 0); fuse_copy_finish(cs); spin_lock(&fpq->lock); - clear_bit(FR_LOCKED, &req->flags); if (!fpq->connected) { err = fc->aborted ? -ECONNABORTED : -ENODEV; goto out_end; @@ -1376,8 +1375,7 @@ static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file, return reqsize; out_end: - if (!test_bit(FR_PRIVATE, &req->flags)) - list_del_init(&req->list); + list_del_init(&req->list); spin_unlock(&fpq->lock); request_end(fc, req); return err; @@ -1955,7 +1953,6 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud, clear_bit(FR_SENT, &req->flags); list_move(&req->list, &fpq->io); req->out.h = oh; - set_bit(FR_LOCKED, &req->flags); spin_unlock(&fpq->lock); cs->req = req; if (!req->out.page_replace) @@ -1965,13 +1962,11 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud, fuse_copy_finish(cs); spin_lock(&fpq->lock); - clear_bit(FR_LOCKED, &req->flags); if (!fpq->connected) err = -ENOENT; else if (err) req->out.h.error = -EIO; - if (!test_bit(FR_PRIVATE, &req->flags)) - list_del_init(&req->list); + list_del_init(&req->list); spin_unlock(&fpq->lock); request_end(fc, req); diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index b5f2265c437c..09ea5773ad81 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -332,35 +332,23 @@ struct fuse_io_priv { * FR_FORCE: force sending of the request even if interrupted * FR_BACKGROUND: request is sent in the background * FR_WAITING: request is counted as "waiting" - * FR_ABORTED: the request was aborted * FR_INTERRUPTED: the request has been interrupted - * FR_LOCKED: data is being copied to/from the request * FR_PENDING: request is not yet in userspace * FR_SENT: request is in userspace, waiting for an answer * FR_FINISHED: request is finished - * FR_PRIVATE: request is on private list */ enum fuse_req_flag { FR_ISREPLY, FR_FORCE, FR_BACKGROUND, FR_WAITING, - FR_ABORTED, FR_INTERRUPTED, - FR_LOCKED, FR_PENDING, FR_SENT, FR_FINISHED, - FR_PRIVATE, }; -/** - * A request to the client - * - * .waitq.lock protects the following fields: - * - FR_ABORTED - * - FR_LOCKED (may also be modified under fc->lock, tested under both) - */ +/* A request to the client */ struct fuse_req { /** This can be on either pending processing or io lists in fuse_conn */