From owner-freebsd-fs@freebsd.org Sat Jul 14 00:43:02 2018 Return-Path: Delivered-To: freebsd-fs@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 4C5A9102D698 for ; Sat, 14 Jul 2018 00:43:02 +0000 (UTC) (envelope-from jack@chillysky.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (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 BE0F77FD2C for ; Sat, 14 Jul 2018 00:43:01 +0000 (UTC) (envelope-from jack@chillysky.com) Received: by mail-wm0-x231.google.com with SMTP id s14-v6so10846754wmc.1 for ; Fri, 13 Jul 2018 17:43:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chillysky-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=3BEUZKg2niGJfVwMrhIzIaMfPn2PhaHZoGARmi0oP7Q=; b=loMB6oxuHKw75Hnkx8y5IVFNAi7Ine6Y5w2ef6SvrYnfl7vZvxWRVgkr3fmeST4kvo rLRdQUXJCKSRhkIj7FKvaYwdLyvf/zVHs5wLvN8lUhE5UAlBTppQAlbxHj1dVmKU+abX s0aHBryTLl4YiBfNzJLui4kIRvMvN10a0UjtpHtk4mCHaBJlh8VfLJ0nliv0CltDhuw6 wzRav6Ss9WtkqSmN8IH/64Ao5hG9bOu4XzGIIKMKiPUwA08Epdc66c4Z4ZkNnpPBfYOJ pR9KCQ7tn4T7aS2hM7hVg4nFTIdk+/HLM7ayrZwo4DEnX9mAbixf5xVPUjJBuX3d4Tlg DgOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3BEUZKg2niGJfVwMrhIzIaMfPn2PhaHZoGARmi0oP7Q=; b=s/naVvCOeuFhD9HZrh+a5nkm/m4Z5+viD+A8wGkinD/INi2dNIv6f9hhQ45DsTKMIJ y9wXkVqTp0KwHMC+Q/2+quVafVYLYGR7qN7E+cIilgAqAsuYb/8jWRsQRI8W22hqWvzq 6G80DyJEROi5QNyeJLl3QkSqixozZo0yiglrVtwWMkxRWtbPYpqToz8P2MwnYqg9prpN h7DJ7t0pZIfBGLhUOW21g9EhF60zWD0B7XCMuiXKYjOq4CNf2qWYqmLfLhjg234P+kRf ARfMyqw13WsdXckALuAaVA1D8cQra365oJXdHI8m0BnnSGWW5+W/6EEbJc+Rah/8Nqt7 44+Q== X-Gm-Message-State: AOUpUlHcOkN8sd4YQaarn2jYs5ICcADjLfVJxowZPTPnUyfJAH9eesih coP3ZydtfiIS74pKJWYn6TsjmU2b+PrQ8XkOxeD4hOFjFv4= X-Google-Smtp-Source: AAOMgpf7FqA8qJQIAEkEcWXm6Rgbzv0YcKSnCUuNFXgSLtL3iEIX/VOE6d6YSnMRdO5jTV0WT31UF1ylX0FtHT2kzuM= X-Received: by 2002:a1c:4143:: with SMTP id o64-v6mr5351156wma.123.1531528979902; Fri, 13 Jul 2018 17:42:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:3b09:0:0:0:0:0 with HTTP; Fri, 13 Jul 2018 17:42:59 -0700 (PDT) From: Jack Humphries Date: Fri, 13 Jul 2018 17:42:59 -0700 Message-ID: Subject: tmpfs questions To: freebsd-fs@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2018 00:43:02 -0000 Hi everyone, I'm trying to study the FreeBSD tmpfs implementation as a personal project, and I had a couple questions. I've been looking through the code for a week and modifying various parts. I appreciate any help! 1. It seems that vnodes are locked before being passed to the various VOP functions in tmpfs (because there is a call to MPASS(VOP_ISLOCKED(vp)) near the beginning of each function). Therefore, is the implicit assumption that a thread that holds the vnode lock has exclusive access to the corresponding tmpfs_node struct? In other words, is this why there are accesses to the tmpfs node variables even though the tmpfs node is not locked? Note: I see tn_interlock, but based on a comment above it in the source, it only protects tn_vpstate and tn_status. 2. What is the duplicate node list for (tn_dupindex)? If I had to guess, it seems to have something to do with the case where one thread calls readdir on a directory while another is modifying the directory, but I'm not sure. Can someone explain this deeper? Thanks. Jack Humphries