From nobody Sat May 4 01:52:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582292407; cv=none; d=zohomail.com; s=zohoarc; b=n6D9e0RP970tYWqjmrhtX4IDa09RXYXWJgNenySof/p7S6/Yg3c5PtOcXGqBg51uO7sMEkmUbR+W8NSUdbEyZT42FSzYZVS2U8l0DxiZXnZ/ACH7rBlGO4hExUOvjvu31GgN/1Mi2lEc9GvQGXigobRob17LZRewNMmOZLyL5go= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582292407; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ou82nfRlLTKFiiP9tvRubo3I4987Bvtv3Cz7XMNiIrg=; b=SRfylpoymqwPRaF9vY3e4/O0L5B72k2e3RQos81275U78dtuqc98I+7l2t0s8o3Mdyl5n5tEHYBBrIF5JK+zM1qfhrIu667etF75RgPjccp24l6Ujy3APHvqpfCO0YkdTcZgGCIoNBHxg4ZrJQWCJqANPLCKBNXRUDg2zbsgvmo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582292407546327.26423097823647; Fri, 21 Feb 2020 05:40:07 -0800 (PST) Received: from localhost ([::1]:57984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58XF-0007Ib-7y for importer@patchew.org; Fri, 21 Feb 2020 08:40:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32903) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58JR-0002ml-F0 for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j58JO-0007Dp-P0 for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:47 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:36356 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j58JO-0007CQ-Gw for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:46 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-357-Hx0QJl4DP0KZBPwJI8IjRg-1; Fri, 21 Feb 2020 08:25:42 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B2C4CDB23; Fri, 21 Feb 2020 13:25:41 +0000 (UTC) Received: from dgilbert-t580.localhost (unknown [10.36.118.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9C3A8B745; Fri, 21 Feb 2020 13:25:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582291545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ou82nfRlLTKFiiP9tvRubo3I4987Bvtv3Cz7XMNiIrg=; b=Nk29l1ARcTi18y2/oM6ztUOfVdA40fHOjhoGWU9oesUBwttzrrotsong8VVeHv2zSUUYHu Ge1dr6zgE4CRyyHBJVFkx6aI2/wkILJmdlPpVvG8m6yxcsQNSG0kPwVJBe1VM3epL+rlhk FKFcgvBWYxbof5ZdKAewfnIB6i3XLw0= X-MC-Unique: Hx0QJl4DP0KZBPwJI8IjRg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, philmd@redhat.com, yangx.jy@cn.fujitsu.com, mrezanin@redhat.com Subject: [PULL 1/6] virtiofsd: Help message fix for 'seconds' Date: Fri, 21 Feb 2020 13:25:31 +0000 Message-Id: <20200221132536.38364-2-dgilbert@redhat.com> In-Reply-To: <20200221132536.38364-1-dgilbert@redhat.com> References: <20200221132536.38364-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" second should be seconds. Reported-by: Christophe de Dinechin Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c index 0801cf752c..819c2bc13c 100644 --- a/tools/virtiofsd/helper.c +++ b/tools/virtiofsd/helper.c @@ -165,7 +165,7 @@ void fuse_cmdline_help(void) " enable/disable readirplus\n" " default: readdirplus except wit= h " "cache=3Dnone\n" - " -o timeout=3D I/O timeout (second)\n" + " -o timeout=3D I/O timeout (seconds)\n" " default: depends on cache=3D op= tion.\n" " -o writeback|no_writeback enable/disable writeback cache\= n" " default: no_writeback\n" --=20 2.24.1 From nobody Sat May 4 01:52:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582292122; cv=none; d=zohomail.com; s=zohoarc; b=muVFb/qd2uXpL5ReW3H93Wq2NIllAXZNSZ/bfZXMDuxPmxqQfZr1EKAfe1bssuul1DQL1T+pRtIxsok5tGmm609yhPnMEwt7isYxGKveC4LKYeu1fy1dRyrZC6N4cJ9p0v/vBo8Zq0FBmZVD/Wd1j6nAvBTm6Ynf/S4dhxEB8sM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582292122; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gHpGZPegfWHVhKgIAmrHIDKDWR6mi0Dl7I1mfwjtkJE=; b=LBzQIgZP/hwUOe0y5cmc9j8yclP3mSRD0xRXLwVu86qi2gWEitk99fgQ3xSlx/8ydAdj0izTA4Wu1EnaAJ6L6G7pEbuxLkDaCm7+YmV4H+3OuyViPcbVSy/YN0Ha2Br+v2NApQ4w9AgLhXLfXe21flEYp95bbhfz07bmiiMdiM4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582292122834457.09372209233516; Fri, 21 Feb 2020 05:35:22 -0800 (PST) Received: from localhost ([::1]:57852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58Sf-00075Y-Kg for importer@patchew.org; Fri, 21 Feb 2020 08:35:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32896) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58JQ-0002ln-M0 for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j58JO-0007Dh-Nu for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:47 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:29468 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j58JO-0007D8-Jj for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:46 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-273-ITq4KLSUMvS4zNaQbex7fA-1; Fri, 21 Feb 2020 08:25:44 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 14784107ACC7; Fri, 21 Feb 2020 13:25:43 +0000 (UTC) Received: from dgilbert-t580.localhost (unknown [10.36.118.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C54F84BCC; Fri, 21 Feb 2020 13:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582291546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gHpGZPegfWHVhKgIAmrHIDKDWR6mi0Dl7I1mfwjtkJE=; b=gqNI9gwgD592TVQSorG7QaYfT6fpFdrsyQOvqRyamrBSZofBAT/3ddrlorsiQgdpS5SkR/ FSc0zsQMsvdhHrlp7f5QIlrLvW9gzhp9qvtZFjLoCX0mt9lXhkCH/Pe01H60o/btQ32u6X ZkAwXvRTigwRR+osnM4H0OlbIdgWcjk= X-MC-Unique: ITq4KLSUMvS4zNaQbex7fA-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, philmd@redhat.com, yangx.jy@cn.fujitsu.com, mrezanin@redhat.com Subject: [PULL 2/6] tools/virtiofsd/passthrough_ll: Remove unneeded variable assignment Date: Fri, 21 Feb 2020 13:25:32 +0000 Message-Id: <20200221132536.38364-3-dgilbert@redhat.com> In-Reply-To: <20200221132536.38364-1-dgilbert@redhat.com> References: <20200221132536.38364-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Fix warning reported by Clang static code analyzer: CC tools/virtiofsd/passthrough_ll.o tools/virtiofsd/passthrough_ll.c:1083:5: warning: Value stored to 'saverr= ' is never read saverr =3D ENOMEM; ^ ~~~~~~ Fixes: 7c6b66027 Reported-by: Clang Static Analyzer Reviewed-by: J=C3=A1n Tomko Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index c635fc8820..e9e71d5fc2 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -1080,8 +1080,6 @@ static void lo_mknod_symlink(fuse_req_t req, fuse_ino= _t parent, return; } =20 - saverr =3D ENOMEM; - saverr =3D lo_change_cred(req, &old); if (saverr) { goto out; --=20 2.24.1 From nobody Sat May 4 01:52:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582292488; cv=none; d=zohomail.com; s=zohoarc; b=c2n1WWxwnHA0MPNAOEx+AZ0Jddy3rzl2bonaAfn53gJGAu5Yt1A9FDMs7WXbRIwfPiMcB2VfaEaHxfD9Mc7lBfj8KYUBvJGj7tDk38IYWenZMEE4NJ92gGSVEXTptM383Ep7RNdcZEH23ys6q14nbI4/NPX8bdgswRSy+wWeCoY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582292488; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uX9UesRfQ5VevuWklXMAkSBnSnsaUKk6WMwfeYmvayw=; b=PXdUoLvi8hxFsIVmpc3TKzbERKYRZFbd0kEYeGqU5ManK4RiYEpMPMq9CzTGLiO4kv33rNZbnXNnY9sqs2hjZ92ilvJRAwNPzu9NrUdKUbfjWzQ2fLzz9WE8TDrWbRj4SQaGt2hTkCe9JctrzU7QlEpThpgJIUZRR/eQEm7T3S0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582292488437960.5844935203085; Fri, 21 Feb 2020 05:41:28 -0800 (PST) Received: from localhost ([::1]:58028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58YZ-0001XF-FK for importer@patchew.org; Fri, 21 Feb 2020 08:41:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32945) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58JV-0002rx-RM for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j58JU-0007Ir-4b for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:53 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:29573 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j58JT-0007Hr-V3 for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:52 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-431-eYrySuXtP06viUveA0SgSA-1; Fri, 21 Feb 2020 08:25:45 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 67956107ACC5; Fri, 21 Feb 2020 13:25:44 +0000 (UTC) Received: from dgilbert-t580.localhost (unknown [10.36.118.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6135F84BCC; Fri, 21 Feb 2020 13:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582291550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uX9UesRfQ5VevuWklXMAkSBnSnsaUKk6WMwfeYmvayw=; b=Gt8BQl0Gp1OOPAwTX4+NURk8CmYVJg/WTY11vQc7DzHMBYyU2tM/5g6YcZhkClN+XKVO4b elurKyWXVlCmzoaE9oIoIejdJFtb3ABgrUWsA6QDfBHVJZXxG027bAxWdD+/XvnfpPAVHb wjTvIoD4K7CllHisN96rYrlNGVxe/Qk= X-MC-Unique: eYrySuXtP06viUveA0SgSA-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, philmd@redhat.com, yangx.jy@cn.fujitsu.com, mrezanin@redhat.com Subject: [PULL 3/6] tools/virtiofsd/passthrough_ll: Remove unneeded variable assignment Date: Fri, 21 Feb 2020 13:25:33 +0000 Message-Id: <20200221132536.38364-4-dgilbert@redhat.com> In-Reply-To: <20200221132536.38364-1-dgilbert@redhat.com> References: <20200221132536.38364-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Fix warning reported by Clang static code analyzer: CC tools/virtiofsd/passthrough_ll.o tools/virtiofsd/passthrough_ll.c:925:9: warning: Value stored to 'newfd' = is never read newfd =3D -1; ^ ~~ tools/virtiofsd/passthrough_ll.c:942:9: warning: Value stored to 'newfd' = is never read newfd =3D -1; ^ ~~ Fixes: 7c6b66027 Reported-by: Clang Static Analyzer Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: J=C3=A1n Tomko Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index e9e71d5fc2..02ff01fad0 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -922,7 +922,6 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t pare= nt, const char *name, inode =3D lo_find(lo, &e->attr); if (inode) { close(newfd); - newfd =3D -1; } else { inode =3D calloc(1, sizeof(struct lo_inode)); if (!inode) { @@ -939,7 +938,6 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t pare= nt, const char *name, =20 inode->nlookup =3D 1; inode->fd =3D newfd; - newfd =3D -1; inode->key.ino =3D e->attr.st_ino; inode->key.dev =3D e->attr.st_dev; pthread_mutex_init(&inode->plock_mutex, NULL); --=20 2.24.1 From nobody Sat May 4 01:52:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582292145; cv=none; d=zohomail.com; s=zohoarc; b=N1fk8rdDgbTz47gFeh4L8KwPbYHBzsujfxpRWZ4bh3rsSReCFtCNBt5f2JaKs0RIJfSfEdKS6oxHuHnWcus4RZc2xqxFPbY7W3g/ChXAT5hy5jsSi1mTMXpdxsSwjDlLpWqEIQVA51/qbNjFfQu0ZUwEubusGTf5RcpSZYPT+2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582292145; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=APsBDV8v6Rdge5cAZAlMpEcC2lgAY5iiZWQDzi9u8nc=; b=X2HaGoWAtxuPp6IHYhkiKvYuGb/o5y2d0zjTXauhtFgr6V6Ov9zR/jc8pJ8DbxVHdmjixFNYuXIkyVcGhEAGOwpzUFrLrglUnC8j1sx6dqJ9LeIIG5VMlxc4QSOkiRxRNmurScUMeignx5SD4oxwS+Pcddvg48y6Fs27ZlOdjho= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582292145323225.95173689245257; Fri, 21 Feb 2020 05:35:45 -0800 (PST) Received: from localhost ([::1]:57870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58T2-0007ug-7C for importer@patchew.org; Fri, 21 Feb 2020 08:35:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32940) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58JV-0002qf-E6 for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j58JU-0007Iq-4e for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:53 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:43132 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j58JU-0007G2-0H for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:52 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-44-5pDVRltmPA2LhNeijndJZA-1; Fri, 21 Feb 2020 08:25:46 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BBFB18017DF; Fri, 21 Feb 2020 13:25:45 +0000 (UTC) Received: from dgilbert-t580.localhost (unknown [10.36.118.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3D778B740; Fri, 21 Feb 2020 13:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582291548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=APsBDV8v6Rdge5cAZAlMpEcC2lgAY5iiZWQDzi9u8nc=; b=evWnp0PDFCucCmsZfeI8H60C0P1myf4+bQRnRO3M8euuF2Z3znBZNlu4ksEKCdNnCvJIc3 i/d1WlAPGdR/NdFqI3w2G+/0CG1HJIu2t90v2XB85TJzCyzhjWdAhNLk9ELYYpyrPjXvef pJdy0A1YUDeUOBIObeOLC/t9C6aLQ3k= X-MC-Unique: 5pDVRltmPA2LhNeijndJZA-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, philmd@redhat.com, yangx.jy@cn.fujitsu.com, mrezanin@redhat.com Subject: [PULL 4/6] tools/virtiofsd/fuse_lowlevel: Fix fuse_out_header::error value Date: Fri, 21 Feb 2020 13:25:34 +0000 Message-Id: <20200221132536.38364-5-dgilbert@redhat.com> In-Reply-To: <20200221132536.38364-1-dgilbert@redhat.com> References: <20200221132536.38364-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Fix warning reported by Clang static code analyzer: CC tools/virtiofsd/fuse_lowlevel.o tools/virtiofsd/fuse_lowlevel.c:195:9: warning: Value stored to 'error' i= s never read error =3D -ERANGE; ^ ~~~~~~~ Fixes: 3db2876 Reported-by: Clang Static Analyzer Reviewed-by: J=C3=A1n Tomko Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_lowlevel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowleve= l.c index 704c0369b2..2dd36ec03b 100644 --- a/tools/virtiofsd/fuse_lowlevel.c +++ b/tools/virtiofsd/fuse_lowlevel.c @@ -192,7 +192,7 @@ int fuse_send_reply_iov_nofree(fuse_req_t req, int erro= r, struct iovec *iov, =20 if (error <=3D -1000 || error > 0) { fuse_log(FUSE_LOG_ERR, "fuse: bad error value: %i\n", error); - error =3D -ERANGE; + out.error =3D -ERANGE; } =20 iov[0].iov_base =3D &out; --=20 2.24.1 From nobody Sat May 4 01:52:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582292407; cv=none; d=zohomail.com; s=zohoarc; b=Nwg4LoS3ALQzBp7BxXCR5dgpPIph9pa9COgHwvZDDQIBYiJ+Wv+XpnSjyllQtYFRDNF0wfurl9df/SaJPupmg0v1ObH4iGb6KTXYZCvFR3NQCZj+SLauZymYMZk+vkeMc69a9rhMkZtmXTro5KfFW4CV9xpbLPSt/u36kC800zg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582292407; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=U6UJqptHsTqKYUrfz6WFYLpxsPaoKoK+fn7ZNJZgIZw=; b=auTWAnmc880LZsBFzlvClmwHdFNW1GKmjuPWTI5zt7hwIh9So/upzyo+Jg7VxUgIcemFVxTh7lQpvP+MFsTiJka06jtGz/Qz8FFJXNhSaDzun9OL1JwyqTkwHf1Mzb/jx5BhxisKKKqT4eHZVgKvCmcQiuED2UR7V+N51jC3NIo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582292407251511.49319859474645; Fri, 21 Feb 2020 05:40:07 -0800 (PST) Received: from localhost ([::1]:57982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58XE-0007GC-TX for importer@patchew.org; Fri, 21 Feb 2020 08:40:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32988) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58Jj-00030x-10 for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:26:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j58JZ-0007N5-Bm for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:26:03 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:38737 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j58JZ-0007L9-2z for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:57 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-288-aHNs4mAePUqpQmJpEKrhqg-1; Fri, 21 Feb 2020 08:25:48 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 727241005512; Fri, 21 Feb 2020 13:25:47 +0000 (UTC) Received: from dgilbert-t580.localhost (unknown [10.36.118.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 187CC84BCC; Fri, 21 Feb 2020 13:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582291555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U6UJqptHsTqKYUrfz6WFYLpxsPaoKoK+fn7ZNJZgIZw=; b=IM1lXjJ3/Y241vWqfo79rKYY19lwuRUHJBeWFEc6Oeqw+wZc059SEE2GN4WxatQEZrXApa 1hTGqVrkcTaB7zNKxScFzc5PvJyAYLoiusv0XJx1ZYYahtbIfhxubeVeABXG5Alg2W3XO4 VHNMZj9SY2h+O7x+ndh4uqb98gHX2qg= X-MC-Unique: aHNs4mAePUqpQmJpEKrhqg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, philmd@redhat.com, yangx.jy@cn.fujitsu.com, mrezanin@redhat.com Subject: [PULL 5/6] virtiofsd: Remove fuse.h and struct fuse_module Date: Fri, 21 Feb 2020 13:25:35 +0000 Message-Id: <20200221132536.38364-6-dgilbert@redhat.com> In-Reply-To: <20200221132536.38364-1-dgilbert@redhat.com> References: <20200221132536.38364-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Xiao Yang All code in fuse.h and struct fuse_module are not used by virtiofsd so removing them is safe. Signed-off-by: Xiao Yang Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse.h | 1229 -------------------------------------- tools/virtiofsd/fuse_i.h | 16 - 2 files changed, 1245 deletions(-) delete mode 100644 tools/virtiofsd/fuse.h diff --git a/tools/virtiofsd/fuse.h b/tools/virtiofsd/fuse.h deleted file mode 100644 index aba13fef2d..0000000000 --- a/tools/virtiofsd/fuse.h +++ /dev/null @@ -1,1229 +0,0 @@ -/* - * FUSE: Filesystem in Userspace - * Copyright (C) 2001-2007 Miklos Szeredi - * - * This program can be distributed under the terms of the GNU LGPLv2. - * See the file COPYING.LIB. - */ - -#ifndef FUSE_H_ -#define FUSE_H_ - -/* - * - * This file defines the library interface of FUSE - * - * IMPORTANT: you should define FUSE_USE_VERSION before including this hea= der. - */ - -#include "fuse_common.h" - -#include -#include -#include -#include -#include -#include - -/* - * Basic FUSE API - */ - -/** Handle for a FUSE filesystem */ -struct fuse; - -/** - * Readdir flags, passed to ->readdir() - */ -enum fuse_readdir_flags { - /** - * "Plus" mode. - * - * The kernel wants to prefill the inode cache during readdir. The - * filesystem may honour this by filling in the attributes and setting - * FUSE_FILL_DIR_FLAGS for the filler function. The filesystem may al= so - * just ignore this flag completely. - */ - FUSE_READDIR_PLUS =3D (1 << 0), -}; - -enum fuse_fill_dir_flags { - /** - * "Plus" mode: all file attributes are valid - * - * The attributes are used by the kernel to prefill the inode cache - * during a readdir. - * - * It is okay to set FUSE_FILL_DIR_PLUS if FUSE_READDIR_PLUS is not set - * and vice versa. - */ - FUSE_FILL_DIR_PLUS =3D (1 << 1), -}; - -/** - * Function to add an entry in a readdir() operation - * - * The *off* parameter can be any non-zero value that enables the - * filesystem to identify the current point in the directory - * stream. It does not need to be the actual physical position. A - * value of zero is reserved to indicate that seeking in directories - * is not supported. - * - * @param buf the buffer passed to the readdir() operation - * @param name the file name of the directory entry - * @param stat file attributes, can be NULL - * @param off offset of the next entry or zero - * @param flags fill flags - * @return 1 if buffer is full, zero otherwise - */ -typedef int (*fuse_fill_dir_t)(void *buf, const char *name, - const struct stat *stbuf, off_t off, - enum fuse_fill_dir_flags flags); -/** - * Configuration of the high-level API - * - * This structure is initialized from the arguments passed to - * fuse_new(), and then passed to the file system's init() handler - * which should ensure that the configuration is compatible with the - * file system implementation. - */ -struct fuse_config { - /** - * If `set_gid` is non-zero, the st_gid attribute of each file - * is overwritten with the value of `gid`. - */ - int set_gid; - unsigned int gid; - - /** - * If `set_uid` is non-zero, the st_uid attribute of each file - * is overwritten with the value of `uid`. - */ - int set_uid; - unsigned int uid; - - /** - * If `set_mode` is non-zero, the any permissions bits set in - * `umask` are unset in the st_mode attribute of each file. - */ - int set_mode; - unsigned int umask; - - /** - * The timeout in seconds for which name lookups will be - * cached. - */ - double entry_timeout; - - /** - * The timeout in seconds for which a negative lookup will be - * cached. This means, that if file did not exist (lookup - * retuned ENOENT), the lookup will only be redone after the - * timeout, and the file/directory will be assumed to not - * exist until then. A value of zero means that negative - * lookups are not cached. - */ - double negative_timeout; - - /** - * The timeout in seconds for which file/directory attributes - * (as returned by e.g. the `getattr` handler) are cached. - */ - double attr_timeout; - - /** - * Allow requests to be interrupted - */ - int intr; - - /** - * Specify which signal number to send to the filesystem when - * a request is interrupted. The default is hardcoded to - * USR1. - */ - int intr_signal; - - /** - * Normally, FUSE assigns inodes to paths only for as long as - * the kernel is aware of them. With this option inodes are - * instead remembered for at least this many seconds. This - * will require more memory, but may be necessary when using - * applications that make use of inode numbers. - * - * A number of -1 means that inodes will be remembered for the - * entire life-time of the file-system process. - */ - int remember; - - /** - * The default behavior is that if an open file is deleted, - * the file is renamed to a hidden file (.fuse_hiddenXXX), and - * only removed when the file is finally released. This - * relieves the filesystem implementation of having to deal - * with this problem. This option disables the hiding - * behavior, and files are removed immediately in an unlink - * operation (or in a rename operation which overwrites an - * existing file). - * - * It is recommended that you not use the hard_remove - * option. When hard_remove is set, the following libc - * functions fail on unlinked files (returning errno of - * ENOENT): read(2), write(2), fsync(2), close(2), f*xattr(2), - * ftruncate(2), fstat(2), fchmod(2), fchown(2) - */ - int hard_remove; - - /** - * Honor the st_ino field in the functions getattr() and - * fill_dir(). This value is used to fill in the st_ino field - * in the stat(2), lstat(2), fstat(2) functions and the d_ino - * field in the readdir(2) function. The filesystem does not - * have to guarantee uniqueness, however some applications - * rely on this value being unique for the whole filesystem. - * - * Note that this does *not* affect the inode that libfuse - * and the kernel use internally (also called the "nodeid"). - */ - int use_ino; - - /** - * If use_ino option is not given, still try to fill in the - * d_ino field in readdir(2). If the name was previously - * looked up, and is still in the cache, the inode number - * found there will be used. Otherwise it will be set to -1. - * If use_ino option is given, this option is ignored. - */ - int readdir_ino; - - /** - * This option disables the use of page cache (file content cache) - * in the kernel for this filesystem. This has several affects: - * - * 1. Each read(2) or write(2) system call will initiate one - * or more read or write operations, data will not be - * cached in the kernel. - * - * 2. The return value of the read() and write() system calls - * will correspond to the return values of the read and - * write operations. This is useful for example if the - * file size is not known in advance (before reading it). - * - * Internally, enabling this option causes fuse to set the - * `direct_io` field of `struct fuse_file_info` - overwriting - * any value that was put there by the file system. - */ - int direct_io; - - /** - * This option disables flushing the cache of the file - * contents on every open(2). This should only be enabled on - * filesystems where the file data is never changed - * externally (not through the mounted FUSE filesystem). Thus - * it is not suitable for network filesystems and other - * intermediate filesystems. - * - * NOTE: if this option is not specified (and neither - * direct_io) data is still cached after the open(2), so a - * read(2) system call will not always initiate a read - * operation. - * - * Internally, enabling this option causes fuse to set the - * `keep_cache` field of `struct fuse_file_info` - overwriting - * any value that was put there by the file system. - */ - int kernel_cache; - - /** - * This option is an alternative to `kernel_cache`. Instead of - * unconditionally keeping cached data, the cached data is - * invalidated on open(2) if if the modification time or the - * size of the file has changed since it was last opened. - */ - int auto_cache; - - /** - * The timeout in seconds for which file attributes are cached - * for the purpose of checking if auto_cache should flush the - * file data on open. - */ - int ac_attr_timeout_set; - double ac_attr_timeout; - - /** - * If this option is given the file-system handlers for the - * following operations will not receive path information: - * read, write, flush, release, fsync, readdir, releasedir, - * fsyncdir, lock, ioctl and poll. - * - * For the truncate, getattr, chmod, chown and utimens - * operations the path will be provided only if the struct - * fuse_file_info argument is NULL. - */ - int nullpath_ok; - - /** - * The remaining options are used by libfuse internally and - * should not be touched. - */ - int show_help; - char *modules; - int debug; -}; - - -/** - * The file system operations: - * - * Most of these should work very similarly to the well known UNIX - * file system operations. A major exception is that instead of - * returning an error in 'errno', the operation should return the - * negated error value (-errno) directly. - * - * All methods are optional, but some are essential for a useful - * filesystem (e.g. getattr). Open, flush, release, fsync, opendir, - * releasedir, fsyncdir, access, create, truncate, lock, init and - * destroy are special purpose methods, without which a full featured - * filesystem can still be implemented. - * - * In general, all methods are expected to perform any necessary - * permission checking. However, a filesystem may delegate this task - * to the kernel by passing the `default_permissions` mount option to - * `fuse_new()`. In this case, methods will only be called if - * the kernel's permission check has succeeded. - * - * Almost all operations take a path which can be of any length. - */ -struct fuse_operations { - /** - * Get file attributes. - * - * Similar to stat(). The 'st_dev' and 'st_blksize' fields are - * ignored. The 'st_ino' field is ignored except if the 'use_ino' - * mount option is given. In that case it is passed to userspace, - * but libfuse and the kernel will still assign a different - * inode for internal use (called the "nodeid"). - * - * `fi` will always be NULL if the file is not currently open, but - * may also be NULL if the file is open. - */ - int (*getattr)(const char *, struct stat *, struct fuse_file_info *fi); - - /** - * Read the target of a symbolic link - * - * The buffer should be filled with a null terminated string. The - * buffer size argument includes the space for the terminating - * null character. If the linkname is too long to fit in the - * buffer, it should be truncated. The return value should be 0 - * for success. - */ - int (*readlink)(const char *, char *, size_t); - - /** - * Create a file node - * - * This is called for creation of all non-directory, non-symlink - * nodes. If the filesystem defines a create() method, then for - * regular files that will be called instead. - */ - int (*mknod)(const char *, mode_t, dev_t); - - /** - * Create a directory - * - * Note that the mode argument may not have the type specification - * bits set, i.e. S_ISDIR(mode) can be false. To obtain the - * correct directory type bits use mode|S_IFDIR - */ - int (*mkdir)(const char *, mode_t); - - /** Remove a file */ - int (*unlink)(const char *); - - /** Remove a directory */ - int (*rmdir)(const char *); - - /** Create a symbolic link */ - int (*symlink)(const char *, const char *); - - /** - * Rename a file - * - * *flags* may be `RENAME_EXCHANGE` or `RENAME_NOREPLACE`. If - * RENAME_NOREPLACE is specified, the filesystem must not - * overwrite *newname* if it exists and return an error - * instead. If `RENAME_EXCHANGE` is specified, the filesystem - * must atomically exchange the two files, i.e. both must - * exist and neither may be deleted. - */ - int (*rename)(const char *, const char *, unsigned int flags); - - /** Create a hard link to a file */ - int (*link)(const char *, const char *); - - /** - * Change the permission bits of a file - * - * `fi` will always be NULL if the file is not currenlty open, but - * may also be NULL if the file is open. - */ - int (*chmod)(const char *, mode_t, struct fuse_file_info *fi); - - /** - * Change the owner and group of a file - * - * `fi` will always be NULL if the file is not currenlty open, but - * may also be NULL if the file is open. - * - * Unless FUSE_CAP_HANDLE_KILLPRIV is disabled, this method is - * expected to reset the setuid and setgid bits. - */ - int (*chown)(const char *, uid_t, gid_t, struct fuse_file_info *fi); - - /** - * Change the size of a file - * - * `fi` will always be NULL if the file is not currenlty open, but - * may also be NULL if the file is open. - * - * Unless FUSE_CAP_HANDLE_KILLPRIV is disabled, this method is - * expected to reset the setuid and setgid bits. - */ - int (*truncate)(const char *, off_t, struct fuse_file_info *fi); - - /** - * Open a file - * - * Open flags are available in fi->flags. The following rules - * apply. - * - * - Creation (O_CREAT, O_EXCL, O_NOCTTY) flags will be - * filtered out / handled by the kernel. - * - * - Access modes (O_RDONLY, O_WRONLY, O_RDWR, O_EXEC, O_SEARCH) - * should be used by the filesystem to check if the operation is - * permitted. If the ``-o default_permissions`` mount option is - * given, this check is already done by the kernel before calling - * open() and may thus be omitted by the filesystem. - * - * - When writeback caching is enabled, the kernel may send - * read requests even for files opened with O_WRONLY. The - * filesystem should be prepared to handle this. - * - * - When writeback caching is disabled, the filesystem is - * expected to properly handle the O_APPEND flag and ensure - * that each write is appending to the end of the file. - * - * - When writeback caching is enabled, the kernel will - * handle O_APPEND. However, unless all changes to the file - * come through the kernel this will not work reliably. The - * filesystem should thus either ignore the O_APPEND flag - * (and let the kernel handle it), or return an error - * (indicating that reliably O_APPEND is not available). - * - * Filesystem may store an arbitrary file handle (pointer, - * index, etc) in fi->fh, and use this in other all other file - * operations (read, write, flush, release, fsync). - * - * Filesystem may also implement stateless file I/O and not store - * anything in fi->fh. - * - * There are also some flags (direct_io, keep_cache) which the - * filesystem may set in fi, to change the way the file is opened. - * See fuse_file_info structure in for more details. - * - * If this request is answered with an error code of ENOSYS - * and FUSE_CAP_NO_OPEN_SUPPORT is set in - * `fuse_conn_info.capable`, this is treated as success and - * future calls to open will also succeed without being send - * to the filesystem process. - * - */ - int (*open)(const char *, struct fuse_file_info *); - - /** - * Read data from an open file - * - * Read should return exactly the number of bytes requested except - * on EOF or error, otherwise the rest of the data will be - * substituted with zeroes. An exception to this is when the - * 'direct_io' mount option is specified, in which case the return - * value of the read system call will reflect the return value of - * this operation. - */ - int (*read)(const char *, char *, size_t, off_t, struct fuse_file_info= *); - - /** - * Write data to an open file - * - * Write should return exactly the number of bytes requested - * except on error. An exception to this is when the 'direct_io' - * mount option is specified (see read operation). - * - * Unless FUSE_CAP_HANDLE_KILLPRIV is disabled, this method is - * expected to reset the setuid and setgid bits. - */ - int (*write)(const char *, const char *, size_t, off_t, - struct fuse_file_info *); - - /** - * Get file system statistics - * - * The 'f_favail', 'f_fsid' and 'f_flag' fields are ignored - */ - int (*statfs)(const char *, struct statvfs *); - - /** - * Possibly flush cached data - * - * BIG NOTE: This is not equivalent to fsync(). It's not a - * request to sync dirty data. - * - * Flush is called on each close() of a file descriptor, as opposed to - * release which is called on the close of the last file descriptor for - * a file. Under Linux, errors returned by flush() will be passed to - * userspace as errors from close(), so flush() is a good place to wri= te - * back any cached dirty data. However, many applications ignore errors - * on close(), and on non-Linux systems, close() may succeed even if f= lush() - * returns an error. For these reasons, filesystems should not assume - * that errors returned by flush will ever be noticed or even - * delivered. - * - * NOTE: The flush() method may be called more than once for each - * open(). This happens if more than one file descriptor refers to an - * open file handle, e.g. due to dup(), dup2() or fork() calls. It is - * not possible to determine if a flush is final, so each flush should - * be treated equally. Multiple write-flush sequences are relatively - * rare, so this shouldn't be a problem. - * - * Filesystems shouldn't assume that flush will be called at any - * particular point. It may be called more times than expected, or not - * at all. - * - * [close]: - * http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html - */ - int (*flush)(const char *, struct fuse_file_info *); - - /** - * Release an open file - * - * Release is called when there are no more references to an open - * file: all file descriptors are closed and all memory mappings - * are unmapped. - * - * For every open() call there will be exactly one release() call - * with the same flags and file handle. It is possible to - * have a file opened more than once, in which case only the last - * release will mean, that no more reads/writes will happen on the - * file. The return value of release is ignored. - */ - int (*release)(const char *, struct fuse_file_info *); - - /* - * Synchronize file contents - * - * If the datasync parameter is non-zero, then only the user data - * should be flushed, not the meta data. - */ - int (*fsync)(const char *, int, struct fuse_file_info *); - - /** Set extended attributes */ - int (*setxattr)(const char *, const char *, const char *, size_t, int); - - /** Get extended attributes */ - int (*getxattr)(const char *, const char *, char *, size_t); - - /** List extended attributes */ - int (*listxattr)(const char *, char *, size_t); - - /** Remove extended attributes */ - int (*removexattr)(const char *, const char *); - - /* - * Open directory - * - * Unless the 'default_permissions' mount option is given, - * this method should check if opendir is permitted for this - * directory. Optionally opendir may also return an arbitrary - * filehandle in the fuse_file_info structure, which will be - * passed to readdir, releasedir and fsyncdir. - */ - int (*opendir)(const char *, struct fuse_file_info *); - - /* - * Read directory - * - * The filesystem may choose between two modes of operation: - * - * 1) The readdir implementation ignores the offset parameter, and - * passes zero to the filler function's offset. The filler - * function will not return '1' (unless an error happens), so the - * whole directory is read in a single readdir operation. - * - * 2) The readdir implementation keeps track of the offsets of the - * directory entries. It uses the offset parameter and always - * passes non-zero offset to the filler function. When the buffer - * is full (or an error happens) the filler function will return - * '1'. - */ - int (*readdir)(const char *, void *, fuse_fill_dir_t, off_t, - struct fuse_file_info *, enum fuse_readdir_flags); - - /** - * Release directory - */ - int (*releasedir)(const char *, struct fuse_file_info *); - - /** - * Synchronize directory contents - * - * If the datasync parameter is non-zero, then only the user data - * should be flushed, not the meta data - */ - int (*fsyncdir)(const char *, int, struct fuse_file_info *); - - /** - * Initialize filesystem - * - * The return value will passed in the `private_data` field of - * `struct fuse_context` to all file operations, and as a - * parameter to the destroy() method. It overrides the initial - * value provided to fuse_main() / fuse_new(). - */ - void *(*init)(struct fuse_conn_info *conn, struct fuse_config *cfg); - - /** - * Clean up filesystem - * - * Called on filesystem exit. - */ - void (*destroy)(void *private_data); - - /** - * Check file access permissions - * - * This will be called for the access() system call. If the - * 'default_permissions' mount option is given, this method is not - * called. - * - * This method is not called under Linux kernel versions 2.4.x - */ - int (*access)(const char *, int); - - /** - * Create and open a file - * - * If the file does not exist, first create it with the specified - * mode, and then open it. - * - * If this method is not implemented or under Linux kernel - * versions earlier than 2.6.15, the mknod() and open() methods - * will be called instead. - */ - int (*create)(const char *, mode_t, struct fuse_file_info *); - - /** - * Perform POSIX file locking operation - * - * The cmd argument will be either F_GETLK, F_SETLK or F_SETLKW. - * - * For the meaning of fields in 'struct flock' see the man page - * for fcntl(2). The l_whence field will always be set to - * SEEK_SET. - * - * For checking lock ownership, the 'fuse_file_info->owner' - * argument must be used. - * - * For F_GETLK operation, the library will first check currently - * held locks, and if a conflicting lock is found it will return - * information without calling this method. This ensures, that - * for local locks the l_pid field is correctly filled in. The - * results may not be accurate in case of race conditions and in - * the presence of hard links, but it's unlikely that an - * application would rely on accurate GETLK results in these - * cases. If a conflicting lock is not found, this method will be - * called, and the filesystem may fill out l_pid by a meaningful - * value, or it may leave this field zero. - * - * For F_SETLK and F_SETLKW the l_pid field will be set to the pid - * of the process performing the locking operation. - * - * Note: if this method is not implemented, the kernel will still - * allow file locking to work locally. Hence it is only - * interesting for network filesystems and similar. - */ - int (*lock)(const char *, struct fuse_file_info *, int cmd, struct flo= ck *); - - /** - * Change the access and modification times of a file with - * nanosecond resolution - * - * This supersedes the old utime() interface. New applications - * should use this. - * - * `fi` will always be NULL if the file is not currenlty open, but - * may also be NULL if the file is open. - * - * See the utimensat(2) man page for details. - */ - int (*utimens)(const char *, const struct timespec tv[2], - struct fuse_file_info *fi); - - /** - * Map block index within file to block index within device - * - * Note: This makes sense only for block device backed filesystems - * mounted with the 'blkdev' option - */ - int (*bmap)(const char *, size_t blocksize, uint64_t *idx); - - /** - * Ioctl - * - * flags will have FUSE_IOCTL_COMPAT set for 32bit ioctls in - * 64bit environment. The size and direction of data is - * determined by _IOC_*() decoding of cmd. For _IOC_NONE, - * data will be NULL, for _IOC_WRITE data is out area, for - * _IOC_READ in area and if both are set in/out area. In all - * non-NULL cases, the area is of _IOC_SIZE(cmd) bytes. - * - * If flags has FUSE_IOCTL_DIR then the fuse_file_info refers to a - * directory file handle. - * - * Note : the unsigned long request submitted by the application - * is truncated to 32 bits. - */ - int (*ioctl)(const char *, unsigned int cmd, void *arg, - struct fuse_file_info *, unsigned int flags, void *data); - - /** - * Poll for IO readiness events - * - * Note: If ph is non-NULL, the client should notify - * when IO readiness events occur by calling - * fuse_notify_poll() with the specified ph. - * - * Regardless of the number of times poll with a non-NULL ph - * is received, single notification is enough to clear all. - * Notifying more times incurs overhead but doesn't harm - * correctness. - * - * The callee is responsible for destroying ph with - * fuse_pollhandle_destroy() when no longer in use. - */ - int (*poll)(const char *, struct fuse_file_info *, - struct fuse_pollhandle *ph, unsigned *reventsp); - - /* - * Write contents of buffer to an open file - * - * Similar to the write() method, but data is supplied in a - * generic buffer. Use fuse_buf_copy() to transfer data to - * the destination. - * - * Unless FUSE_CAP_HANDLE_KILLPRIV is disabled, this method is - * expected to reset the setuid and setgid bits. - */ - int (*write_buf)(const char *, struct fuse_bufvec *buf, off_t off, - struct fuse_file_info *); - - /* - * Store data from an open file in a buffer - * - * Similar to the read() method, but data is stored and - * returned in a generic buffer. - * - * No actual copying of data has to take place, the source - * file descriptor may simply be stored in the buffer for - * later data transfer. - * - * The buffer must be allocated dynamically and stored at the - * location pointed to by bufp. If the buffer contains memory - * regions, they too must be allocated using malloc(). The - * allocated memory will be freed by the caller. - */ - int (*read_buf)(const char *, struct fuse_bufvec **bufp, size_t size, - off_t off, struct fuse_file_info *); - /** - * Perform BSD file locking operation - * - * The op argument will be either LOCK_SH, LOCK_EX or LOCK_UN - * - * Nonblocking requests will be indicated by ORing LOCK_NB to - * the above operations - * - * For more information see the flock(2) manual page. - * - * Additionally fi->owner will be set to a value unique to - * this open file. This same value will be supplied to - * ->release() when the file is released. - * - * Note: if this method is not implemented, the kernel will still - * allow file locking to work locally. Hence it is only - * interesting for network filesystems and similar. - */ - int (*flock)(const char *, struct fuse_file_info *, int op); - - /** - * Allocates space for an open file - * - * This function ensures that required space is allocated for specified - * file. If this function returns success then any subsequent write - * request to specified range is guaranteed not to fail because of lack - * of space on the file system media. - */ - int (*fallocate)(const char *, int, off_t, off_t, struct fuse_file_inf= o *); - - /** - * Copy a range of data from one file to another - * - * Performs an optimized copy between two file descriptors without the - * additional cost of transferring data through the FUSE kernel module - * to user space (glibc) and then back into the FUSE filesystem again. - * - * In case this method is not implemented, glibc falls back to reading - * data from the source and writing to the destination. Effectively - * doing an inefficient copy of the data. - */ - ssize_t (*copy_file_range)(const char *path_in, - struct fuse_file_info *fi_in, off_t offset_= in, - const char *path_out, - struct fuse_file_info *fi_out, off_t offset= _out, - size_t size, int flags); - - /** - * Find next data or hole after the specified offset - */ - off_t (*lseek)(const char *, off_t off, int whence, - struct fuse_file_info *); -}; - -/* - * Extra context that may be needed by some filesystems - * - * The uid, gid and pid fields are not filled in case of a writepage - * operation. - */ -struct fuse_context { - /** Pointer to the fuse object */ - struct fuse *fuse; - - /** User ID of the calling process */ - uid_t uid; - - /** Group ID of the calling process */ - gid_t gid; - - /** Process ID of the calling thread */ - pid_t pid; - - /** Private filesystem data */ - void *private_data; - - /** Umask of the calling process */ - mode_t umask; -}; - -/** - * Main function of FUSE. - * - * This is for the lazy. This is all that has to be called from the - * main() function. - * - * This function does the following: - * - parses command line options, and handles --help and - * --version - * - installs signal handlers for INT, HUP, TERM and PIPE - * - registers an exit handler to unmount the filesystem on program exit - * - creates a fuse handle - * - registers the operations - * - calls either the single-threaded or the multi-threaded event loop - * - * Most file systems will have to parse some file-system specific - * arguments before calling this function. It is recommended to do - * this with fuse_opt_parse() and a processing function that passes - * through any unknown options (this can also be achieved by just - * passing NULL as the processing function). That way, the remaining - * options can be passed directly to fuse_main(). - * - * fuse_main() accepts all options that can be passed to - * fuse_parse_cmdline(), fuse_new(), or fuse_session_new(). - * - * Option parsing skips argv[0], which is assumed to contain the - * program name. This element must always be present and is used to - * construct a basic ``usage: `` message for the --help - * output. argv[0] may also be set to the empty string. In this case - * the usage message is suppressed. This can be used by file systems - * to print their own usage line first. See hello.c for an example of - * how to do this. - * - * Note: this is currently implemented as a macro. - * - * The following error codes may be returned from fuse_main(): - * 1: Invalid option arguments - * 2: No mount point specified - * 3: FUSE setup failed - * 4: Mounting failed - * 5: Failed to daemonize (detach from session) - * 6: Failed to set up signal handlers - * 7: An error occured during the life of the file system - * - * @param argc the argument counter passed to the main() function - * @param argv the argument vector passed to the main() function - * @param op the file system operation - * @param private_data Initial value for the `private_data` - * field of `struct fuse_context`. May be overridden by the - * `struct fuse_operations.init` handler. - * @return 0 on success, nonzero on failure - * - * Example usage, see hello.c - */ -/* - * int fuse_main(int argc, char *argv[], const struct fuse_operations *op, - * void *private_data); - */ -#define fuse_main(argc, argv, op, private_data) \ - fuse_main_real(argc, argv, op, sizeof(*(op)), private_data) - -/* - * More detailed API - */ - -/** - * Print available options (high- and low-level) to stdout. This is - * not an exhaustive list, but includes only those options that may be - * of interest to an end-user of a file system. - * - * The function looks at the argument vector only to determine if - * there are additional modules to be loaded (module=3Dfoo option), - * and attempts to call their help functions as well. - * - * @param args the argument vector. - */ -void fuse_lib_help(struct fuse_args *args); - -/** - * Create a new FUSE filesystem. - * - * This function accepts most file-system independent mount options - * (like context, nodev, ro - see mount(8)), as well as the - * FUSE-specific mount options from mount.fuse(8). - * - * If the --help option is specified, the function writes a help text - * to stdout and returns NULL. - * - * Option parsing skips argv[0], which is assumed to contain the - * program name. This element must always be present and is used to - * construct a basic ``usage: `` message for the --help output. If - * argv[0] is set to the empty string, no usage message is included in - * the --help output. - * - * If an unknown option is passed in, an error message is written to - * stderr and the function returns NULL. - * - * @param args argument vector - * @param op the filesystem operations - * @param op_size the size of the fuse_operations structure - * @param private_data Initial value for the `private_data` - * field of `struct fuse_context`. May be overridden by the - * `struct fuse_operations.init` handler. - * @return the created FUSE handle - */ -#if FUSE_USE_VERSION =3D=3D 30 -struct fuse *fuse_new_30(struct fuse_args *args, - const struct fuse_operations *op, size_t op_size, - void *private_data); -#define fuse_new(args, op, size, data) fuse_new_30(args, op, size, data) -#else -struct fuse *fuse_new(struct fuse_args *args, const struct fuse_operations= *op, - size_t op_size, void *private_data); -#endif - -/** - * Mount a FUSE file system. - * - * @param mountpoint the mount point path - * @param f the FUSE handle - * - * @return 0 on success, -1 on failure. - **/ -int fuse_mount(struct fuse *f, const char *mountpoint); - -/** - * Unmount a FUSE file system. - * - * See fuse_session_unmount() for additional information. - * - * @param f the FUSE handle - **/ -void fuse_unmount(struct fuse *f); - -/** - * Destroy the FUSE handle. - * - * NOTE: This function does not unmount the filesystem. If this is - * needed, call fuse_unmount() before calling this function. - * - * @param f the FUSE handle - */ -void fuse_destroy(struct fuse *f); - -/** - * FUSE event loop. - * - * Requests from the kernel are processed, and the appropriate - * operations are called. - * - * For a description of the return value and the conditions when the - * event loop exits, refer to the documentation of - * fuse_session_loop(). - * - * @param f the FUSE handle - * @return see fuse_session_loop() - * - * See also: fuse_loop_mt() - */ -int fuse_loop(struct fuse *f); - -/** - * Flag session as terminated - * - * This function will cause any running event loops to exit on - * the next opportunity. - * - * @param f the FUSE handle - */ -void fuse_exit(struct fuse *f); - -/** - * Get the current context - * - * The context is only valid for the duration of a filesystem - * operation, and thus must not be stored and used later. - * - * @return the context - */ -struct fuse_context *fuse_get_context(void); - -/** - * Check if the current request has already been interrupted - * - * @return 1 if the request has been interrupted, 0 otherwise - */ -int fuse_interrupted(void); - -/** - * Invalidates cache for the given path. - * - * This calls fuse_lowlevel_notify_inval_inode internally. - * - * @return 0 on successful invalidation, negative error value otherwise. - * This routine may return -ENOENT to indicate that there was - * no entry to be invalidated, e.g., because the path has not - * been seen before or has been forgotten; this should not be - * considered to be an error. - */ -int fuse_invalidate_path(struct fuse *f, const char *path); - -/** - * The real main function - * - * Do not call this directly, use fuse_main() - */ -int fuse_main_real(int argc, char *argv[], const struct fuse_operations *o= p, - size_t op_size, void *private_data); - -/** - * Start the cleanup thread when using option "remember". - * - * This is done automatically by fuse_loop_mt() - * @param fuse struct fuse pointer for fuse instance - * @return 0 on success and -1 on error - */ -int fuse_start_cleanup_thread(struct fuse *fuse); - -/** - * Stop the cleanup thread when using option "remember". - * - * This is done automatically by fuse_loop_mt() - * @param fuse struct fuse pointer for fuse instance - */ -void fuse_stop_cleanup_thread(struct fuse *fuse); - -/** - * Iterate over cache removing stale entries - * use in conjunction with "-oremember" - * - * NOTE: This is already done for the standard sessions - * - * @param fuse struct fuse pointer for fuse instance - * @return the number of seconds until the next cleanup - */ -int fuse_clean_cache(struct fuse *fuse); - -/* - * Stacking API - */ - -/** - * Fuse filesystem object - * - * This is opaque object represents a filesystem layer - */ -struct fuse_fs; - -/* - * These functions call the relevant filesystem operation, and return - * the result. - * - * If the operation is not defined, they return -ENOSYS, with the - * exception of fuse_fs_open, fuse_fs_release, fuse_fs_opendir, - * fuse_fs_releasedir and fuse_fs_statfs, which return 0. - */ - -int fuse_fs_getattr(struct fuse_fs *fs, const char *path, struct stat *buf, - struct fuse_file_info *fi); -int fuse_fs_rename(struct fuse_fs *fs, const char *oldpath, const char *ne= wpath, - unsigned int flags); -int fuse_fs_unlink(struct fuse_fs *fs, const char *path); -int fuse_fs_rmdir(struct fuse_fs *fs, const char *path); -int fuse_fs_symlink(struct fuse_fs *fs, const char *linkname, const char *= path); -int fuse_fs_link(struct fuse_fs *fs, const char *oldpath, const char *newp= ath); -int fuse_fs_release(struct fuse_fs *fs, const char *path, - struct fuse_file_info *fi); -int fuse_fs_open(struct fuse_fs *fs, const char *path, - struct fuse_file_info *fi); -int fuse_fs_read(struct fuse_fs *fs, const char *path, char *buf, size_t s= ize, - off_t off, struct fuse_file_info *fi); -int fuse_fs_read_buf(struct fuse_fs *fs, const char *path, - struct fuse_bufvec **bufp, size_t size, off_t off, - struct fuse_file_info *fi); -int fuse_fs_write(struct fuse_fs *fs, const char *path, const char *buf, - size_t size, off_t off, struct fuse_file_info *fi); -int fuse_fs_write_buf(struct fuse_fs *fs, const char *path, - struct fuse_bufvec *buf, off_t off, - struct fuse_file_info *fi); -int fuse_fs_fsync(struct fuse_fs *fs, const char *path, int datasync, - struct fuse_file_info *fi); -int fuse_fs_flush(struct fuse_fs *fs, const char *path, - struct fuse_file_info *fi); -int fuse_fs_statfs(struct fuse_fs *fs, const char *path, struct statvfs *b= uf); -int fuse_fs_opendir(struct fuse_fs *fs, const char *path, - struct fuse_file_info *fi); -int fuse_fs_readdir(struct fuse_fs *fs, const char *path, void *buf, - fuse_fill_dir_t filler, off_t off, - struct fuse_file_info *fi, enum fuse_readdir_flags fla= gs); -int fuse_fs_fsyncdir(struct fuse_fs *fs, const char *path, int datasync, - struct fuse_file_info *fi); -int fuse_fs_releasedir(struct fuse_fs *fs, const char *path, - struct fuse_file_info *fi); -int fuse_fs_create(struct fuse_fs *fs, const char *path, mode_t mode, - struct fuse_file_info *fi); -int fuse_fs_lock(struct fuse_fs *fs, const char *path, - struct fuse_file_info *fi, int cmd, struct flock *lock); -int fuse_fs_flock(struct fuse_fs *fs, const char *path, - struct fuse_file_info *fi, int op); -int fuse_fs_chmod(struct fuse_fs *fs, const char *path, mode_t mode, - struct fuse_file_info *fi); -int fuse_fs_chown(struct fuse_fs *fs, const char *path, uid_t uid, gid_t g= id, - struct fuse_file_info *fi); -int fuse_fs_truncate(struct fuse_fs *fs, const char *path, off_t size, - struct fuse_file_info *fi); -int fuse_fs_utimens(struct fuse_fs *fs, const char *path, - const struct timespec tv[2], struct fuse_file_info *fi= ); -int fuse_fs_access(struct fuse_fs *fs, const char *path, int mask); -int fuse_fs_readlink(struct fuse_fs *fs, const char *path, char *buf, - size_t len); -int fuse_fs_mknod(struct fuse_fs *fs, const char *path, mode_t mode, - dev_t rdev); -int fuse_fs_mkdir(struct fuse_fs *fs, const char *path, mode_t mode); -int fuse_fs_setxattr(struct fuse_fs *fs, const char *path, const char *nam= e, - const char *value, size_t size, int flags); -int fuse_fs_getxattr(struct fuse_fs *fs, const char *path, const char *nam= e, - char *value, size_t size); -int fuse_fs_listxattr(struct fuse_fs *fs, const char *path, char *list, - size_t size); -int fuse_fs_removexattr(struct fuse_fs *fs, const char *path, const char *= name); -int fuse_fs_bmap(struct fuse_fs *fs, const char *path, size_t blocksize, - uint64_t *idx); -int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, unsigned int cmd, - void *arg, struct fuse_file_info *fi, unsigned int flags, - void *data); -int fuse_fs_poll(struct fuse_fs *fs, const char *path, - struct fuse_file_info *fi, struct fuse_pollhandle *ph, - unsigned *reventsp); -int fuse_fs_fallocate(struct fuse_fs *fs, const char *path, int mode, - off_t offset, off_t length, struct fuse_file_info *f= i); -ssize_t fuse_fs_copy_file_range(struct fuse_fs *fs, const char *path_in, - struct fuse_file_info *fi_in, off_t off_in, - const char *path_out, - struct fuse_file_info *fi_out, off_t off_o= ut, - size_t len, int flags); -off_t fuse_fs_lseek(struct fuse_fs *fs, const char *path, off_t off, int w= hence, - struct fuse_file_info *fi); -void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn, - struct fuse_config *cfg); -void fuse_fs_destroy(struct fuse_fs *fs); - -int fuse_notify_poll(struct fuse_pollhandle *ph); - -/** - * Create a new fuse filesystem object - * - * This is usually called from the factory of a fuse module to create - * a new instance of a filesystem. - * - * @param op the filesystem operations - * @param op_size the size of the fuse_operations structure - * @param private_data Initial value for the `private_data` - * field of `struct fuse_context`. May be overridden by the - * `struct fuse_operations.init` handler. - * @return a new filesystem object - */ -struct fuse_fs *fuse_fs_new(const struct fuse_operations *op, size_t op_si= ze, - void *private_data); - -/** - * Factory for creating filesystem objects - * - * The function may use and remove options from 'args' that belong - * to this module. - * - * For now the 'fs' vector always contains exactly one filesystem. - * This is the filesystem which will be below the newly created - * filesystem in the stack. - * - * @param args the command line arguments - * @param fs NULL terminated filesystem object vector - * @return the new filesystem object - */ -typedef struct fuse_fs *(*fuse_module_factory_t)(struct fuse_args *args, - struct fuse_fs *fs[]); -/** - * Register filesystem module - * - * If the "-omodules=3D*name*_:..." option is present, filesystem - * objects are created and pushed onto the stack with the *factory_* - * function. - * - * @param name_ the name of this filesystem module - * @param factory_ the factory function for this filesystem module - */ -#define FUSE_REGISTER_MODULE(name_, factory_) \ - fuse_module_factory_t fuse_module_##name_##_factory =3D factory_ - -/** Get session from fuse object */ -struct fuse_session *fuse_get_session(struct fuse *f); - -/** - * Open a FUSE file descriptor and set up the mount for the given - * mountpoint and flags. - * - * @param mountpoint reference to the mount in the file system - * @param options mount options - * @return the FUSE file descriptor or -1 upon error - */ -int fuse_open_channel(const char *mountpoint, const char *options); - -#endif /* FUSE_H_ */ diff --git a/tools/virtiofsd/fuse_i.h b/tools/virtiofsd/fuse_i.h index 4e47e5880d..1240828208 100644 --- a/tools/virtiofsd/fuse_i.h +++ b/tools/virtiofsd/fuse_i.h @@ -10,7 +10,6 @@ #define FUSE_I_H =20 #define FUSE_USE_VERSION 31 -#include "fuse.h" #include "fuse_lowlevel.h" =20 struct fv_VuDev; @@ -82,21 +81,6 @@ struct fuse_chan { struct fv_QueueInfo *qi; }; =20 -/** - * Filesystem module - * - * Filesystem modules are registered with the FUSE_REGISTER_MODULE() - * macro. - * - */ -struct fuse_module { - char *name; - fuse_module_factory_t factory; - struct fuse_module *next; - struct fusemod_so *so; - int ctr; -}; - int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *io= v, int count); void fuse_free_req(fuse_req_t req); --=20 2.24.1 From nobody Sat May 4 01:52:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582293222; cv=none; d=zohomail.com; s=zohoarc; b=MpFZlLFcKGHKarYDZrwQ5mBy9hBzVoftzDfeZXpjM0xHMKPTI9IGxqPYr9QlZtq4wFKYvf/PEfzOipnxo1a47L0iG0ip9QUVUveQ1roknxfD18/hu6bOAx1dE5y11sDQxq2Z4JJXtc20n4KZ4hAmxmGa4TdbbDeSujIgHPXgXOk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582293222; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SW3lAstK1rmsyHibnDejOI0DENRkAykxJehfAUoooGg=; b=J8pYuzvyHrEu2nvzCdAKgzzimgr/wK5JymiDsE43/4PT9MAUmE01dhCwe7txmQYqfsTSFM5LfwUnS2ivn8piTv4qCqUQOz13IvIzwV85wIUBHx7VcISyFk5zx/kxbhkrBGO/9/G+9RO6xLYq6mmHX8LIuIDg9GqeRK4ShCupBjk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582293222490325.4719773645785; Fri, 21 Feb 2020 05:53:42 -0800 (PST) Received: from localhost ([::1]:58300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58kP-0002Yh-G4 for importer@patchew.org; Fri, 21 Feb 2020 08:53:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32969) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j58Ja-0002xA-H6 for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:26:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j58JY-0007M6-Iq for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:57 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:44615 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j58JY-0007Kn-En for qemu-devel@nongnu.org; Fri, 21 Feb 2020 08:25:56 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-15-q1OkKKHMP_W7vkKtHUVkWg-1; Fri, 21 Feb 2020 08:25:52 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E932E1005510; Fri, 21 Feb 2020 13:25:50 +0000 (UTC) Received: from dgilbert-t580.localhost (unknown [10.36.118.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF1C184BCC; Fri, 21 Feb 2020 13:25:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582291554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SW3lAstK1rmsyHibnDejOI0DENRkAykxJehfAUoooGg=; b=YKbjYSa+wGU+wkCEHTO83SJdud0buBJAODWzr4WFxfuulzRzWt5fmIbKUdof8K4vFnbGBy Mn5AUG7O/XAM3IDUepyCmWzk3h735JbSbF3VZDOej88DXVwki+kAbpMjMD2VlzLKPjT627 Q9mi3a1ljDozNrqurj9ebufzu02514Y= X-MC-Unique: q1OkKKHMP_W7vkKtHUVkWg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, philmd@redhat.com, yangx.jy@cn.fujitsu.com, mrezanin@redhat.com Subject: [PULL 6/6] docs: Fix virtiofsd.1 location Date: Fri, 21 Feb 2020 13:25:36 +0000 Message-Id: <20200221132536.38364-7-dgilbert@redhat.com> In-Reply-To: <20200221132536.38364-1-dgilbert@redhat.com> References: <20200221132536.38364-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Miroslav Rezanina Patch 6a7e2bbee5 docs: add virtiofsd(1) man page introduced new man page virtiofsd.1. Unfortunately, wrong file location is used as source for install command. This cause installation of docs fail. Fixing wrong location so installation is successful. Signed-off-by: Miroslav Rezanina Message-Id: <1608747495.7195569.1581513386780.JavaMail.zimbra@redhat.com> Reviewed-by: Peter Maydell Signed-off-by: Dr. David Alan Gilbert --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b5a7377cb1..146a91bc3e 100644 --- a/Makefile +++ b/Makefile @@ -865,7 +865,7 @@ ifdef CONFIG_VIRTFS $(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/virtfs-proxy-helper.1 "$(DESTD= IR)$(mandir)/man1" endif ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy) - $(INSTALL_DATA) docs/interop/virtiofsd.1 "$(DESTDIR)$(mandir)/man1" + $(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/virtiofsd.1 "$(DESTDIR)$(mandi= r)/man1" endif =20 install-datadir: --=20 2.24.1