]> git.sven.stormbind.net Git - sven/exfat-utils.git/blob - mkfs/mkexfat.h
Merge branch 'master' of git.sven.stormbind.net:/home/sven/www/sven_htdocs/git/exfat...
[sven/exfat-utils.git] / mkfs / mkexfat.h
1 /*
2         mkexfat.h (09.11.10)
3         Common declarations.
4
5         Copyright (C) 2009, 2010  Andrew Nayenko
6
7         This program is free software: you can redistribute it and/or modify
8         it under the terms of the GNU General Public License as published by
9         the Free Software Foundation, either version 3 of the License, or
10         (at your option) any later version.
11
12         This program is distributed in the hope that it will be useful,
13         but WITHOUT ANY WARRANTY; without even the implied warranty of
14         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15         GNU General Public License for more details.
16
17         You should have received a copy of the GNU General Public License
18         along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef MKFS_MKEXFAT_H_INCLUDED
22 #define MKFS_MKEXFAT_H_INCLUDED
23
24 #include <exfat.h>
25
26 extern struct exfat_super_block sb;
27 extern struct exfat_entry_label label_entry;
28 extern struct exfat_entry_bitmap bitmap_entry;
29 extern struct exfat_entry_upcase upcase_entry;
30
31 #define OFFSET_TO_SECTOR(off) ((off) >> (sb).sector_bits)
32 #define SECTOR_TO_CLUSTER(sector) \
33         ((((sector) - le32_to_cpu((sb).cluster_sector_start)) >> (sb).spc_bits) + \
34                 EXFAT_FIRST_DATA_CLUSTER)
35 #define OFFSET_TO_CLUSTER(off) SECTOR_TO_CLUSTER(OFFSET_TO_SECTOR(off))
36
37 #endif /* ifndef MKFS_MKEXFAT_H_INCLUDED */