#define DEBUG_SUBSYSTEM S_LLITE
#include <linux/module.h>
+#include <linux/types.h>
#include <linux/random.h>
#include <linux/version.h>
extern struct address_space_operations ll_aops;
extern struct address_space_operations ll_dir_aops;
-extern struct super_operations ll_super_operations;
#ifndef log2
#define log2(n) ffz(~(n))
GOTO(out_root, err);
}
+ /* making vm readahead 0 for 2.4.x. In the case of 2.6.x,
+ backing dev info assigned to inode mapping is used for
+ determining maximal readahead. */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
+ /* bug 2805 - set VM readahead to zero */
+ vm_max_readahead = vm_min_readahead = 0;
+#endif
+
sb->s_root = d_alloc_root(root);
RETURN(err);
RETURN(err);
} /* ll_read_super */
-void ll_put_super(struct super_block *sb)
-{
- ENTRY;
-
- CDEBUG(D_VFSTRACE, "VFS Op: sb %p\n", sb);
-
- lustre_common_put_super(sb);
-
- lustre_free_sbi(sb);
-
- EXIT;
-} /* ll_put_super */
-
int lustre_process_log(struct lustre_mount_data *lmd, char * profile,
struct config_llog_instance *cfg, int allow_recov)
{
int err;
ENTRY;
+ if (lmd_bad_magic(lmd))
+ RETURN(-EINVAL);
+
generate_random_uuid(uuid);
class_uuid_unparse(uuid, &mdc_uuid);
PCFG_INIT(pcfg, NAL_CMD_REGISTER_MYNID);
pcfg.pcfg_nal = lmd->lmd_nal;
pcfg.pcfg_nid = lmd->lmd_local_nid;
- err = kportal_nal_cmd(&pcfg);
+ err = libcfs_nal_cmd(&pcfg);
if (err <0)
GOTO(out, err);
}
pcfg.pcfg_misc = lmd->lmd_port;
pcfg.pcfg_size = 8388608;
pcfg.pcfg_flags = 0x4; /*share*/
- err = kportal_nal_cmd(&pcfg);
+ err = libcfs_nal_cmd(&pcfg);
if (err <0)
GOTO(out, err);
}
exp = class_conn2export(&mdc_conn);
ctxt = llog_get_context(exp->exp_obd, LLOG_CONFIG_REPL_CTXT);
+#if 1
rc = class_config_parse_llog(ctxt, profile, cfg);
+#else
+ /*
+ * For debugging, it's useful to just dump the log
+ */
+ rc = class_config_dump_llog(ctxt, profile, cfg);
+#endif
if (rc) {
CERROR("class_config_parse_llog failed: rc = %d\n", rc);
}
pcfg.pcfg_nid = lmd->lmd_server_nid;
pcfg.pcfg_id = lmd->lmd_server_ipaddr;
pcfg.pcfg_flags = 1; /*share*/
- err = kportal_nal_cmd(&pcfg);
+ err = libcfs_nal_cmd(&pcfg);
if (err <0)
GOTO(out, err);
}
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op: sb %p\n", sb);
+ if (lmd_bad_magic(lmd))
+ RETURN(-EINVAL);
+
sbi = lustre_init_sbi(sb);
if (!sbi)
RETURN(-ENOMEM);
(rc=ll_permission(inode,MAY_WRITE,NULL))!=0)
RETURN(rc);
} else {
- /* from inode_change_ok() */
- if (current->fsuid != inode->i_uid &&
- !capable(CAP_FOWNER))
- RETURN(-EPERM);
+ /* from inode_change_ok() */
+ if (current->fsuid != inode->i_uid &&
+ !capable(CAP_FOWNER))
+ RETURN(-EPERM);
}
}
LBUG();
}
}
+ /* bug 2844 - limit i_blksize for broken user-space apps */
+ LASSERTF(lsm->lsm_xfersize != 0, "%lu\n", lsm->lsm_xfersize);
+ inode->i_blksize = min(lsm->lsm_xfersize, LL_MAX_BLKSIZE);
if (lli->lli_smd != lsm)
obd_free_memmd(ll_i2obdexp(inode), &lsm);
}
set_bit(LLI_F_HAVE_MDS_SIZE_LOCK, &lli->lli_flags);
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
+static struct backing_dev_info ll_backing_dev_info = {
+ .ra_pages = 0, /* No readahead */
+ .memory_backed = 0, /* Does contribute to dirty memory */
+};
+#endif
+
void ll_read_inode2(struct inode *inode, void *opaque)
{
struct lustre_md *md = opaque;
EXIT;
} else {
inode->i_op = &ll_special_inode_operations;
+
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
init_special_inode(inode, inode->i_mode,
kdev_t_to_nr(inode->i_rdev));
+
+ /* initializing backing dev info. */
+ inode->i_mapping->backing_dev_info = &ll_backing_dev_info;
#else
init_special_inode(inode, inode->i_mode, inode->i_rdev);
#endif
+ lli->ll_save_ifop = inode->i_fop;
+
+ if (S_ISCHR(inode->i_mode))
+ inode->i_fop = &ll_special_chr_inode_fops;
+ else if (S_ISBLK(inode->i_mode))
+ inode->i_fop = &ll_special_blk_inode_fops;
+ else if (S_ISFIFO(inode->i_mode))
+ inode->i_fop = &ll_special_fifo_inode_fops;
+ else if (S_ISSOCK(inode->i_mode))
+ inode->i_fop = &ll_special_sock_inode_fops;
+
+ CWARN("saved %p, replaced with %p\n", lli->ll_save_ifop,
+ inode->i_fop);
+
+ if (lli->ll_save_ifop->owner) {
+ CWARN("%p has owner %p\n", lli->ll_save_ifop,
+ lli->ll_save_ifop->owner);
+ }
EXIT;
}
}