AUTOMAKE_OPTIONS = foreign
# NOTE: keep extN before mds
-SUBDIRS = lov utils obdclass ldlm ptlrpc llite lib obdecho mdc osc
-SUBDIRS+= extN mds ost tests obdfilter doc scripts
+SUBDIRS = lov utils obdclass ldlm ptlrpc lib obdecho mdc osc ost llite
+SUBDIRS+= extN mds tests obdfilter doc scripts
DIST_SUBDIRS = $(SUBDIRS)
EXTRA_DIST = BUGS FDL Rules include patches archdep.m4
int ll_unlock(__u32 mode, struct lustre_handle *lockh);
/* dcache.c */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
-void ll_intent_release(struct nameidata *);
-#else
void ll_intent_release(struct dentry *, struct lookup_intent *);
-#endif
int ll_set_dd(struct dentry *de);
/****
EXTRA_PROGRAMS = llite
llite_SOURCES = dcache.c commit_callback.c super.c rw.c super25.c
-llite_SOURCES += file.c dir.c sysctl.c namei.c symlink.c
-llite_SOURCES += lov_pack.c recover.c
+llite_SOURCES += file.c dir.c sysctl.c symlink.c
+llite_SOURCES += lov_pack.c recover.c namei.c
lov_pack.c:
test -e lov_pack.c || ln -sf $(top_srcdir)/lib/lov_pack.c .
EXIT;
}
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
void ll_intent_release(struct dentry *de, struct lookup_intent *it)
{
struct lustre_handle *handle;
//up(&ll_d2d(de)->lld_it_sem);
EXIT;
}
-#endif
int ll_revalidate2(struct dentry *de, int flags, struct lookup_intent *it)
{
}
ldlm_lock_dump((void *)(unsigned long)lockh.addr);
- if (Page_Uptodate(page)) {
+ if (PageUptodate(page)) {
CERROR("Explain this please?\n");
GOTO(readpage_out, rc);
}
prepare_write: ll_dir_prepare_write
};
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
int waitfor_one_page(struct page *page)
{
int error = 0;
} while ((bh = bh->b_this_page) != head);
return error;
}
+#else
+int waitfor_one_page(struct page *page)
+{
+ wait_on_page_locked(page);
+ return 0;
+}
+#endif
/*
* ext2 uses block-sized chunks. Arguably, sector-sized ones would be
if (!IS_ERR(page)) {
wait_on_page(page);
kmap(page);
- if (!Page_Uptodate(page))
+ if (!PageUptodate(page))
goto fail;
if (!PageChecked(page))
ext2_check_page(page);
return 0;
}
+
+
static int ll_inode_revalidate(struct dentry *dentry)
{
struct inode *inode = dentry->d_inode;
RETURN(ll_file_size(inode, lsm));
}
+static int ll_getattr(struct vfsmount *mnt, struct dentry *de,
+ struct kstat *stat)
+{
+ return ll_inode_revalidate(de);
+}
+
struct file_operations ll_file_operations = {
read: ll_file_read,
write: ll_file_write,
struct inode_operations ll_file_inode_operations = {
truncate: ll_truncate,
setattr: ll_setattr,
- revalidate: ll_inode_revalidate
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+ getattr: ll_getattr,
+#else
+ revalidate: ll_inode_revalidate,
+#endif
};
}
/* methods */
-static int ll_find_inode(struct inode *inode, unsigned long ino, void *opaque)
+static int ll_test_inode(struct inode *inode, void *opaque)
{
struct ll_read_inode2_cookie *lic = opaque;
struct mds_body *body = lic->lic_body;
RETURN(0);
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
+extern int ll_read_inode2(struct inode *inode, void *opaque);
+struct inode *ll_iget(struct super_block *sb, ino_t hash,
+ struct ll_read_inode2_cookie *lic)
+{
+ struct inode *inode;
+
+ inode = iget5_locked(sb, hash, ll_test_inode, ll_read_inode2, lic);
+
+ if (!inode)
+ return ERR_PTR(-ENOMEM);
+
+ if (inode->i_state & I_NEW) {
+
+ unlock_new_inode(inode);
+ }
+
+ // XXX Coda always fills inodes, should Lustre?
+ return inode;
+}
+#else
+struct inode *ll_iget(struct super_block *sb, inot_t hash,
+ struct ll_read_inode2_cookie *lic)
+{
+ struct inode *inode;
+ inode = iget4(sb, hash, ll_find_inode, lic);
+ return inode;
+}
+#endif
+
static struct dentry *ll_lookup2(struct inode *dir, struct dentry *dentry,
struct lookup_intent *it)
{
/* No rpc's happen during iget4, -ENOMEM's are possible */
LASSERT(ino != 0);
- inode = iget4(dir->i_sb, ino, ll_find_inode, &lic);
-
+ inode = ll_iget(dir->i_sb, ino, &lic);
if (!inode) {
ptlrpc_free_req(request);
ll_intent_release(dentry, it);
lic.lic_body = body;
LASSERT(body->ino != 0);
- inode = iget4(dir->i_sb, body->ino, ll_find_inode, &lic);
+ inode = ll_iget(dir->i_sb, body->ino, &lic);
if (IS_ERR(inode)) {
int rc = PTR_ERR(inode);
CERROR("new_inode -fatal: rc %d\n", rc);
extern int ll_recover(struct recovd_data *, int);
extern int ll_commitcbd_setup(struct ll_sb_info *);
extern int ll_commitcbd_cleanup(struct ll_sb_info *);
-static int ll_read_inode2(struct inode *inode, void *opaque);
+int ll_read_inode2(struct inode *inode, void *opaque);
static char *ll_read_opt(const char *opt, char *data)
{
inode->i_size = body->size;
}
-static int ll_read_inode2(struct inode *inode, void *opaque)
+int ll_read_inode2(struct inode *inode, void *opaque)
{
struct ll_read_inode2_cookie *lic = opaque;
struct mds_body *body = lic->lic_body;