kernels/linux-2.4.0/fs/ufs/file.c
/*
 * Make sure the offset never goes beyond the 32-bit mark..
 */
Make sure the offset never goes beyond the 32-bit mark
Make sure the offset never goes beyond the 32 - bit mark
static long long ufs_file_lseek(
	struct file *file,
	long long offset,
	int origin )
{
	long long retval;
	struct inode *inode = file->f_dentry->d_inode;
	switch (origin) {
		case 2:
			offset += inode->i_size;
			break;
		case 1:
			offset += file->f_pos;
	}
	retval = -EINVAL;
	if (((unsigned long long) offset >> 32) == 0) {
		if (offset != file->f_pos) {
			file->f_pos = offset;
			file->f_reada = 0;
			file->f_version = ++event;
		}
		retval = offset;
	}
	return retval;
}
static long long ufs_file_lseek ( struct file * file , long long offset , int origin ) { long long retval ; struct inode * inode = file -> f_dentry -> d_inode ; switch ( origin ) { case 2 : offset += inode -> i_size ; break ; case 1 : offset += file -> f_pos ; } retval = - EINVAL ; if ( ( ( unsigned long long ) offset >> 32 ) == 0 ) { if ( offset != file -> f_pos ) { file -> f_pos = offset ; file -> f_reada = 0 ; file -> f_version = ++ event ; } retval = offset ; } return retval ; }
Make sure the offset never goes beyond the 32-bit mark..
Make sure the offset never goes beyond the 32 - bit mark ..
/* make sure the offset fits in 32 bits */