struct file fastcall *fget_light(unsigned int fd, int *fput_needed)
{
struct file *file; // 여기에서도 file 포인터를 만드네..
struct files_struct *files = current->files; //current는 현재 실행되는 task의 task_struct를 이야기한다.
*fput_needed = 0;
if (likely((atomic_read(&files->count) == 1))) {
file = fcheck_files(files, fd);
} else {
spin_lock(&files->file_lock);//공유를 위한 확인. 필요 없음.
file = fcheck_files(files, fd);//결국엔 이런 함수를 호출한다.
if (file) {
get_file(file);
*fput_needed = 1;
}
spin_unlock(&files->file_lock);//마찬가지
}
return file;
}