当前位置: 技术问答>linux和unix
make出现实参太少~ 望大神们给解决下
来源: 互联网 发布时间:2017-03-26
本文导语: 初次接触linux内核,用cryptfs生成的代码中,make之后出现如下错误: file.c:467: 错误:提供给函数‘dentry_open’的实参太少file.c:467: 错误:提供给函数‘dentry_open’的实参太少 file.c:654: 错误:提供给函数‘posix_lock_file...
初次接触linux内核,用cryptfs生成的代码中,make之后出现如下错误:
file.c:467: 错误:提供给函数‘dentry_open’的实参太少file.c:467: 错误:提供给函数‘dentry_open’的实参太少
file.c:654: 错误:提供给函数‘posix_lock_file’的实参太少
上述代码为:
467 lower_file = dentry_open(lower_dentry, DENTRY_TO_LVFSMNT(file->f_dentry), lower_flags);
654 error = posix_lock_file(file, fl);
内核版本:2.6.32-71.el6.i686
1、这两个函数应该都是,内核定义的函数吧?
2、如果是,我要去找这两个函数定义
3、如果不是,怎么修改?
大神们,帮帮忙~~
file.c:467: 错误:提供给函数‘dentry_open’的实参太少file.c:467: 错误:提供给函数‘dentry_open’的实参太少
file.c:654: 错误:提供给函数‘posix_lock_file’的实参太少
上述代码为:
467 lower_file = dentry_open(lower_dentry, DENTRY_TO_LVFSMNT(file->f_dentry), lower_flags);
654 error = posix_lock_file(file, fl);
内核版本:2.6.32-71.el6.i686
1、这两个函数应该都是,内核定义的函数吧?
2、如果是,我要去找这两个函数定义
3、如果不是,怎么修改?
大神们,帮帮忙~~
|
贴下两上函数的原型和实现
至于一些参数怎么用,可以参考内核调用的地方
至于一些参数怎么用,可以参考内核调用的地方
/*
* dentry_open() will have done dput(dentry) and mntput(mnt) if it returns an
* error.
*/
struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags,
const struct cred *cred)
{
int error;
struct file *f;
/*
* We must always pass in a valid mount pointer. Historically
* callers got away with not passing it, but we must enforce this at
* the earliest possible point now to avoid strange problems deep in the
* filesystem stack.
*/
if (!mnt) {
printk(KERN_WARNING "%s called with NULL vfsmountn", __func__);
dump_stack();
return ERR_PTR(-EINVAL);
}
error = -ENFILE;
f = get_empty_filp();
if (f == NULL) {
dput(dentry);
mntput(mnt);
return ERR_PTR(error);
}
return __dentry_open(dentry, mnt, flags, f, NULL, cred);
}
/**
* posix_lock_file - Apply a POSIX-style lock to a file
* @filp: The file to apply the lock to
* @fl: The lock to be applied
* @conflock: Place to return a copy of the conflicting lock, if found.
*
* Add a POSIX style lock to a file.
* We merge adjacent & overlapping locks whenever possible.
* POSIX locks are sorted by owner task, then by starting address
*
* Note that if called with an FL_EXISTS argument, the caller may determine
* whether or not a lock was successfully freed by testing the return
* value for -ENOENT.
*/
int posix_lock_file(struct file *filp, struct file_lock *fl,
struct file_lock *conflock)
{
return __posix_lock_file(filp->f_path.dentry->d_inode, fl, conflock);
}
|
参考内核代码别人怎么用,你也怎么用
|
楼主的参数个数匹配有问题,根据源码中参数的个数和参数的类型来传值即可
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。