[PATCH] ocfs2: remove unused code
authorMark Fasheh <mark.fasheh@oracle.com>
Thu, 23 Feb 2006 21:23:39 +0000 (13:23 -0800)
committerMark Fasheh <mark.fasheh@oracle.com>
Wed, 1 Mar 2006 19:18:22 +0000 (11:18 -0800)
Remove some #ifdef'd out code which was inadvertantly introduced in our
initial merge.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/file.c
fs/ocfs2/ocfs2.h

index 1715bc90e705eb36e3e0e56577265bb3053b38c6..8a4048b55fdc41d5dda4dc5e8b9908e4a765cc64 100644 (file)
@@ -933,9 +933,6 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
        struct file *filp = iocb->ki_filp;
        struct inode *inode = filp->f_dentry->d_inode;
        loff_t newsize, saved_pos;
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
-#endif
 
        mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
                   (unsigned int)count,
@@ -951,14 +948,6 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
                return -EIO;
        }
 
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       /* ugh, work around some applications which open everything O_DIRECT +
-        * O_APPEND and really don't mean to use O_DIRECT. */
-       if (osb->s_mount_opt & OCFS2_MOUNT_COMPAT_OCFS &&
-           (filp->f_flags & O_APPEND) && (filp->f_flags & O_DIRECT)) 
-               filp->f_flags &= ~O_DIRECT;
-#endif
-
        mutex_lock(&inode->i_mutex);
        /* to match setattr's i_mutex -> i_alloc_sem -> rw_lock ordering */
        if (filp->f_flags & O_DIRECT) {
@@ -1079,27 +1068,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
        /* communicate with ocfs2_dio_end_io */
        ocfs2_iocb_set_rw_locked(iocb);
 
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       if (osb->s_mount_opt & OCFS2_MOUNT_COMPAT_OCFS &&
-           filp->f_flags & O_DIRECT) {
-               unsigned int saved_flags = filp->f_flags;
-               int sector_size = 1 << osb->s_sectsize_bits;
-
-               if ((saved_pos & (sector_size - 1)) ||
-                   (count & (sector_size - 1)) ||
-                   ((unsigned long)buf & (sector_size - 1))) {
-                       filp->f_flags |= O_SYNC;
-                       filp->f_flags &= ~O_DIRECT;
-               }
-
-               ret = generic_file_aio_write_nolock(iocb, &local_iov, 1,
-                                                   &iocb->ki_pos);
-
-               filp->f_flags = saved_flags;
-       } else
-#endif
-               ret = generic_file_aio_write_nolock(iocb, &local_iov, 1,
-                                                   &iocb->ki_pos);
+       ret = generic_file_aio_write_nolock(iocb, &local_iov, 1, &iocb->ki_pos);
 
        /* buffered aio wouldn't have proper lock coverage today */
        BUG_ON(ret == -EIOCBQUEUED && !(filp->f_flags & O_DIRECT));
@@ -1140,9 +1109,6 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
        int ret = 0, rw_level = -1, have_alloc_sem = 0;
        struct file *filp = iocb->ki_filp;
        struct inode *inode = filp->f_dentry->d_inode;
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
-#endif
 
        mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
                   (unsigned int)count,
@@ -1155,21 +1121,6 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
                goto bail;
        }
 
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       if (osb->s_mount_opt & OCFS2_MOUNT_COMPAT_OCFS) {
-               if (filp->f_flags & O_DIRECT) {
-                       int sector_size = 1 << osb->s_sectsize_bits;
-
-                       if ((pos & (sector_size - 1)) ||
-                           (count & (sector_size - 1)) ||
-                           ((unsigned long)buf & (sector_size - 1)) ||
-                           (i_size_read(inode) & (sector_size -1))) {
-                               filp->f_flags &= ~O_DIRECT;
-                       }
-               }
-       }
-#endif
-
        /* 
         * buffered reads protect themselves in ->readpage().  O_DIRECT reads
         * need locks to protect pending reads from racing with truncate.
index 8d8e4779df92ba7ffe84f293d17cddb9b7afb6f3..19360e3d842eefd7dac33a3317857079540fd39a 100644 (file)
@@ -174,9 +174,6 @@ enum ocfs2_mount_options
        OCFS2_MOUNT_NOINTR  = 1 << 2,   /* Don't catch signals */
        OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */
        OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       OCFS2_MOUNT_COMPAT_OCFS = 1 << 30, /* ocfs1 compatibility mode */
-#endif
 };
 
 #define OCFS2_OSB_SOFT_RO      0x0001