From aac97c8014121b6fce8aca3833ed44052e4a0640 Mon Sep 17 00:00:00 2001 From: braam Date: Sat, 19 Oct 2002 19:53:09 +0000 Subject: [PATCH] - fix rdev stuff - assign d_fsdata in lookup2 --- lustre/include/linux/obd_class.h | 6 +++--- lustre/llite/namei.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index c8aa556..211527d 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -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 diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index ec8e005..195a749 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -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) { -- 1.8.3.1