lkml.org 
[lkml]   [2017]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 1/2] fs: fat: Add fat filesystem partition volume label in local structure
Date
ChenGuanqiao <chen.chenchacha@foxmail.com> 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 <hirofumi@mail.parknet.co.jp>

\
 
 \ /
  Last update: 2017-12-27 14:22    [W:0.037 / U:13.384 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site