Skip to contentSkip to conversation

ceph: remove sb_start/end_write in ceph_aio_write.

PATCH In review majianpeng 3 participants 3 messages Jun 17, 2013 – Jun 23, 2013 Ceph client

lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 1/1 ceph: remove sb_start/end_write in ceph_aio_write.

Either in vfs_write or io_submit,it call file_start/end_write. The different between file_start/end_write and sb_start/end_write is file_ only handle regular file.But i think in ceph_aio_write,it only for regular file.

---
 fs/ceph/file.c | 2 --
 1 file changed, 2 deletions(-)
fs/ceph/file.c +0 -2
index 656e169..7c69f4f 100644
@@ -716,7 +716,6 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,
 	if (ceph_snap(inode) != CEPH_NOSNAP)
 		return -EROFS;
 
-	sb_start_write(inode->i_sb);
 	mutex_lock(&inode->i_mutex);
 	hold_mutex = true;
 
@@ -809,7 +808,6 @@ retry_snap:
 out:
 	if (hold_mutex)
 		mutex_unlock(&inode->i_mutex);
-	sb_end_write(inode->i_sb);
 	current->backing_dev_info = NULL;
 
 	return written ? written : err;

-- 1.8.3.rc1.44.gb387c77

Acked-by on v1 1/1
#1 lore raw
Quoted 20 lines · majianpeng

Either in vfs_write or io_submit,it call file_start/end_write. The different between file_start/end_write and sb_start/end_write is file_ only handle regular file.But i think in ceph_aio_write,it only for regular file.

---
 fs/ceph/file.c | 2 --
 1 file changed, 2 deletions(-)
fs/ceph/file.c +0 -0
index 656e169..7c69f4f 100644
@@ -716,7 +716,6 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,
        if (ceph_snap(inode) != CEPH_NOSNAP)
                return -EROFS;
 -      sb_start_write(inode->i_sb);

fs/ceph/file.c static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,

Quoted 10 lines
fs/ceph/file.c +0 -2
        mutex_lock(&inode->i_mutex);
        hold_mutex = true;
 @@ -809,7 +808,6 @@ retry_snap:
 out:
        if (hold_mutex)
                mutex_unlock(&inode->i_mutex);
-       sb_end_write(inode->i_sb);
        current->backing_dev_info = NULL;
        return written ? written : err;
-- 1.8.3.rc1.44.gb387c77

It looks that my commit 03d254edeb (ceph: apply write checks in ceph_aio_write) conflicts with
Al Viro's commit 8d71db4f08 (lift sb_start_write/sb_end_write out of ->aio_write())

#2 lore raw

Thanks everyone, pushed this to the testing branch.

sage

Quoted 41 lines · Zheng
Quoted 20 lines · majianpeng

Either in vfs_write or io_submit,it call file_start/end_write. The different between file_start/end_write and sb_start/end_write is file_ only handle regular file.But i think in ceph_aio_write,it only for regular file.

---
 fs/ceph/file.c | 2 --
 1 file changed, 2 deletions(-)
fs/ceph/file.c +0 -0
index 656e169..7c69f4f 100644
@@ -716,7 +716,6 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,
        if (ceph_snap(inode) != CEPH_NOSNAP)
                return -EROFS;
 -      sb_start_write(inode->i_sb);

fs/ceph/file.c static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,

Quoted 10 lines
fs/ceph/file.c +0 -2
        mutex_lock(&inode->i_mutex);
        hold_mutex = true;
 @@ -809,7 +808,6 @@ retry_snap:
 out:
        if (hold_mutex)
                mutex_unlock(&inode->i_mutex);
-       sb_end_write(inode->i_sb);
        current->backing_dev_info = NULL;
        return written ? written : err;
-- 1.8.3.rc1.44.gb387c77

It looks that my commit 03d254edeb (ceph: apply write checks in ceph_aio_write) conflicts with
Al Viro's commit 8d71db4f08 (lift sb_start_write/sb_end_write out of ->aio_write())