Skip to contentSkip to conversation

fuse: Don't do file_update_time for write_operation.

PATCH In review majianpeng 2 participants 2 messages Mar 29, 2013 – May 2, 2013 FUSE filesystem core

lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 1/1 fuse: Don't do file_update_time for write_operation.

For direct-write and normal-write operations, after write they will call fuse_invalidate_attr. So it's make no sense to call file_update_time before writing.

In function file_update_time, there is other thing which update version of inode.For this i am not sure.

---
fs/fuse/file.c | 4 ----

1 file changed, 4 deletions(-)
fs/fuse/file.c +0 -0
index 34b80ba..214279c 100644
@@ -988,10 +988,6 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,

if (err)
goto out;

- err = file_update_time(file);
- if (err)
- goto out;
-
if (file->f_flags & O_DIRECT) {
written = generic_file_direct_write(iocb, iov, &nr_segs, pos, &iocb->ki_pos,

Signature · 1 line
1.8.2.rc2.4.g7799588
maintainer
#1 lore raw
Quoted 5 lines · majianpeng

For direct-write and normal-write operations, after write they will call fuse_invalidate_attr. So it's make no sense to call file_update_time before writing.

In function file_update_time, there is other thing which update version of inode.For this i am not sure.

file_update_time will skip the actual file update anyway due to S_NOCMTIME. And when we will do cached writes we actually need the time updates. So I'm not applying this one.

Thanks,
Miklos

Quoted 24 lines

---
fs/fuse/file.c | 4 ----

1 file changed, 4 deletions(-)
fs/fuse/file.c +0 -5
index 34b80ba..214279c 100644
@@ -988,10 +988,6 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
 if (err)
 goto out;
 
- err = file_update_time(file);
- if (err)
- goto out;
-
 if (file->f_flags & O_DIRECT) {
 written = generic_file_direct_write(iocb, iov, &nr_segs,
 pos, &iocb->ki_pos,
--

1.8.2.rc2.4.g7799588