Skip to contentSkip to conversation

Remove unecessary ocfs2_iocb_clear_sem_locked

PATCH New Goldwyn Rodrigues 2 participants 2 messages Jan 9, 2013 – Jan 10, 2013 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove unecessary ocfs2_iocb_clear_sem_locked

Since 2dfd06036ba7ae8e7be2daf5a2fff1dac42390bf, the private field of kiocb is initialized in init_sync_kiocb(). This obviates the need to clear the OCFS2_IOCB_SEM bits. This will save a few cycles/flushes.

---

fs/ocfs2/file.c +0 -4
index 37d313e..2946c3e 100644
@@ -2254,8 +2254,6 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
 
 	mutex_lock(&inode->i_mutex);
 
-	ocfs2_iocb_clear_sem_locked(iocb);
-
 relock:
 	/* to match setattr's i_mutex -> rw_lock ordering */
 	if (direct_io) {
@@ -2560,8 +2558,6 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
 		goto bail;
 	}
 
-	ocfs2_iocb_clear_sem_locked(iocb);
-
 	/*
 	 * buffered reads protect themselves in ->readpage().  O_DIRECT reads
 	 * need locks to protect pending reads from racing with truncate.
#1 lore raw

PATCH 1/1 Remove unecessary ocfs2_iocb_clear_sem_locked

Quoted 5 lines · Goldwyn Rodrigues

Since 2dfd06036ba7ae8e7be2daf5a2fff1dac42390bf, the private field of kiocb is initialized in init_sync_kiocb(). This obviates the need to clear the OCFS2_IOCB_SEM bits. This will save a few cycles/flushes.

Fine to me.

Thanks,
Junxiao

Quoted 24 lines

---

fs/ocfs2/file.c +0 -4
index 37d313e..2946c3e 100644
@@ -2254,8 +2254,6 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
 
 	mutex_lock(&inode->i_mutex);
 
-	ocfs2_iocb_clear_sem_locked(iocb);
-
 relock:
 	/* to match setattr's i_mutex -> rw_lock ordering */
 	if (direct_io) {
@@ -2560,8 +2558,6 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
 		goto bail;
 	}
 
-	ocfs2_iocb_clear_sem_locked(iocb);
-
 	/*
 	 * buffered reads protect themselves in ->readpage().  O_DIRECT reads
 	 * need locks to protect pending reads from racing with truncate.