Re: [PATCH 3/3] fs: fat: add ioctl method in fat filesystem driver

From: Pali RohÃr
Date: Tue Jan 30 2018 - 06:32:17 EST


On Tuesday 30 January 2018 20:23:03 OGAWA Hirofumi wrote:
> chenchacha <chen.chenchacha@xxxxxxxxxxx> writes:
>
> > On 01/29/2018 09:02 PM, OGAWA Hirofumi wrote:
> >> ChenGuanqiao <chen.chenchacha@xxxxxxxxxxx> writes:
> >>
> >>> +static int fat_check_d_characters(char *label, unsigned long len)
> >>> +{
> >>> + int i;
> >>> +
> >>> + for (i = 0; i < len; ++i) {
> >>> + switch (label[i]) {
> >>> + case 'a' ... 'z':
> >>> + label[i] = __toupper(label[i]);
> >>> + case 'A' ... 'Z':
> >>> + case '0' ... '9':
> >>> + case '_':
> >>> + case 0x20:
> >>> + continue;
> >>> + default:
> >>> + return -EINVAL;
> >>> + }
> >> Same question with previous though, what windows do if label = "a b c"?
> >> (this is including space other than end of name or extension.)
> > In win7, the volume label will be capitalized, and leaving spaces.
> > Or, you mean I need to fill the rest of the space with "0x20"?
>
> I see. However, what win7 stored, BTW? It was "A B C ", or anything
> other?

Yes, as in FAT, all directory entries are padded by spaces.

--
Pali RohÃr
pali.rohar@xxxxxxxxx