|
发表于 2005-9-2 20:54:50
|
显示全部楼层
- struct file fastcall *fget(unsigned int fd)
- {
- struct file *file;
- struct files_struct *files = current->files;
- spin_lock(&files->file_lock);
- file = fcheck_files(files, fd);
- if (file)
- get_file(file);
- spin_unlock(&files->file_lock);
- return file;
- }
复制代码
- static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
- {
- struct file * file = NULL;
- if (fd < files->max_fds)
- file = files->fd[fd];
- return file;
- }
复制代码
从上面的代码可以看出是相对应的。 |
|