mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
[PATCH] VFS: Use SEEK_{SET, CUR, END} instead of hardcoded values
VFS: Use SEEK_{SET,CUR,END} instead of hardcoded values Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
4636d93b46
commit
f5579f8c7d
1 changed files with 6 additions and 6 deletions
12
fs/locks.c
12
fs/locks.c
|
@ -314,13 +314,13 @@ static int flock_to_posix_lock(struct file *filp, struct file_lock *fl,
|
|||
off_t start, end;
|
||||
|
||||
switch (l->l_whence) {
|
||||
case 0: /*SEEK_SET*/
|
||||
case SEEK_SET:
|
||||
start = 0;
|
||||
break;
|
||||
case 1: /*SEEK_CUR*/
|
||||
case SEEK_CUR:
|
||||
start = filp->f_pos;
|
||||
break;
|
||||
case 2: /*SEEK_END*/
|
||||
case SEEK_END:
|
||||
start = i_size_read(filp->f_dentry->d_inode);
|
||||
break;
|
||||
default:
|
||||
|
@ -364,13 +364,13 @@ static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl,
|
|||
loff_t start;
|
||||
|
||||
switch (l->l_whence) {
|
||||
case 0: /*SEEK_SET*/
|
||||
case SEEK_SET:
|
||||
start = 0;
|
||||
break;
|
||||
case 1: /*SEEK_CUR*/
|
||||
case SEEK_CUR:
|
||||
start = filp->f_pos;
|
||||
break;
|
||||
case 2: /*SEEK_END*/
|
||||
case SEEK_END:
|
||||
start = i_size_read(filp->f_dentry->d_inode);
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue