cryptomilk / kernel-sdfat

sdFAT fs support for the Linux Kernel
GNU General Public License v2.0
60 stars 20 forks source link

Build changes for external module testing #6

Closed airend closed 6 years ago

cryptomilk commented 6 years ago

@javelinanddart are you fine with this change?

javelinanddart commented 6 years ago

Seems OK.

airend commented 6 years ago

Someone should test it fully; only did light manual testing. Also, it needs a patched kernel before that exported symbol is solved.

javelinanddart commented 6 years ago

I don't like any of the "fixes" I put up to fix module compilation (outside of the MODULE_ALIAS_FS stuff)

airend commented 6 years ago

So just another kernel export then? For whoever is set on external module.

GrayJack commented 6 years ago

Would be easy to add support for dkms?

daiaji commented 6 years ago

Compile failed

make -C /lib/modules/4.18.8-1-default/build M=/home/daiaji/kernel-sdfat modules CONFIG_SDFAT_FS=m
make[1]: Entering directory '/usr/src/linux-4.18.8-1-obj/x86_64/default'
  CC [M]  /home/daiaji/kernel-sdfat/sdfat.o
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘__sdfat_revalidate_common’:
/home/daiaji/kernel-sdfat/sdfat.c:1178:19: error: invalid operands to binary != (have ‘long unsigned int’ and ‘atomic64_t’ {aka ‘struct <anonymous>’})
   (dentry->d_time != dentry->d_parent->d_inode->i_version))) {
    ~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘__sdfat_create’:
/home/daiaji/kernel-sdfat/sdfat.c:2330:16: error: wrong type argument to increment
  dir->i_version++;
                ^~
/home/daiaji/kernel-sdfat/sdfat.c:2343:18: error: wrong type argument to increment
  inode->i_version++;
                  ^~
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘__sdfat_lookup’:
/home/daiaji/kernel-sdfat/sdfat.c:2460:17: error: incompatible types when assigning to type ‘long unsigned int’ from type ‘atomic64_t’ {aka ‘struct <anonymous>’}
  dentry->d_time = dir->i_version;
                 ^
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘sdfat_unlink’:
/home/daiaji/kernel-sdfat/sdfat.c:2494:16: error: wrong type argument to increment
  dir->i_version++;
                ^~
/home/daiaji/kernel-sdfat/sdfat.c:2504:17: error: incompatible types when assigning to type ‘long unsigned int’ from type ‘atomic64_t’ {aka ‘struct <anonymous>’}
  dentry->d_time = dir->i_version;
                 ^
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘sdfat_symlink’:
/home/daiaji/kernel-sdfat/sdfat.c:2543:16: error: wrong type argument to increment
  dir->i_version++;
                ^~
/home/daiaji/kernel-sdfat/sdfat.c:2556:18: error: wrong type argument to increment
  inode->i_version++;
                  ^~
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘__sdfat_mkdir’:
/home/daiaji/kernel-sdfat/sdfat.c:2594:16: error: wrong type argument to increment
  dir->i_version++;
                ^~
/home/daiaji/kernel-sdfat/sdfat.c:2608:18: error: wrong type argument to increment
  inode->i_version++;
                  ^~
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘sdfat_rmdir’:
/home/daiaji/kernel-sdfat/sdfat.c:2642:16: error: wrong type argument to increment
  dir->i_version++;
                ^~
/home/daiaji/kernel-sdfat/sdfat.c:2653:17: error: incompatible types when assigning to type ‘long unsigned int’ from type ‘atomic64_t’ {aka ‘struct <anonymous>’}
  dentry->d_time = dir->i_version;
                 ^
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘__sdfat_rename’:
/home/daiaji/kernel-sdfat/sdfat.c:2687:20: error: wrong type argument to increment
  new_dir->i_version++;
                    ^~
/home/daiaji/kernel-sdfat/sdfat.c:2708:20: error: wrong type argument to increment
  old_dir->i_version++;
                    ^~
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘sdfat_fill_inode’:
/home/daiaji/kernel-sdfat/sdfat.c:3830:18: error: wrong type argument to increment
  inode->i_version++;
                  ^~
/home/daiaji/kernel-sdfat/sdfat.c:3885:27: error: passing argument 2 of ‘sdfat_time_fat2unix’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  sdfat_time_fat2unix(sbi, &inode->i_mtime, &info.ModifyTimestamp);
                           ^~~~~~~~~~~~~~~
In file included from /home/daiaji/kernel-sdfat/sdfat.c:65:
/home/daiaji/kernel-sdfat/sdfat.h:366:77: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
 extern void sdfat_time_fat2unix(struct sdfat_sb_info *sbi, struct timespec *ts,
                                                            ~~~~~~~~~~~~~~~~~^~
/home/daiaji/kernel-sdfat/sdfat.c:3886:27: error: passing argument 2 of ‘sdfat_time_fat2unix’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  sdfat_time_fat2unix(sbi, &inode->i_ctime, &info.CreateTimestamp);
                           ^~~~~~~~~~~~~~~
In file included from /home/daiaji/kernel-sdfat/sdfat.c:65:
/home/daiaji/kernel-sdfat/sdfat.h:366:77: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
 extern void sdfat_time_fat2unix(struct sdfat_sb_info *sbi, struct timespec *ts,
                                                            ~~~~~~~~~~~~~~~~~^~
/home/daiaji/kernel-sdfat/sdfat.c:3887:27: error: passing argument 2 of ‘sdfat_time_fat2unix’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  sdfat_time_fat2unix(sbi, &inode->i_atime, &info.AccessTimestamp);
                           ^~~~~~~~~~~~~~~
In file included from /home/daiaji/kernel-sdfat/sdfat.c:65:
/home/daiaji/kernel-sdfat/sdfat.h:366:77: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
 extern void sdfat_time_fat2unix(struct sdfat_sb_info *sbi, struct timespec *ts,
                                                            ~~~~~~~~~~~~~~~~~^~
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘sdfat_build_inode’:
/home/daiaji/kernel-sdfat/sdfat.c:3908:19: error: incompatible types when assigning to type ‘atomic64_t’ {aka ‘struct <anonymous>’} from type ‘int’
  inode->i_version = 1;
                   ^
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘__sdfat_write_inode’:
/home/daiaji/kernel-sdfat/sdfat.c:3956:27: error: passing argument 2 of ‘sdfat_time_unix2fat’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  sdfat_time_unix2fat(sbi, &inode->i_mtime, &info.ModifyTimestamp);
                           ^~~~~~~~~~~~~~~
In file included from /home/daiaji/kernel-sdfat/sdfat.c:65:
/home/daiaji/kernel-sdfat/sdfat.h:368:77: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
 extern void sdfat_time_unix2fat(struct sdfat_sb_info *sbi, struct timespec *ts,
                                                            ~~~~~~~~~~~~~~~~~^~
/home/daiaji/kernel-sdfat/sdfat.c:3957:27: error: passing argument 2 of ‘sdfat_time_unix2fat’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  sdfat_time_unix2fat(sbi, &inode->i_ctime, &info.CreateTimestamp);
                           ^~~~~~~~~~~~~~~
In file included from /home/daiaji/kernel-sdfat/sdfat.c:65:
/home/daiaji/kernel-sdfat/sdfat.h:368:77: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
 extern void sdfat_time_unix2fat(struct sdfat_sb_info *sbi, struct timespec *ts,
                                                            ~~~~~~~~~~~~~~~~~^~
/home/daiaji/kernel-sdfat/sdfat.c:3958:27: error: passing argument 2 of ‘sdfat_time_unix2fat’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  sdfat_time_unix2fat(sbi, &inode->i_atime, &info.AccessTimestamp);
                           ^~~~~~~~~~~~~~~
In file included from /home/daiaji/kernel-sdfat/sdfat.c:65:
/home/daiaji/kernel-sdfat/sdfat.h:368:77: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’
 extern void sdfat_time_unix2fat(struct sdfat_sb_info *sbi, struct timespec *ts,
                                                            ~~~~~~~~~~~~~~~~~^~
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘sdfat_read_root’:
/home/daiaji/kernel-sdfat/sdfat.c:4751:18: error: wrong type argument to increment
  inode->i_version++;
                  ^~
/home/daiaji/kernel-sdfat/sdfat.c: In function ‘sdfat_fill_super’:
/home/daiaji/kernel-sdfat/sdfat.c:4875:24: error: incompatible types when assigning to type ‘atomic64_t’ {aka ‘struct <anonymous>’} from type ‘int’
  root_inode->i_version = 1;
                        ^
cc1: some warnings being treated as errors
make[4]: *** [/usr/src/linux-4.18.8-1/scripts/Makefile.build:319: /home/daiaji/kernel-sdfat/sdfat.o] Error 1
make[3]: *** [/usr/src/linux-4.18.8-1/Makefile:1518: _module_/home/daiaji/kernel-sdfat] Error 2
make[2]: *** [Makefile:146: sub-make] Error 2
make[1]: *** [Makefile:24: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-4.18.8-1-obj/x86_64/default'
make: *** [Makefile:21: all] Error 2