return rc;
}
+#ifndef MS_HAS_NEW_AOPS
struct address_space_operations ll_dir_aops = {
.readpage = ll_dir_readpage,
};
+#else
+struct address_space_operations_ext ll_dir_aops = {
+ .orig_aops.readpage = ll_dir_readpage,
+};
+#endif
static void ll_check_page(struct inode *dir, struct page *page)
{
CFS_LIST_HEAD(ll_super_blocks);
cfs_spinlock_t ll_sb_lock = CFS_SPIN_LOCK_UNLOCKED;
+#ifndef MS_HAS_NEW_AOPS
extern struct address_space_operations ll_aops;
extern struct address_space_operations ll_dir_aops;
+#else
+extern struct address_space_operations_ext ll_aops;
+extern struct address_space_operations_ext ll_dir_aops;
+#endif
#ifndef log2
#define log2(n) cfs_ffz(~(n))
/* force vfs to use lustre handler for flock() calls - bug 10743 */
sb->s_flags |= MS_FLOCK_LOCK;
#endif
+#ifdef MS_HAS_NEW_AOPS
+ sb->s_flags |= MS_HAS_NEW_AOPS;
+#endif
if (sbi->ll_flags & LL_SBI_FLOCK)
sbi->ll_fop = &ll_file_operations_flock;
struct ll_sb_info *sbi = ll_i2sbi(inode);
inode->i_op = &ll_file_inode_operations;
inode->i_fop = sbi->ll_fop;
- inode->i_mapping->a_ops = &ll_aops;
+ inode->i_mapping->a_ops = (struct address_space_operations *)&ll_aops;
EXIT;
} else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &ll_dir_inode_operations;
inode->i_fop = &ll_dir_operations;
- inode->i_mapping->a_ops = &ll_dir_aops;
+ inode->i_mapping->a_ops = (struct address_space_operations *)&ll_dir_aops;
EXIT;
} else if (S_ISLNK(inode->i_mode)) {
inode->i_op = &ll_fast_symlink_inode_operations;
RETURN(tot_bytes ? : result);
}
-#ifdef HAVE_KERNEL_WRITE_BEGIN_END
+#if defined(HAVE_KERNEL_WRITE_BEGIN_END) || defined(MS_HAS_NEW_AOPS)
static int ll_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
}
#endif
+#ifndef MS_HAS_NEW_AOPS
struct address_space_operations ll_aops = {
.readpage = ll_readpage,
// .readpages = ll_readpages,
#endif
.bmap = NULL
};
+#else
+struct address_space_operations_ext ll_aops = {
+ .orig_aops.readpage = ll_readpage,
+// .orig_aops.readpages = ll_readpages,
+ .orig_aops.direct_IO = ll_direct_IO_26,
+ .orig_aops.writepage = ll_writepage,
+ .orig_aops.writepages = generic_writepages,
+ .orig_aops.set_page_dirty = ll_set_page_dirty,
+ .orig_aops.sync_page = NULL,
+ .orig_aops.prepare_write = ll_prepare_write,
+ .orig_aops.commit_write = ll_commit_write,
+ .orig_aops.invalidatepage = ll_invalidatepage,
+ .orig_aops.releasepage = ll_releasepage,
+#ifdef CONFIG_MIGRATION
+ .orig_aops.migratepage = ll_migratepage,
+#endif
+ .orig_aops.bmap = NULL,
+ .write_begin = ll_write_begin,
+ .write_end = ll_write_end
+};
+#endif