])
#
+# 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
+# see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
+#
+AC_DEFUN([LC_SUPEROPS_USE_DENTRY],
+[AC_MSG_CHECKING([if super_operations use dentry as parameter])
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ int show_options(struct seq_file *seq, struct dentry *root){
+ return 0;
+ }
+],[
+ struct super_operations ops;
+ ops.show_options = show_options;
+],[
+ AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
+ [super_operations use dentry as parameter])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+])
+
+#
+# 3.3 switchs inode_operations to use umode_t as parameter (but not int)
+# see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
+#
+AC_DEFUN([LC_INODEOPS_USE_UMODE_T],
+[AC_MSG_CHECKING([if inode_operations use umode_t as parameter])
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ #include <linux/types.h>
+ int my_mknod(struct inode *dir, struct dentry *dchild,
+ umode_t mode, dev_t dev)
+ {
+ return 0;
+ }
+],[
+ struct inode_operations ops;
+ ops.mknod = my_mknod;
+],[
+ AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
+ [inode_operations use umode_t as parameter])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+])
+
+#
# LC_PROG_LINUX
#
# Lustre linux kernel checks
# 3.3
LC_HAVE_MIGRATE_HEADER
LC_MIGRATEPAGE_4ARGS
+ LC_SUPEROPS_USE_DENTRY
+ LC_INODEOPS_USE_UMODE_T
#
if test x$enable_server = xyes ; then
}
#endif
+#ifdef HAVE_INODEOPS_USE_UMODE_T
+# define ll_umode_t umode_t
+#else
+# define ll_umode_t int
+#endif
+
#endif /* _COMPAT25_H */
void ll_umount_begin(struct super_block *sb);
#endif
int ll_remount_fs(struct super_block *sb, int *flags, char *data);
+#ifdef HAVE_SUPEROPS_USE_DENTRY
+int ll_show_options(struct seq_file *seq, struct dentry *dentry);
+#else
int ll_show_options(struct seq_file *seq, struct vfsmount *vfs);
+#endif
void ll_dirty_page_discard_warn(cfs_page_t *page, int ioret);
int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
- struct super_block *);
+ struct super_block *);
void lustre_dump_dentry(struct dentry *, int recur);
void lustre_dump_inode(struct inode *);
int ll_obd_statfs(struct inode *inode, void *arg);
OBD_FREE_PTR(op_data);
}
+#ifdef HAVE_SUPEROPS_USE_DENTRY
+int ll_show_options(struct seq_file *seq, struct dentry *dentry)
+#else
int ll_show_options(struct seq_file *seq, struct vfsmount *vfs)
+#endif
{
struct ll_sb_info *sbi;
- LASSERT((seq != NULL) && (vfs != NULL));
- sbi = ll_s2sbi(vfs->mnt_sb);
+#ifdef HAVE_SUPEROPS_USE_DENTRY
+ LASSERT((seq != NULL) && (dentry != NULL));
+ sbi = ll_s2sbi(dentry->d_sb);
+#else
+ LASSERT((seq != NULL) && (vfs != NULL));
+ sbi = ll_s2sbi(vfs->mnt_sb);
+#endif
if (sbi->ll_flags & LL_SBI_NOLCK)
seq_puts(seq, ",nolock");
}
static int ll_create_nd(struct inode *dir, struct dentry *dentry,
- int mode, struct nameidata *nd)
+ ll_umode_t mode, struct nameidata *nd)
{
struct lookup_intent *it = ll_d2d(dentry)->lld_it;
int rc;
RETURN(err);
}
-static int ll_mknod(struct inode *dir, struct dentry *dchild, int mode,
+static int ll_mknod(struct inode *dir, struct dentry *dchild, ll_umode_t mode,
dev_t rdev)
{
return ll_mknod_generic(dir, &dchild->d_name, mode,
{
return ll_unlink_generic(dir, NULL, dentry, &dentry->d_name);
}
-static int ll_mkdir(struct inode *dir, struct dentry *dentry, int mode)
+
+static int ll_mkdir(struct inode *dir, struct dentry *dentry, ll_umode_t mode)
{
return ll_mkdir_generic(dir, &dentry->d_name, mode, dentry);
}
+
static int ll_rmdir(struct inode *dir, struct dentry *dentry)
{
return ll_rmdir_generic(dir, NULL, dentry, &dentry->d_name);
}
+
static int ll_symlink(struct inode *dir, struct dentry *dentry,
const char *oldname)
{
return ll_symlink_generic(dir, &dentry->d_name, oldname, dentry);
}
+
static int ll_link(struct dentry *old_dentry, struct inode *dir,
struct dentry *new_dentry)
{
return ll_link_generic(old_dentry->d_inode, dir, &new_dentry->d_name,
new_dentry);
}
+
static int ll_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
{