[Yaffs] Makefile.kernel in git misses yaffs_nameval.o?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: siegbert.baude@gmx.de
Date:  
To: yaffs
Subject: [Yaffs] Makefile.kernel in git misses yaffs_nameval.o?
Hello

I integrated todays git snapshot into our Montavista5 kernel (based on
2.6.18) for TI's DM355.
But "make" complained:

LD      .tmp_vmlinux1
fs/built-in.o: In function `yaffs_DoXFetch':
yaffs_mtdif2.c:(.text+0x5fb10): undefined reference to `nval_get'
yaffs_mtdif2.c:(.text+0x5fb20): undefined reference to `nval_list'
fs/built-in.o: In function `yaffs_UpdateObjectHeader':
yaffs_mtdif2.c:(.text+0x61038): undefined reference to `nval_set'
yaffs_mtdif2.c:(.text+0x61044): undefined reference to `nval_del'
make: *** [.tmp_vmlinux1] Error 1




As this symbols are defined in yaffs_nameval.c, I added
yaffs_nameval.o to my Makefile:
$ grep yaffs_nameval.o fs/yaffs2/Makefile
yaffs-y += yaffs_nameval.o
$

Now the kernel compiles. Why is it necessary to add this to the
Makefile, is it my weird configuration? My config looks like that:
$ grep YAFFS .config
CONFIG_YAFFS_FS=y
CONFIG_YAFFS_YAFFS1=y
# CONFIG_YAFFS_9BYTE_TAGS is not set
# CONFIG_YAFFS_DOES_ECC is not set
CONFIG_YAFFS_YAFFS2=y
CONFIG_YAFFS_AUTO_YAFFS2=y
CONFIG_YAFFS_DISABLE_TAGS_ECC=y
# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
CONFIG_YAFFS_EMPTY_LOST_AND_FOUND=y
# CONFIG_YAFFS_DISABLE_BLOCK_REFRESHING is not set
CONFIG_YAFFS_DISABLE_BACKGROUND=y
# CONFIG_YAFFS_XATTR is not set
$



Side note: The Montavista version of 2.6.18 didn't know file->f_path,
so I added a kernel version check in yaffs_fs.c, yaffs_dir_llseek(),
"case 2"

static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin)
{
    long long retval;


    lock_kernel();


    switch (origin){
    case 2:
        #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
            offset += i_size_read(file->f_dentry->d_inode);
        #else
            offset += i_size_read(file->f_path.dentry->d_inode);
        #endif
        break;


I'm not completely sure if f_path was really introduced in 2.6.20, but
found this in a similar workaround floating in the net.

Last comment: "freeze.h" and therefore "set_freezable()" were also
unknown in Montavista's 2.6.18. Here I'm not so sure, if my workaround
has unwanted side effects. I added a check for
CONFIG_YAFFS_DISABLE_BACKGROUND in yaffs_fs.c, line 36.

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10))
#define YAFFS_COMPILE_BACKGROUND
#if CONFIG_YAFFS_DISABLE_BACKGROUND
#undef YAFFS_COMPILE_BACKGROUND
#endif
#endif

But is the kernel configuration option
"CONFIG_YAFFS_DISABLE_BACKGROUND" really the negated
"YAFFS_COMPILE_BACKGROUND"? Why do then two different variables exist?
Would be nice, if you could comment on this one.

Best regards
Siegbert