1: void lookupInode()

   2: {

   3:     struct dentry* root_dentry;

   4:     struct vfsmount* root_mnt;

   5:     const char* filename;

   6:     struct nameidata data;

   7:     int err = 0;

   8:  

   9:     root_dentry = current->fs->root.dentry;

  10:     root_mnt = current->fs->root.mnt;

  11:     filename = "/mod/case/superblock/tmp";

  12:     //filename = "/boot/vmlinuz-3.0.0-12-generic";

  13:     //filename = "/";

  14:     filename = "/home/danie/filelist.c";

  15:     //filename = "/home/daniel";

  16:     //filename = "/mod/case/superblock/tmp";

  17:     err = vfs_path_lookup(root_dentry,root_mnt,filename,LOOKUP_EXCL,&data);

  18:     printk("lookup %s\n", filename);

  19:     if (err==0)

  20:     {

  21:         struct inode* nodei = data.inode;

  22:         struct address_space* mapping = nodei->i_mapping;

  23:         printk("mapping 0x%08x\n", mapping);

  24:         printk("nr_pages: %d\n", mapping->nrpages);

  25:         

  26:         //printk("Showing:\n");

  27:         printRawData(sizeof(struct inode),nodei);

  28:         

  29:     }

  30:     else

  31:         printk("err: %d\n", err);

  32:  

  33: }

vfs_path_lookup为什么读不到文件,但是能够读到目录?

vfs_path_lookup的更多相关文章

  1. systemtap 列出所有linux 内核模块与相关函数0

    diskiohttp://blog.163.com/digoal%40126/blog/static/16387704020131015105532435/ [root@localhost linux ...

随机推荐

  1. MySQL strcmp 函数

    STRCMP(str1, str2) 比较两个字符串,如果这两个字符串相等返回0,如果第一个参数是根据当前的排序小于第二个参数顺序返回-1,否则返回1. mysql> SELECT STRCMP ...

  2. PAT 1051 Pop Sequence (25 分)

    返回 1051 Pop Sequence (25 分)   Given a stack which can keep M numbers at most. Push N numbers in the ...

  3. flask编程规范

    参考:http://dormousehole.readthedocs.org/en/latest/styleguide.html   Flask遵循的是Pocoo的编程规范,Pocoo遵守PEP8的规 ...

  4. ajax请求在参数中添加时间戳

    ajax请求在参数中添加时间戳 参考网址

  5. mysql添加制定ip访问

    GRANT ALL PRIVILEGES ON *.* TO 'root'@'120.244.114.45' IDENTIFIED BY 'Zhh722@7758521' WITH GRANT OPT ...

  6. Cocos2d-x之Scene

    |   版权声明:本文为博主原创文章,未经博主允许不得转载. Scene场景也是cocos2dx中必不可少的元素,游戏中通常我们需要构建不同的场景(至少一个),游戏里关卡.版块的切换也就是一个一个场景 ...

  7. CSS Sprites技术原理和使用

      在分析各个网站的CSS时,我们经常可以看到一些网站有很多的元素共享了一张背景图片,而这张背景图片包含了所有这些元素需要的背景,这种技术就叫做CSS Sprites. 淘宝的css sprites ...

  8. Excel解析工具POI

    HSSFWorkbook:是操作Excel2003以前(包括2003)的版本,扩展名是.xls XSSFWorkbook:是操作Excel2007的版本,扩展名是.xlsx 对于不同版本的EXCEL文 ...

  9. Arcpy 将要素类添加到当前工作窗口(内容列表)

    test1layer=arcpy.mapping.Layer( folder+"\\"+"result.shp") mxd = arcpy.mapping.Ma ...

  10. 使用Condition实现顺序执行

    参考<Java多线程编程核心技术> 使用Condition对象可以对线程执行的业务进行排序规划 具体实现代码 public class Run2 { private static Reen ...