return (key0 << 1);
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+static int ll_nfs_test_inode(struct inode *inode, unsigned long ino,
+ void *opaque)
+#else
+static int ll_nfs_test_inode(struct inode *inode, void *opaque)
+#endif
+{
+ struct lustre_id *iid = opaque;
+
+ if (inode->i_ino == id_ino(iid) &&
+ inode->i_generation == id_gen(iid))
+ return 1;
+
+ return 0;
+}
static struct inode * search_inode_for_lustre(struct super_block *sb,
unsigned long ino,
unsigned long generation,
{
struct ptlrpc_request *req = NULL;
struct ll_sb_info *sbi = ll_s2sbi(sb);
- struct ll_fid fid;
- unsigned long valid = 0;
+ struct lustre_id id;
+ __u64 valid = 0;
int eadatalen = 0, rc;
struct inode *inode = NULL;
-
- inode = ILOOKUP(sb, ino, NULL, NULL);
+ struct lustre_id iid;
+
+ id_ino(&iid) = (__u64)ino;
+ id_gen(&iid) = generation;
+ inode = ILOOKUP(sb, ino, ll_nfs_test_inode, &iid);
if (inode)
return inode;
if (S_ISREG(mode)) {
- eadatalen = obd_size_diskmd(sbi->ll_osc_exp, NULL);
+ eadatalen = obd_size_diskmd(sbi->ll_dt_exp, NULL);
valid |= OBD_MD_FLEASIZE;
}
- fid.id = (__u64)ino;
- fid.generation = generation;
- fid.f_type = mode;
+ id_type(&id) = mode;
+ id_ino(&id) = (__u64)ino;
+ id_gen(&id) = generation;
- rc = md_getattr(sbi->ll_mdc_exp, &fid, valid, eadatalen, &req);
+ rc = md_getattr(sbi->ll_md_exp, &id, valid, NULL, NULL, 0,
+ eadatalen, NULL, &req);
if (rc) {
CERROR("failure %d inode %lu\n", rc, ino);
return ERR_PTR(rc);
}
- rc = ll_prep_inode(sbi->ll_osc_exp, sbi->ll_mdc_exp,
+ rc = ll_prep_inode(sbi->ll_dt_exp, sbi->ll_md_exp,
&inode, req, 0, sb);
if (rc) {
ptlrpc_req_finished(req);
static struct dentry *ll_iget_for_nfs(struct super_block *sb, unsigned long ino,
__u32 generation, umode_t mode)
-{
- struct inode *inode;
+{
+ struct inode *inode;
struct dentry *result;
struct list_head *lp;
if (IS_ERR(inode)) {
return ERR_PTR(PTR_ERR(inode));
}
- if (is_bad_inode(inode)
- || (generation && inode->i_generation != generation)
- ){
+ if (is_bad_inode(inode) ||
+ (generation && inode->i_generation != generation)){
/* we didn't find the right inode.. */
- CERROR(" Inode %lu, Bad count: %lu %d or version %u %u\n",
- inode->i_ino,
- (unsigned long)inode->i_nlink,
- atomic_read(&inode->i_count),
- inode->i_generation,
- generation);
+ CERROR(" Inode %lu, Bad count: %lu %d or version %u %u\n",
+ inode->i_ino, (unsigned long)inode->i_nlink,
+ atomic_read(&inode->i_count), inode->i_generation,
+ generation);
iput(inode);
return ERR_PTR(-ESTALE);
}
-
+
/* now to find a dentry.
* If possible, get a well-connected one
*/
result = list_entry(lp,struct dentry, d_alias);
if (!(result->d_flags & DCACHE_DISCONNECTED)) {
dget_locked(result);
- result->d_vfs_flags |= DCACHE_REFERENCED;
+ ll_set_dflags(result, DCACHE_REFERENCED);
spin_unlock(&dcache_lock);
iput(inode);
return result;