system call - close calling path

close (user-space)-> syscall expcetion

    syscall ( linux2.6.29.4\arch\mips\kernel\scall32-o32.S)  --------->  sys_exit(unsigned int fd)

         SYSCALL_DEFINE1(close, unsigned int, fd) (linux2.6.29.4\fs\open.c)  ---------> int filp_close(struct file *filp, fl_owner_t id)

                 retval = filp_close(filp, files);  --------->  void fput(struct file *file)

                         fput(filp);  ---------> void __fput(struct file *file)

                                     __fput(file);  --------->  int (*release) (struct inode *, struct file *);

                                             if (file->f_op && file->f_op->release) file->f_op->release(inode, file); 

                                                  

That is said, when a device file is closed, the release function that it implements will be called insensibly.

            

posted on 2013-12-26 18:45  Shawn X.Y. Bai  阅读(272)  评论(0)    收藏  举报

导航