Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751704AbdL0NVP (ORCPT ); Wed, 27 Dec 2017 08:21:15 -0500 Received: from mail.parknet.co.jp ([210.171.160.6]:34855 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895AbdL0NVO (ORCPT ); Wed, 27 Dec 2017 08:21:14 -0500 From: OGAWA Hirofumi To: ChenGuanqiao Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 1/2] fs: fat: Add fat filesystem partition volume label in local structure References: <20171227091714.4566-1-chen.chenchacha@foxmail.com> <20171227091714.4566-2-chen.chenchacha@foxmail.com> Date: Wed, 27 Dec 2017 22:21:11 +0900 In-Reply-To: <20171227091714.4566-2-chen.chenchacha@foxmail.com> (ChenGuanqiao's message of "Wed, 27 Dec 2017 17:17:13 +0800") Message-ID: <87incswblk.fsf@mail.parknet.co.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 949 Lines: 34 ChenGuanqiao writes: > +static int fat_get_volume_label_entry(struct inode *dir, loff_t *pos, > + struct buffer_head **bh, > + struct msdos_dir_entry **de) > +{ > + while (fat_get_entry(dir, pos, bh, de) >= 0) > + if (((*de)->attr & ATTR_VOLUME) && (*de)->attr != ATTR_EXT) > + return 0; > + return -ENOENT; > +} > + > +int fat_scan_volume_label(struct inode *dir, struct fat_slot_info *sinfo) > +{ > + struct super_block *sb = dir->i_sb; > + > + sinfo->slot_off = 0; > + sinfo->bh = NULL; > + while (fat_get_volume_label_entry(dir, &sinfo->slot_off, > + &sinfo->bh, &sinfo->de) >= 0) { > + sinfo->slot_off -= sizeof(*sinfo->de); > + sinfo->nr_slots = 1; > + sinfo->i_pos = fat_make_i_pos(sb, sinfo->bh, sinfo->de); > + > + return 0; > + } > + > + return -ENOENT; > +} > +EXPORT_SYMBOL_GPL(fat_scan_volume_label); Why do you need sinfo? -- OGAWA Hirofumi