Whamcloud - gitweb
- fix rdev stuff
authorbraam <braam>
Sat, 19 Oct 2002 19:53:09 +0000 (19:53 +0000)
committerbraam <braam>
Sat, 19 Oct 2002 19:53:09 +0000 (19:53 +0000)
- assign d_fsdata in lookup2

lustre/include/linux/obd_class.h
lustre/llite/namei.c

index c8aa556..211527d 100644 (file)
@@ -591,7 +591,7 @@ static inline void iattr_from_obdo(struct iattr *attr, struct obdo *oa,
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
 #define to_kdev_t(dev) dev
-#define to_dev_t(dev) dev
+#define kdev_t_to_nr(dev) dev
 #endif
 
 static inline void obdo_from_inode(struct obdo *dst, struct inode *src,
@@ -626,7 +626,7 @@ static inline void obdo_from_inode(struct obdo *dst, struct inode *src,
         if (valid & OBD_MD_FLGENER)
                 dst->o_generation = src->i_generation;
         if (valid & OBD_MD_FLRDEV)
-                dst->o_rdev = to_kdev_t(src->i_rdev);
+                dst->o_rdev = (__u32)kdev_t_to_nr(src->i_rdev);
 
         dst->o_valid |= (valid & ~OBD_MD_FLID);
 }
@@ -663,7 +663,7 @@ static inline void obdo_to_inode(struct inode *dst, struct obdo *src,
         if (valid & OBD_MD_FLGENER)
                 dst->i_generation = src->o_generation;
         if (valid & OBD_MD_FLRDEV)
-                dst->i_rdev = to_dev_t(src->o_rdev);
+                dst->i_rdev = to_kdev_t(src->o_rdev);
 }
 #endif
 
index ec8e005..195a749 100644 (file)
@@ -289,6 +289,10 @@ static struct dentry *ll_lookup2(struct inode *dir, struct dentry *dentry,
         ptlrpc_req_finished(request);
  negative:
         dentry->d_op = &ll_d_ops;
+        if (ll_d2d(dentry) == NULL) {
+                CERROR("allocating fsdata\n");
+                ll_set_dd(dentry);
+        }
         d_add(dentry, inode);
 
         if (it->it_status == 0) {