diff mbox series

fs/libfs.c: let lseek use SEEK_SET and SEEK_CUR

Message ID 20190226093659.111125-1-yuyufen@huawei.com (mailing list archive)
State New, archived
Headers show
Series fs/libfs.c: let lseek use SEEK_SET and SEEK_CUR | expand

Commit Message

Yufen Yu Feb. 26, 2019, 9:36 a.m. UTC
Let dcache_dir_lseek() use SEEK_SET and SEEK_CUR to make
code more unify.

Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
 fs/libfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Yufen Yu March 12, 2019, 5:57 a.m. UTC | #1
ping ?


On 2019/2/26 17:36, Yufen Yu wrote:
> Let dcache_dir_lseek() use SEEK_SET and SEEK_CUR to make
> code more unify.
>
> Signed-off-by: Yufen Yu <yuyufen@huawei.com>
> ---
>   fs/libfs.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/libfs.c b/fs/libfs.c
> index 0fb590d79f30..37654d33bd29 100644
> --- a/fs/libfs.c
> +++ b/fs/libfs.c
> @@ -144,9 +144,9 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence)
>   {
>   	struct dentry *dentry = file->f_path.dentry;
>   	switch (whence) {
> -		case 1:
> +		case SEEK_CUR:
>   			offset += file->f_pos;
> -		case 0:
> +		case SEEK_SET:
>   			if (offset >= 0)
>   				break;
>   		default:
diff mbox series

Patch

diff --git a/fs/libfs.c b/fs/libfs.c
index 0fb590d79f30..37654d33bd29 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -144,9 +144,9 @@  loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence)
 {
 	struct dentry *dentry = file->f_path.dentry;
 	switch (whence) {
-		case 1:
+		case SEEK_CUR:
 			offset += file->f_pos;
-		case 0:
+		case SEEK_SET:
 			if (offset >= 0)
 				break;
 		default: