dorimanx / exfat-nofuse

Android ARM Linux non-fuse read/write kernel driver for exFat and VFat Android file systems
GNU General Public License v2.0
707 stars 326 forks source link

Not building against kernel 5.10 #153

Closed daedalus closed 3 years ago

daedalus commented 3 years ago

Sorry for the long post, this is my build-log:

uname -a Linux wintermute 5.10.0-2-amd64 #1 SMP Debian 5.10.9-1 (2021-01-20) x86_64 GNU/Linux

dclavijo@wintermute:~/exfat-nofuse$ make -j 8
make -C /lib/modules/5.10.0-2-amd64/build M=/home/dclavijo/exfat-nofuse modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.0-2-amd64'
  CC [M]  /home/dclavijo/exfat-nofuse/exfat_core.o
  CC [M]  /home/dclavijo/exfat-nofuse/exfat_super.o
  CC [M]  /home/dclavijo/exfat-nofuse/exfat_oal.o
  CC [M]  /home/dclavijo/exfat-nofuse/exfat_upcase.o
/home/dclavijo/exfat-nofuse/exfat_oal.c:124:8: error: unknown type name ‘time_t’
  124 | static time_t accum_days_in_year[] = {
      |        ^~~~~~
/home/dclavijo/exfat-nofuse/exfat_oal.c: In function ‘tm_current’:
/home/dclavijo/exfat-nofuse/exfat_oal.c:131:18: error: storage size of ‘ts’ isn’t known
  131 |  struct timespec ts;
      |                  ^~
/home/dclavijo/exfat-nofuse/exfat_oal.c:132:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  132 |  time_t second, day, leap_day, month, year;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_oal.c:137:2: error: implicit declaration of function ‘ktime_get_real_ts’; did you mean ‘ktime_get_real_ns’? [-Werror=implicit-function-declaration]
  137 |  ktime_get_real_ts(&ts);
      |  ^~~~~~~~~~~~~~~~~
      |  ktime_get_real_ns
/home/dclavijo/exfat-nofuse/exfat_oal.c:131:18: warning: unused variable ‘ts’ [-Wunused-variable]
  131 |  struct timespec ts;
      |                  ^~
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-5.10.0-2-common/scripts/Makefile.build:284: /home/dclavijo/exfat-nofuse/exfat_oal.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/home/dclavijo/exfat-nofuse/exfat_super.c:142:8: error: unknown type name ‘time_t’
  142 | static time_t accum_days_in_year[] = {
      |        ^~~~~~
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_time_fat2unix’:
/home/dclavijo/exfat-nofuse/exfat_super.c:153:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  153 |  time_t year = tp->Year;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_super.c:154:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  154 |  time_t ld;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_super.c:161:4: error: invalid use of undefined type ‘struct timespec’
  161 |  ts->tv_sec =  tp->Second  + tp->Minute * SECS_PER_MIN
      |    ^~
/home/dclavijo/exfat-nofuse/exfat_super.c:165:4: error: invalid use of undefined type ‘struct timespec’
  165 |  ts->tv_nsec = 0;
      |    ^~
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_time_unix2fat’:
/home/dclavijo/exfat-nofuse/exfat_super.c:172:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  172 |  time_t second = ts->tv_sec;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_super.c:172:20: error: invalid use of undefined type ‘struct timespec’
  172 |  time_t second = ts->tv_sec;
      |                    ^~
/home/dclavijo/exfat-nofuse/exfat_super.c:173:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  173 |  time_t day, month, year;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_super.c:174:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  174 |  time_t ld;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_readpages’:
/home/dclavijo/exfat-nofuse/exfat_super.c:1626:9: error: implicit declaration of function ‘mpage_readpages’; did you mean ‘mpage_readpage’? [-Werror=implicit-function-declaration]
 1626 |  ret =  mpage_readpages(mapping, pages, nr_pages, exfat_get_block);
      |         ^~~~~~~~~~~~~~~
      |         mpage_readpage
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_fill_inode’:
/home/dclavijo/exfat-nofuse/exfat_super.c:1927:27: error: passing argument 2 of ‘exfat_time_fat2unix’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1927 |  exfat_time_fat2unix(sbi, &inode->i_mtime, &info.ModifyTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:150:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  150 | void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
/home/dclavijo/exfat-nofuse/exfat_super.c:1928:27: error: passing argument 2 of ‘exfat_time_fat2unix’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1928 |  exfat_time_fat2unix(sbi, &inode->i_ctime, &info.CreateTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:150:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  150 | void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
/home/dclavijo/exfat-nofuse/exfat_super.c:1929:27: error: passing argument 2 of ‘exfat_time_fat2unix’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1929 |  exfat_time_fat2unix(sbi, &inode->i_atime, &info.AccessTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:150:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  150 | void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_write_inode’:
/home/dclavijo/exfat-nofuse/exfat_super.c:2010:27: error: passing argument 2 of ‘exfat_time_unix2fat’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2010 |  exfat_time_unix2fat(sbi, &inode->i_mtime, &info.ModifyTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:169:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  169 | void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
/home/dclavijo/exfat-nofuse/exfat_super.c:2011:27: error: passing argument 2 of ‘exfat_time_unix2fat’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2011 |  exfat_time_unix2fat(sbi, &inode->i_ctime, &info.CreateTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:169:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  169 | void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
/home/dclavijo/exfat-nofuse/exfat_super.c:2012:27: error: passing argument 2 of ‘exfat_time_unix2fat’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2012 |  exfat_time_unix2fat(sbi, &inode->i_atime, &info.AccessTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:169:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  169 | void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_write_super’:
/home/dclavijo/exfat-nofuse/exfat_super.c:2083:22: error: ‘MS_RDONLY’ undeclared (first use in this function); did you mean ‘IS_RDONLY’?
 2083 |  if (!(sb->s_flags & MS_RDONLY))
      |                      ^~~~~~~~~
      |                      IS_RDONLY
/home/dclavijo/exfat-nofuse/exfat_super.c:2083:22: note: each undeclared identifier is reported only once for each function it appears in
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_remount’:
/home/dclavijo/exfat-nofuse/exfat_super.c:2139:12: error: ‘MS_NODIRATIME’ undeclared (first use in this function); did you mean ‘ST_NODIRATIME’?
 2139 |  *flags |= MS_NODIRATIME;
      |            ^~~~~~~~~~~~~
      |            ST_NODIRATIME
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_fill_super’:
/home/dclavijo/exfat-nofuse/exfat_super.c:2492:17: error: ‘MS_NODIRATIME’ undeclared (first use in this function); did you mean ‘ST_NODIRATIME’?
 2492 |  sb->s_flags |= MS_NODIRATIME;
      |                 ^~~~~~~~~~~~~
      |                 ST_NODIRATIME
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-5.10.0-2-common/scripts/Makefile.build:284: /home/dclavijo/exfat-nofuse/exfat_super.o] Error 1
make[2]: *** [/usr/src/linux-headers-5.10.0-2-common/Makefile:1817: /home/dclavijo/exfat-nofuse] Error 2
make[1]: *** [/usr/src/linux-headers-5.10.0-2-common/Makefile:185: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-2-amd64'
make: *** [Makefile:35: all] Error 2
dclavijo@wintermute:~/exfat-nofuse$ vim /home/dclavijo/exfat-nofuse/exfat_super.c
dclavijo@wintermute:~/exfat-nofuse$ make -j 8
make -C /lib/modules/5.10.0-2-amd64/build M=/home/dclavijo/exfat-nofuse modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.0-2-amd64'
  CC [M]  /home/dclavijo/exfat-nofuse/exfat_super.o
  CC [M]  /home/dclavijo/exfat-nofuse/exfat_oal.o
/home/dclavijo/exfat-nofuse/exfat_oal.c:124:8: error: unknown type name ‘time_t’
  124 | static time_t accum_days_in_year[] = {
      |        ^~~~~~
/home/dclavijo/exfat-nofuse/exfat_oal.c: In function ‘tm_current’:
/home/dclavijo/exfat-nofuse/exfat_oal.c:131:18: error: storage size of ‘ts’ isn’t known
  131 |  struct timespec ts;
      |                  ^~
/home/dclavijo/exfat-nofuse/exfat_oal.c:132:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  132 |  time_t second, day, leap_day, month, year;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_oal.c:137:2: error: implicit declaration of function ‘ktime_get_real_ts’; did you mean ‘ktime_get_real_ns’? [-Werror=implicit-function-declaration]
  137 |  ktime_get_real_ts(&ts);
      |  ^~~~~~~~~~~~~~~~~
      |  ktime_get_real_ns
/home/dclavijo/exfat-nofuse/exfat_oal.c:131:18: warning: unused variable ‘ts’ [-Wunused-variable]
  131 |  struct timespec ts;
      |                  ^~
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-5.10.0-2-common/scripts/Makefile.build:284: /home/dclavijo/exfat-nofuse/exfat_oal.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/home/dclavijo/exfat-nofuse/exfat_super.c:142:8: error: unknown type name ‘time_t’
  142 | static time_t accum_days_in_year[] = {
      |        ^~~~~~
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_time_fat2unix’:
/home/dclavijo/exfat-nofuse/exfat_super.c:153:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  153 |  time_t year = tp->Year;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_super.c:154:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  154 |  time_t ld;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_super.c:161:4: error: invalid use of undefined type ‘struct timespec’
  161 |  ts->tv_sec =  tp->Second  + tp->Minute * SECS_PER_MIN
      |    ^~
/home/dclavijo/exfat-nofuse/exfat_super.c:165:4: error: invalid use of undefined type ‘struct timespec’
  165 |  ts->tv_nsec = 0;
      |    ^~
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_time_unix2fat’:
/home/dclavijo/exfat-nofuse/exfat_super.c:172:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  172 |  time_t second = ts->tv_sec;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_super.c:172:20: error: invalid use of undefined type ‘struct timespec’
  172 |  time_t second = ts->tv_sec;
      |                    ^~
/home/dclavijo/exfat-nofuse/exfat_super.c:173:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  173 |  time_t day, month, year;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_super.c:174:2: error: unknown type name ‘time_t’; did you mean ‘ktime_t’?
  174 |  time_t ld;
      |  ^~~~~~
      |  ktime_t
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_readpages’:
/home/dclavijo/exfat-nofuse/exfat_super.c:1626:9: error: implicit declaration of function ‘mpage_readpages’; did you mean ‘mpage_readpage’? [-Werror=implicit-function-declaration]
 1626 |  ret =  mpage_readpages(mapping, pages, nr_pages, exfat_get_block);
      |         ^~~~~~~~~~~~~~~
      |         mpage_readpage
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_fill_inode’:
/home/dclavijo/exfat-nofuse/exfat_super.c:1927:27: error: passing argument 2 of ‘exfat_time_fat2unix’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1927 |  exfat_time_fat2unix(sbi, &inode->i_mtime, &info.ModifyTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:150:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  150 | void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
/home/dclavijo/exfat-nofuse/exfat_super.c:1928:27: error: passing argument 2 of ‘exfat_time_fat2unix’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1928 |  exfat_time_fat2unix(sbi, &inode->i_ctime, &info.CreateTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:150:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  150 | void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
/home/dclavijo/exfat-nofuse/exfat_super.c:1929:27: error: passing argument 2 of ‘exfat_time_fat2unix’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1929 |  exfat_time_fat2unix(sbi, &inode->i_atime, &info.AccessTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:150:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  150 | void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
/home/dclavijo/exfat-nofuse/exfat_super.c: In function ‘exfat_write_inode’:
/home/dclavijo/exfat-nofuse/exfat_super.c:2010:27: error: passing argument 2 of ‘exfat_time_unix2fat’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2010 |  exfat_time_unix2fat(sbi, &inode->i_mtime, &info.ModifyTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:169:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  169 | void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
/home/dclavijo/exfat-nofuse/exfat_super.c:2011:27: error: passing argument 2 of ‘exfat_time_unix2fat’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2011 |  exfat_time_unix2fat(sbi, &inode->i_ctime, &info.CreateTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:169:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  169 | void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
/home/dclavijo/exfat-nofuse/exfat_super.c:2012:27: error: passing argument 2 of ‘exfat_time_unix2fat’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2012 |  exfat_time_unix2fat(sbi, &inode->i_atime, &info.AccessTimestamp);
      |                           ^~~~~~~~~~~~~~~
      |                           |
      |                           struct timespec64 *
/home/dclavijo/exfat-nofuse/exfat_super.c:169:70: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
  169 | void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec *ts,
      |                                                     ~~~~~~~~~~~~~~~~~^~
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-5.10.0-2-common/scripts/Makefile.build:284: /home/dclavijo/exfat-nofuse/exfat_super.o] Error 1
make[2]: *** [/usr/src/linux-headers-5.10.0-2-common/Makefile:1817: /home/dclavijo/exfat-nofuse] Error 2
make[1]: *** [/usr/src/linux-headers-5.10.0-2-common/Makefile:185: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-2-amd64'
make: *** [Makefile:35: all] Error 2
Civil commented 3 years ago

You should probably use in-kernel driver (it was included AFAIR since 5.4 and reworked a lot in 5.7). You probably can find it in staging tree.

It is based on a newer version of samsung code, while this repo is long time inactive (no commits for about 4 years or so)

daedalus commented 3 years ago

I will try it, thanks