From owner-freebsd-fs@freebsd.org Thu Jul 23 06:41:44 2015 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 990C79A6A78 for ; Thu, 23 Jul 2015 06:41:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24C3E1E43 for ; Thu, 23 Jul 2015 06:41:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t6N6fdnI001597 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 23 Jul 2015 09:41:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t6N6fdnI001597 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t6N6fdT3001596; Thu, 23 Jul 2015 09:41:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 23 Jul 2015 09:41:39 +0300 From: Konstantin Belousov To: Simon Brugger Cc: freebsd-fs@freebsd.org Subject: Re: Need help to understand inodes in FAT implementation Message-ID: <20150723064139.GL2072@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 06:41:44 -0000 On Wed, Jul 22, 2015 at 10:46:01PM -0700, Simon Brugger wrote: > The FAT filesystem is a design from Microsoft and the whole Windows > universe. As you probably know, FAT does not support Inodes like ext3 or > other UNIX/LINUX filesystem. > > The FreeBSD kernel provide a FAT filesystem driver but I've problems to > understand the code and need help for answering the following questions: > > - Inodes must be generated on the fly by file access. When exactly does > this happened? Inodes are not generated. The inode numbers are. Look at the sys/fs/msdosfs/msdosfs_vnops.c:msdosfs_getattr() to see how. The struct vattr va_fileid field is returned from VOP_GETATTR() to userspace as the struct stat st_ino. > - How does FreeBSD generate Inodes? > - How does the kernel FAT driver manage the file descriptors? Kernel FAT driver does not manage file descriptors.