Skip to content

Commit

Permalink
[PATCH] ocfs2: remove unused code
Browse files Browse the repository at this point in the history
Remove some #ifdef'd out code which was inadvertantly introduced in our
initial merge.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
  • Loading branch information
Mark Fasheh committed Mar 1, 2006
1 parent d3178bc commit d267a56
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 53 deletions.
51 changes: 1 addition & 50 deletions fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand Down
3 changes: 0 additions & 3 deletions fs/ocfs2/ocfs2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d267a56

Please sign in to comment.