Exemplo n.º 1
0
long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
	struct open_flags op;
	int lookup = build_open_flags(flags, mode, &op);
	char *tmp = getname(filename);
	int fd = PTR_ERR(tmp);

	if (!IS_ERR(tmp)) {
		fd = get_unused_fd_flags(flags);
		if (fd >= 0) {
			struct file *f = do_filp_open(dfd, tmp, &op, lookup);
			if (IS_ERR(f)) {
				put_unused_fd(fd);
				fd = PTR_ERR(f);
			} else {
				fsnotify_open(f);
				fd_install(fd, f);
				/* LGE_CHANGE_S
				 *
				 * do read/mmap profiling during booting
				 * in order to use the data as readahead args
				 *
				 * [email protected] 20120503
				 */
				sreadahead_prof( f, 0, 0);
				/* LGE_CHANGE_E */
			}
		}
		putname(tmp);
	}
	return fd;
}
Exemplo n.º 2
0
long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
	struct open_flags op;
	int lookup = build_open_flags(flags, mode, &op);
	char *tmp = getname(filename);
	int fd = PTR_ERR(tmp);
	if (!IS_ERR(tmp)) {
		fd = get_unused_fd_flags(flags);
		if (fd >= 0) {
			struct file *f = do_filp_open(dfd, tmp, &op, lookup);
			if (IS_ERR(f)) {
				put_unused_fd(fd);
				fd = PTR_ERR(f);
			} else {
				fsnotify_open(f);
				fd_install(fd, f);
                /*             
                  
                                                        
                                                             
                  
                                                  
                 */
                sreadahead_prof( f, 0, 0);
                /*              */

			}
		}
		putname(tmp);
	}
	return fd;
}