From owner-freebsd-hackers@freebsd.org Mon Feb 19 21:20:50 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFD8F252DE for ; Mon, 19 Feb 2018 21:20:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 890F76BD53 for ; Mon, 19 Feb 2018 21:20:49 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f47.google.com with SMTP id g72so1344904lfg.5 for ; Mon, 19 Feb 2018 13:20:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gOOj3vrbAuhzv1+eXLUQo6kVyw3SCCxWbZpT73Kr+P0=; b=FSU+Eq3wQY0Aqiva6gaNvrNxRa7zSc7a0whEKGgm5KgGtgrd8fnw3DU4F8oEUMQN5b 9l4fIIeCKXAEsvwk2AdpdaMH4lFHaBPEhf/VNCTK1hdIcIg2SNcqHZQN+tCt4Tj2eoPv SBUq+FknB1l1q9d66zn+gjG4bEXk3SGdEC5Y/bDSotkuZ6nqFDHaVxc3LxHnt20KvQGX TfEnQ2q5Hiey3ZhRVZOeUdIGVjmWk2Mhg+NsWITNnhEM8f1hJDspaQjKR0Sg/ixgacNO vwOxPwaqPvIik2XeCoc6Nfy1NjF5aDKmEBdW3h79o+p4436WEsGhpIkmgDu8WoXlJSb5 kLLw== X-Gm-Message-State: APf1xPCc2Z9a/D4rSgpGe38+fZ5y3lcC8+ml6AFOHq1c42d9ow59hprf Zpqhk0Wr/0+7cstTiqQjVnuqvldLdPY= X-Google-Smtp-Source: AH8x224vMPNdJhMIBdVFiGLhFVWkA1YbISFS9zvHu9d1ayo0HNmnPulhnPKWX/lrkdHP9wMFrK61aA== X-Received: by 10.25.15.98 with SMTP id e95mr10909632lfi.36.1519075241645; Mon, 19 Feb 2018 13:20:41 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id n2sm3392560lja.21.2018.02.19.13.20.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2018 13:20:40 -0800 (PST) Subject: Re: Using fstatfs on a ZFS disk To: "Rodney W. Grimes" , rb@gid.co.uk Cc: FreeBSD Hackers , Willem Jan Withagen References: <456B0CAA-367F-478A-BB61-153942C3EB7A@gid.co.uk> <201802191833.w1JIXhVL078022@pdx.rh.CN85.dnsmgr.net> From: Andriy Gapon Message-ID: <45bd4a05-406b-d6ac-6679-6897ab1fc742@FreeBSD.org> Date: Mon, 19 Feb 2018 23:20:39 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802191833.w1JIXhVL078022@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Feb 2018 21:20:50 -0000 On 19/02/2018 20:33, Rodney W. Grimes wrote: >> Hi, >> >>> On 19 Feb 2018, at 15:50, Willem Jan Withagen wrote: >>> Now 0xde != 27, so the question is, where is this 0xde specified. >>> And more important is this f_type constant over all FreeBSD ZFS filesystems? >> >> You got me. And a quick look at sys/kern/vfs_syscalls.c doesn?t help except to imply that the type is set when the filesystem is mounted. I have no idea where 0xde comes from. > > Could that 0xde be the start of 0xdeadcode? > > 0xde is 222 decimal, that does not ring a bell for me either. This is simpler, I think. It is a hash value (calculated using a specific algorithm) of a filesystem type name. See vfs_register(). There are no magic predefined constants for the types. BTW, lsvfs(1) and its source code could be of interest to the original poster. E.g., getvfsbyname(3). -- Andriy Gapon