Commit d267a56c authored by Mark Fasheh's avatar Mark Fasheh

[PATCH] ocfs2: remove unused code

Remove some #ifdef'd out code which was inadvertantly introduced in our
initial merge.
Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent d3178bcd
...@@ -933,9 +933,6 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, ...@@ -933,9 +933,6 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
struct file *filp = iocb->ki_filp; struct file *filp = iocb->ki_filp;
struct inode *inode = filp->f_dentry->d_inode; struct inode *inode = filp->f_dentry->d_inode;
loff_t newsize, saved_pos; 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, mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
(unsigned int)count, (unsigned int)count,
...@@ -951,14 +948,6 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, ...@@ -951,14 +948,6 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
return -EIO; 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); mutex_lock(&inode->i_mutex);
/* to match setattr's i_mutex -> i_alloc_sem -> rw_lock ordering */ /* to match setattr's i_mutex -> i_alloc_sem -> rw_lock ordering */
if (filp->f_flags & O_DIRECT) { if (filp->f_flags & O_DIRECT) {
...@@ -1079,27 +1068,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, ...@@ -1079,27 +1068,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
/* communicate with ocfs2_dio_end_io */ /* communicate with ocfs2_dio_end_io */
ocfs2_iocb_set_rw_locked(iocb); ocfs2_iocb_set_rw_locked(iocb);
#ifdef OCFS2_ORACORE_WORKAROUNDS ret = generic_file_aio_write_nolock(iocb, &local_iov, 1, &iocb->ki_pos);
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);
/* buffered aio wouldn't have proper lock coverage today */ /* buffered aio wouldn't have proper lock coverage today */
BUG_ON(ret == -EIOCBQUEUED && !(filp->f_flags & O_DIRECT)); BUG_ON(ret == -EIOCBQUEUED && !(filp->f_flags & O_DIRECT));
...@@ -1140,9 +1109,6 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, ...@@ -1140,9 +1109,6 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
int ret = 0, rw_level = -1, have_alloc_sem = 0; int ret = 0, rw_level = -1, have_alloc_sem = 0;
struct file *filp = iocb->ki_filp; struct file *filp = iocb->ki_filp;
struct inode *inode = filp->f_dentry->d_inode; 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, mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
(unsigned int)count, (unsigned int)count,
...@@ -1155,21 +1121,6 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, ...@@ -1155,21 +1121,6 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
goto bail; 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 * buffered reads protect themselves in ->readpage(). O_DIRECT reads
* need locks to protect pending reads from racing with truncate. * need locks to protect pending reads from racing with truncate.
......
...@@ -174,9 +174,6 @@ enum ocfs2_mount_options ...@@ -174,9 +174,6 @@ enum ocfs2_mount_options
OCFS2_MOUNT_NOINTR = 1 << 2, /* Don't catch signals */ OCFS2_MOUNT_NOINTR = 1 << 2, /* Don't catch signals */
OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */ OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */
OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */ 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 #define OCFS2_OSB_SOFT_RO 0x0001
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment