LIST_HEAD(ll_super_blocks);
struct rw_semaphore ll_sb_sem;
+#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) 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 ll_direct_IO(rw, kiocb->ki_filp, iov, file_offset, nr_segs, 1);
}
-#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)
RETURN(-ENOMEM);
*pagep = page;
-
+
rc = ll_prepare_write(file, page, from, from + len);
if (rc) {
unlock_page(page);
}
#endif
+#ifndef MS_HAS_NEW_AOPS
struct address_space_operations ll_aops = {
.readpage = ll_readpage,
// .readpages = ll_readpages,
.releasepage = ll_releasepage,
.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_26,
+ .orig_aops.writepages = generic_writepages,
+ .orig_aops.set_page_dirty = __set_page_dirty_nobuffers,
+ .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,
+ .orig_aops.bmap = NULL,
+ .write_begin = ll_write_begin,
+ .write_end = ll_write_end
+};
+#endif