[PATCH] ocfs2: remove unused code

Remove some #ifdef'd out code which was inadvertantly introduced in our
initial merge.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
This commit is contained in:
Mark Fasheh 2006-02-23 13:23:39 -08:00
parent d3178bcdd4
commit d267a56c88
2 changed files with 1 additions and 53 deletions

View 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.

View 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