[Ocfs2-commits] manish commits r2105 - trunk/fs/ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon Apr 4 02:17:22 CDT 2005
Author: manish
Signed-off-by: mfasheh
Date: 2005-04-04 02:17:20 -0500 (Mon, 04 Apr 2005)
New Revision: 2105
Modified:
trunk/fs/ocfs2/Makefile
trunk/fs/ocfs2/aio.c
Log:
ki_dtor won't be in the historic iocb private array in any kernel we need to
support, so remove the ugly #ifdefs and abstraction.
Signed-off-by: mfasheh
Modified: trunk/fs/ocfs2/Makefile
===================================================================
--- trunk/fs/ocfs2/Makefile 2005-04-03 19:19:13 UTC (rev 2104)
+++ trunk/fs/ocfs2/Makefile 2005-04-04 07:17:20 UTC (rev 2105)
@@ -35,10 +35,6 @@
EXTRA_CFLAGS += -DJOURNAL_ACCESS_WITH_CREDITS
endif
-ifdef KIOCB_DTOR_IN_PRIVATE
-EXTRA_CFLAGS += -DKIOCB_DTOR_IN_PRIVATE
-endif
-
ifneq ($(QUIET),1)
EXTRA_CFLAGS += -DVERBOSE_BH_JBD_TRACE
EXTRA_CFLAGS += -DVERBOSE_LOCKING_TRACE
Modified: trunk/fs/ocfs2/aio.c
===================================================================
--- trunk/fs/ocfs2/aio.c 2005-04-03 19:19:13 UTC (rev 2104)
+++ trunk/fs/ocfs2/aio.c 2005-04-04 07:17:20 UTC (rev 2105)
@@ -59,34 +59,6 @@
struct ocfs2_write_lock_info kp_info;
};
-static struct ocfs2_kiocb_private *okp_from_iocb(struct kiocb *iocb)
-{
- struct ocfs2_kiocb_private *okp;
-
-#ifndef KIOCB_DTOR_IN_PRIVATE
- okp = iocb->private;
-#else
-
- if (!kiocbIsDtorInPrivate(iocb)) {
- kiocbSetDtorInPrivate(iocb);
- iocb->ki_dip.ki_private = 0;
- }
-
- okp = (struct ocfs2_kiocb_private *)iocb->ki_dip.ki_private;
-#endif
-
- return okp;
-}
-static void okp_to_iocb(struct kiocb *iocb, struct ocfs2_kiocb_private *okp)
-{
-#ifndef KIOCB_DTOR_IN_PRIVATE
- iocb->private = okp;
-#else
- BUG_ON(!kiocbIsDtorInPrivate(iocb));
- iocb->ki_dip.ki_private = (unsigned long)okp;
-#endif
-}
-
static void okp_teardown(struct ocfs2_kiocb_private *okp)
{
BUG_ON(okp->kp_inode == NULL);
@@ -136,13 +108,9 @@
*/
static void ocfs2_ki_dtor(struct kiocb *iocb)
{
- struct ocfs2_kiocb_private *okp;
- ocfs_super *osb;
+ struct ocfs2_kiocb_private *okp = iocb->private;
unsigned long flags;
- okp = okp_from_iocb(iocb);
- osb = okp->kp_osb;
-
/* okp_alloc only assigns the iocb->private and ->ki_dtor pointers if
* it was able to alloc the okp and get an inode reference */
BUG_ON(okp == NULL);
@@ -151,13 +119,15 @@
BUG_ON(list_empty(&okp->kp_pending_item));
/* we had better not try to work with this iocb again */
- okp_to_iocb(iocb, NULL);
+ iocb->private = NULL;
if (in_interrupt()) {
/*
* there is very little in the teardown that is interrupt-safe,
* push it to keventd
*/
+ ocfs_super *osb = okp->kp_osb;
+
spin_lock_irqsave(&osb->osb_okp_teardown_lock, flags);
list_add_tail(&okp->kp_teardown_item,
&osb->osb_okp_teardown_list);
@@ -224,12 +194,8 @@
osb = OCFS2_SB(inode->i_sb);
okp->kp_osb = osb;
- okp_to_iocb(iocb, okp);
-#ifndef KIOCB_DTOR_IN_PRIVATE
+ iocb->private = okp;
iocb->ki_dtor = ocfs2_ki_dtor;
-#else
- iocb->ki_dip.ki_dtor = ocfs2_ki_dtor;
-#endif
INIT_BUFFER_LOCK_CTXT(&okp->kp_ctxt);
INIT_LIST_HEAD(&okp->kp_teardown_item);
@@ -258,13 +224,12 @@
ssize_t ocfs2_file_aio_read(struct kiocb *iocb, char *buf, size_t count,
loff_t pos)
{
- struct ocfs2_kiocb_private *okp;
+ struct ocfs2_kiocb_private *okp = iocb->private;
struct file *filp = iocb->ki_filp;
struct inode *inode = filp->f_dentry->d_inode;
ocfs2_backing_inode *target_binode;
ssize_t ret;
- okp = okp_from_iocb(iocb);
if (okp == NULL) {
okp = okp_alloc(iocb);
if (IS_ERR(okp)) {
@@ -313,14 +278,13 @@
ssize_t ocfs2_file_aio_write(struct kiocb *iocb, const char *buf,
size_t count, loff_t pos)
{
- struct ocfs2_kiocb_private *okp;
+ struct ocfs2_kiocb_private *okp = iocb->private;
struct file *filp = iocb->ki_filp;
struct inode *inode = filp->f_dentry->d_inode;
ssize_t ret = 0;
struct iovec local_iov = { .iov_base = (void *)buf,
.iov_len = count };
- okp = okp_from_iocb(iocb);
if (okp == NULL) {
okp = okp_alloc(iocb);
if (IS_ERR(okp)) {
More information about the Ocfs2-commits
mailing list