^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * linux/fs/adfs/dir_f.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 1999 Russell King
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Structures of directories on the F format disk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #ifndef ADFS_DIR_F_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define ADFS_DIR_F_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * Directory header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct adfs_dirheader {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) __u8 startmasseq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) __u8 startname[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) } __attribute__((packed));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define ADFS_NEWDIR_SIZE 2048
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define ADFS_NUM_DIR_ENTRIES 77
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * Directory entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct adfs_direntry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define ADFS_F_NAME_LEN 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) char dirobname[ADFS_F_NAME_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) __u8 dirload[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) __u8 direxec[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) __u8 dirlen[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) __u8 dirinddiscadd[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) __u8 newdiratts;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) } __attribute__((packed));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * Directory tail
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct adfs_olddirtail {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) __u8 dirlastmask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) char dirname[10];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) __u8 dirparent[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) char dirtitle[19];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) __u8 reserved[14];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) __u8 endmasseq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) __u8 endname[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) __u8 dircheckbyte;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) } __attribute__((packed));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct adfs_newdirtail {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) __u8 dirlastmask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) __u8 reserved[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) __u8 dirparent[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) char dirtitle[19];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) char dirname[10];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) __u8 endmasseq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) __u8 endname[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) __u8 dircheckbyte;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) } __attribute__((packed));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) union adfs_dirtail {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) struct adfs_olddirtail old;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) struct adfs_newdirtail new;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #endif