Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp534122lqb; Thu, 14 Mar 2024 20:53:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKaM50yjJAqPXjjBmEwI/F+Vnf9e+BkZh/2zood4hxWfAMihpWjl8BsTvgfzk1drKS20MgRFvv8Q1VETviOzNcWtHUw+sjOwGC+lBGcw== X-Google-Smtp-Source: AGHT+IHrYQJvsGoBcOsloUYZ9qvrUn+Q93a76tvvHmq/gIxHz1sg8hsdbnkFwmtToAgQgMvhTB0Y X-Received: by 2002:aca:280e:0:b0:3c2:576a:c78c with SMTP id 14-20020aca280e000000b003c2576ac78cmr3431799oix.16.1710474815711; Thu, 14 Mar 2024 20:53:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710474815; cv=pass; d=google.com; s=arc-20160816; b=0Xp0EUS1vxQhokWXIqT+VMH4Ak8w6+Nc2SlrMo4dl7E3phTeJZj7NsLgqGXyFm7ofq I+6Ugw6tRyyoTjALMo4sOOTTUmO1X7j4WYy/ex5bHZLnHlzBcD9FxLAcqM1ICZPIlit9 tZ92PMx6lFfW8tdCek8bN7K2E3/MtRVcIpCozfBY8hAvznaDanmkvbZnwPIpj4hZdRkb y0Df9ilZKwYCpPJBRZNXvSdrwyutqUc5ykuca2afr4FSlWMl0pSTxe8HWez9reG/J0KV +eLWrzk2BZiT4nx9GkUXeZAqtNo0oGzZIn/I807N4OxdufnX80L+bZOT7W6boROg6w5F kD9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=0gsmBQw4bUZ2D0XG7tW7X5KxLNhuOa5nEfyJ0hbF4Nw=; fh=kotfiah0eacnLzmnBeClrwKOXVe8A2sgAABE/Aneawc=; b=K8hd719Z7lthtT+jlthLnF8AWo6ldyrKEOxwhAsvQRRmY+VA4Zu4PkQgGMMFH/CvvT 0kkBJGEwPpLpMfpVcFRkPUhSoxGm81UGF756RxeHP5j3qEcndJsFBi+f6SguaA89oEmc CWRG3ks5hqeCt5+DrpL68gg+gFbggvSGY8WuMr7erZbfa8SFMEHDWPMQ2CRm9jedvSK8 fFiC/qUZXgv05siNW2krM+3iF504YPojkesXx67Nj11OzVfXlcY9+j3M41uEX0Ic2cqA 0t+/0ZNBa99mpivMDO4CA6M0fkQTSzzdHHHdM0FBPD3TaCuwvtqMy03Yxea4T9yGnpcb jdCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="jh0/rgLs"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-104036-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104036-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g20-20020aa78754000000b006e6b53989cbsi2739515pfo.58.2024.03.14.20.53.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 20:53:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104036-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="jh0/rgLs"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-104036-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104036-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 52EBD28344D for ; Fri, 15 Mar 2024 03:53:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 29963DF71; Fri, 15 Mar 2024 03:53:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="jh0/rgLs" Received: from out-175.mta1.migadu.com (out-175.mta1.migadu.com [95.215.58.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A07EBD52E for ; Fri, 15 Mar 2024 03:53:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710474802; cv=none; b=KjlnH3+ydItNoQv5USZZqFyxWjCwC2MZF3K9Ivoutr44nSmAmDM0ALvuBkjt7Yd/CV+BbPtfS4Ah72DP/rYzMLcr0OyuSwIX17ou8NqXY6an5UOjTRTpQ2H/mexKPs0D1iCseHJdYO8Kda7F27q7dJaQ6BbZLo5qTocg/5AeC5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710474802; c=relaxed/simple; bh=/LueQ1G13mqVU1G0GdjbjC3M2usr9mpEcPu/Uaxz5sA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZmqdHHreAlivbqis2pnoNDXXfCakk5PsPJa0QbGHYEyPL4y7Z1uC0lqgb9r9Ni59vfCqiG3ske/GKZJ/VzDDyH/5WbxXuzf1dRrTY0qMOrlHcuuZtGE1Ccr0Dd0zsS61SdqmUJYvh1NWm9VWg83vaK/Ql9mGjF5mTrIsXYrx1PI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=jh0/rgLs; arc=none smtp.client-ip=95.215.58.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1710474798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0gsmBQw4bUZ2D0XG7tW7X5KxLNhuOa5nEfyJ0hbF4Nw=; b=jh0/rgLsvq+FTJEEueBkFHFB0Y2sj+exqZBFAxRCPMtcQ0cm9Kh3AzXvnvBgaXxhKk9cLW LNreMPbNb5jXwQNOl2E9v4O7CL9Ge78QBx1R88jMTtkBRzMeQGxkWJE5YAd1Zo4opcg9pk /J/JdcenZfUvnDwy9IKOYkC99Nr4+NY= From: Kent Overstreet To: torvalds@linux-foundation.org Cc: Kent Overstreet , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Brauner Subject: [PATCH 1/3] bcachefs: Switch to uuid_to_fsid() Date: Thu, 14 Mar 2024 23:53:00 -0400 Message-ID: <20240315035308.3563511-2-kent.overstreet@linux.dev> In-Reply-To: <20240315035308.3563511-1-kent.overstreet@linux.dev> References: <20240315035308.3563511-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT switch the statfs code from something horrible and open coded to the more standard uuid_to_fsid() Signed-off-by: Kent Overstreet --- fs/bcachefs/fs.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index 77ae65542db9..ec9cf4b8faf1 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -1572,7 +1572,6 @@ static int bch2_statfs(struct dentry *dentry, struct kstatfs *buf) * number: */ u64 avail_inodes = ((usage.capacity - usage.used) << 3); - u64 fsid; buf->f_type = BCACHEFS_STATFS_MAGIC; buf->f_bsize = sb->s_blocksize; @@ -1583,10 +1582,7 @@ static int bch2_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_files = usage.nr_inodes + avail_inodes; buf->f_ffree = avail_inodes; - fsid = le64_to_cpup((void *) c->sb.user_uuid.b) ^ - le64_to_cpup((void *) c->sb.user_uuid.b + sizeof(u64)); - buf->f_fsid.val[0] = fsid & 0xFFFFFFFFUL; - buf->f_fsid.val[1] = (fsid >> 32) & 0xFFFFFFFFUL; + buf->f_fsid = uuid_to_fsid(c->sb.user_uuid.b); buf->f_namelen = BCH_NAME_MAX; return 0; -- 2.43.0