移植Yaffs2错误

Linux-Torvalds 2010-10-07 10:24:49
fs/yaffs2/yaffs_fs.c: In function 'yaffs_vfs_setsize':
fs/yaffs2/yaffs_fs.c:495: error: implicit declaration of function 'simple_setsize'
make[2]: *** [fs/yaffs2/yaffs_fs.o] Error 1
make[1]: *** [fs/yaffs2] Error 2
make: *** [fs] Error 2

现在的问题是无论用何种方法,无法找到simple_setsize的定义。有没有更好的查找方法?或者这个函数定义在2.4.24内核中没有定义。
...全文
169 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Linux-Torvalds 2010-10-07
  • 打赏
  • 举报
回复
一个simple_setsize函数解决不了。
Linux-Torvalds 2010-10-07
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 sundesheng125 的回复:]

引用楼主 linwhwylb 的回复:
fs/yaffs2/yaffs_fs.c: In function 'yaffs_vfs_setsize':
fs/yaffs2/yaffs_fs.c:495: error: implicit declaration of function 'simple_setsize'
make[2]: *** [fs/yaffs2/yaffs_fs.o] Er……
[/Quote]
我用的yaffs2,不是yaffs。
yaffs没有问题。
yaffs2有问题。
coding码场 2010-10-07
  • 打赏
  • 举报
回复
我用最新的yaffs包,移植到2.6.23内核上,没有这个问题。
coding码场 2010-10-07
  • 打赏
  • 举报
回复
[Quote=引用楼主 linwhwylb 的回复:]
fs/yaffs2/yaffs_fs.c: In function 'yaffs_vfs_setsize':
fs/yaffs2/yaffs_fs.c:495: error: implicit declaration of function 'simple_setsize'
make[2]: *** [fs/yaffs2/yaffs_fs.o] Error 1
make[1]: *** [f……
[/Quote]你用的是2.4.24的内核?
Linux-Torvalds 2010-10-07
  • 打赏
  • 举报
回复
yaffs的话,没有任何问题。还是将就着吧。结贴,拿分。
Linux-Torvalds 2010-10-07
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 sundesheng125 的回复:]

引用 6 楼 linwhwylb 的回复:
引用 4 楼 sundesheng125 的回复:

引用楼主 linwhwylb 的回复:
fs/yaffs2/yaffs_fs.c: In function 'yaffs_vfs_setsize':
fs/yaffs2/yaffs_fs.c:495: error: implicit declaration of function 'sim……
[/Quote]
一点问题也没有?那就怪异了。算了。Yaffs将就着。
coding码场 2010-10-07
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 linwhwylb 的回复:]
引用 4 楼 sundesheng125 的回复:

引用楼主 linwhwylb 的回复:
fs/yaffs2/yaffs_fs.c: In function 'yaffs_vfs_setsize':
fs/yaffs2/yaffs_fs.c:495: error: implicit declaration of function 'simple_setsize'
make[2]: *……
[/Quote]我的yaffs2也没问题。
Linux-Torvalds 2010-10-07
  • 打赏
  • 举报
回复
还有下面一点点信息。
+/**
+ * simple_setsize - handle core mm and vfs requirements for file size change
+ * @inode: inode
+ * @newsize: new file size
+ *
+ * Returns 0 on success, -error on failure.
+ *
+ * simple_setsize must be called with inode_mutex held.
+ *
+ * simple_setsize will check that the requested new size is OK (see
+ * inode_newsize_ok), and then will perform the necessary i_size update
+ * and pagecache truncation (if necessary). It will be typically be called
+ * from the filesystem's setattr function when ATTR_SIZE is passed in.
+ *
+ * The inode itself must have correct permissions and attributes to allow
+ * i_size to be changed, this function then just checks that the new size
+ * requested is valid.
+ *
+ * In the case of simple in-memory filesystems with inodes stored solely
+ * in the inode cache, and file data in the pagecache, nothing more needs
+ * to be done to satisfy a truncate request. Filesystems with on-disk
+ * blocks for example will need to free them in the case of truncate, in
+ * that case it may be easier not to use simple_setsize (but each of its
+ * components will likely be required at some point to update pagecache
+ * and inode etc).
+ */
+int simple_setsize(struct inode *inode, loff_t newsize)
+{
+ loff_t oldsize;
+ int error;
+
+ error = inode_newsize_ok(inode, newsize);
+ if (error)
+ return error;
+
+ oldsize = inode->i_size;
+ i_size_write(inode, newsize);
+ truncate_pagecache(inode, oldsize, newsize);
+
+ return error;
+}
+EXPORT_SYMBOL(simple_setsize);
Linux-Torvalds 2010-10-07
  • 打赏
  • 举报
回复
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35))
#define YAFFS_USE_SETATTR_COPY
#define YAFFS_USE_TRUNCATE_SETSIZE
#endif
/* ... */
static int yaffs_vfs_setsize(struct inode *inode, loff_t newsize)
{
#ifdef YAFFS_USE_TRUNCATE_SETSIZE
truncate_setsize(inode,newsize);
return 0;
#else
return simple_setsize(inode, newsize);
#endif

}

目前的信息就这么多。

4,441

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧