c - Clarification need on calling a function in the kernel -
i having issue calling function (ext3_get_inode_loc) exec.c exists in several other files.
i should mention new , entirely self-taught i'm sure have major knowledge gaps. appreciate pointers or advice on i'm missing, and/or answers.
below result of recursive grep linux-3.10.0.123.20.1.el7 directory -
"grep ext3_get_inode_loc -r *" fs/ext3/inode.c: fs/ext3/inode.c:static int __ext3_get_inode_loc(struct inode *inode, fs/ext3/inode.c:ext3_error (inode->i_sb, ext3_get_inode_loc", fs/ext3/inode.c:ext3_error(inode->i_sb, ext3_get_inode_loc", fs/ext3/inode.c:int ext3_get_inode_loc(struct inode *inode, struct ext3_iloc *iloc) fs/ext3/inode.c:return __ext3_get_inode_loc(inode, iloc, fs/ext3/inode.c:ret = __ext3_get_inode_loc(inode, &iloc, 0); fs/ext3/inode.c:err = ext3_get_inode_loc(inode, iloc); fs/ext3/inode.c:err = ext3_get_inode_loc(inode, &iloc); fs/ext3/ext3.h:extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *); fs/ext3/xattr.c:error = ext3_get_inode_loc(inode, &iloc); fs/ext3/xattr.c:error = ext3_get_inode_loc(inode, &iloc); fs/ext3/xattr.c:error = ext3_get_inode_loc(inode, &is.iloc);
which shows exists in these 3 files -
ext3.h inode.c xattr.c
ext3.h includes function prototype
extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *);
inode.c , xattr.c both include ext3.h providing prototype both files
#include "ext3.h"
inode.c includes function definition -
static int __ext3_get_inode_loc(struct inode *inode, struct ext3_iloc *iloc, int in_mem) { ext3_fsblk_t block; struct buffer_head *bh; block = ext3_get_inode_block(inode->i_sb, inode->i_ino, iloc); if (!block) return -eio; bh = sb_getblk(inode->i_sb, block); . . ... , forth }
and function call -
err = ext3_get_inode_loc(inode, iloc);
xattr.c includes call, not definition -
error = ext3_get_inode_loc(inode, &iloc);
my question is, if add exact same line of code -
error = ext3_get_inode_loc(inode, &iloc);
to open_exec() within exec.c in same manner of xattr.c (without function definition) following error when compiling "make" -
fs/built-in.o: in function `open_exec': ~/linux-3.10.0-123.20.1.el7/fs/exec.c:828: undefined reference `ext3_get_inode_loc'
why function available xattr.c , not exec.c? i've googled quite bit on , have read might due linking issue (or lack thereof) between exec.c , xattr.c
thanks ahead of time - rog
ext3_get_inode_loc
local ext3 driver, located @ fs/ext3. cannot call outside of driver code.
Comments
Post a Comment