| Function report | 
| Source Code: fs\namei.c | Create Date:2022-07-28 20:05:12 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:Look up and maybe create and open the last component
Proto:static int lookup_open(struct nameidata *nd, struct path *path, struct file *file, const struct open_flags *op, bool got_write)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct nameidata * | nd | |
| struct path * | path | |
| struct file * | file | |
| const struct open_flags * | op | |
| bool | got_write | 
| 3080 | create_error = 0 | 
| 3084 | If Value for the false possibility is greater at compile time(IS_DEADDIR(dir_inode)) Then Return -ENOENT | 
| 3087 | f_mode &= ~FMODE_CREATED | 
| 3088 | dentry = search for a dentry | 
| 3089 | cycle | 
| 3090 | If Not dentry Then | 
| 3091 | dentry = d_alloc_parallel(dir, & last, & wq) | 
| 3095 | If d_in_lookup(dentry) Then Break | 
| 3098 | error = d_revalidate(dentry, flags) | 
| 3099 | If Value is more likely to compile time(error > 0) Then Break | 
| 3103 | invalidate a dentry | 
| 3105 | dentry = NULL | 
| 3107 | If Where the name belongs to - NULL is * negative Then | 
| 3109 | Go to out_no_open | 
| 3122 | If Not IS_POSIXACL( Where the name belongs to - NULL is * negative ) Then mode &= ~current_umask() | 
| 3125 | create_error = -EROFS | 
| 3130 | Else | 
| 3131 | create_error = may_o_create( & path, dentry, mode) | 
| 3132 | If create_error Then | 
| 3144 | Go to no_open | 
| 3147 | If atomic_open Then | 
| 3150 | If Value for the false possibility is greater at compile time(error == - ENOENT) && create_error Then error = create_error | 
| 3152 | Return error | 
| 3155 | no_open : | 
| 3156 | If d_in_lookup(dentry) Then | 
| 3159 | d_lookup_done(dentry) | 
| 3171 | If Not Where the name belongs to - NULL is * negative && open_flag & O_CREAT Then | 
| 3172 | f_mode |= FMODE_CREATED | 
| 3174 | If Not create Then | 
| 3185 | error = create_error | 
| 3186 | Go to out_dput | 
| 3188 | out_no_open : | 
| 3191 | Return 0 | 
| 3193 | out_dput : | 
| 3195 | Return error | 
| Name | Describe | 
|---|---|
| do_last | Handle the last step of open() | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |