diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/llite/namei.c')
-rw-r--r-- | drivers/staging/lustre/lustre/llite/namei.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 890ac190f5fa..5a25dcd10126 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -83,7 +83,8 @@ static int ll_set_inode(struct inode *inode, void *opaque) lli->lli_fid = body->fid1; if (unlikely(!(body->valid & OBD_MD_FLTYPE))) { - CERROR("Can not initialize inode " DFID " without object type: valid = %#llx\n", + CERROR("Can not initialize inode " DFID + " without object type: valid = %#llx\n", PFID(&lli->lli_fid), body->valid); return -EINVAL; } @@ -154,7 +155,7 @@ static void ll_invalidate_negative_children(struct inode *dir) list_for_each_entry_safe(child, tmp_subdir, &dentry->d_subdirs, d_child) { - if (child->d_inode == NULL) + if (d_really_is_negative(child)) d_lustre_invalidate(child, 1); } } @@ -391,7 +392,7 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de) iput(inode); CDEBUG(D_DENTRY, "Reuse dentry %p inode %p refc %d flags %#x\n", - new, new->d_inode, d_count(new), new->d_flags); + new, d_inode(new), d_count(new), new->d_flags); return new; } } @@ -400,7 +401,7 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de) return ERR_PTR(rc); d_add(de, inode); CDEBUG(D_DENTRY, "Add dentry %p inode %p refc %d flags %#x\n", - de, de->d_inode, d_count(de), de->d_flags); + de, d_inode(de), d_count(de), de->d_flags); return de; } @@ -447,7 +448,7 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request, !it_disposition(it, DISP_OPEN_CREATE)) { /* With DISP_OPEN_CREATE dentry will instantiated in ll_create_it. */ - LASSERT((*de)->d_inode == NULL); + LASSERT(d_inode(*de) == NULL); d_instantiate(*de, inode); } @@ -540,7 +541,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, goto out; } - inode = dentry->d_inode; + inode = d_inode(dentry); if ((it->it_op & IT_OPEN) && inode && !S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode)) { @@ -600,7 +601,8 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry, long long lookup_flags = LOOKUP_OPEN; int rc = 0; - CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),file %p,open_flags %x,mode %x opened %d\n", + CDEBUG(D_VFSTRACE, + "VFS Op:name=%pd,dir=%lu/%u(%p),file %p,open_flags %x,mode %x opened %d\n", dentry, dir->i_ino, dir->i_generation, dir, file, open_flags, mode, *opened); @@ -636,9 +638,9 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry, *opened |= FILE_CREATED; } - if (dentry->d_inode && it_disposition(it, DISP_OPEN_OPEN)) { + if (d_really_is_positive(dentry) && it_disposition(it, DISP_OPEN_OPEN)) { /* Open dentry. */ - if (S_ISFIFO(dentry->d_inode->i_mode)) { + if (S_ISFIFO(d_inode(dentry)->i_mode)) { /* We cannot call open here as it would * deadlock. */ @@ -860,8 +862,8 @@ static int ll_create_nd(struct inode *dir, struct dentry *dentry, static inline void ll_get_child_fid(struct dentry *child, struct lu_fid *fid) { - if (child->d_inode) - *fid = *ll_inode2fid(child->d_inode); + if (d_really_is_positive(child)) + *fid = *ll_inode2fid(d_inode(child)); } /** @@ -974,11 +976,12 @@ out: * Instead, ll_ddelete() and ll_d_iput() will update it based upon if there * is any lock existing. They will recycle dentries and inodes based upon locks * too. b=20433 */ -static int ll_unlink(struct inode * dir, struct dentry *dentry) +static int ll_unlink(struct inode *dir, struct dentry *dentry) { struct ptlrpc_request *request = NULL; struct md_op_data *op_data; int rc; + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p)\n", dentry, dir->i_ino, dir->i_generation, dir); @@ -1033,7 +1036,7 @@ static int ll_rmdir(struct inode *dir, struct dentry *dentry) dentry, dir->i_ino, dir->i_generation, dir); op_data = ll_prep_md_op_data(NULL, dir, NULL, - dentry->d_name.name, + dentry->d_name.name, dentry->d_name.len, S_IFDIR, LUSTRE_OPC_ANY, NULL); if (IS_ERR(op_data)) @@ -1073,7 +1076,7 @@ static int ll_symlink(struct inode *dir, struct dentry *dentry, static int ll_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry) { - struct inode *src = old_dentry->d_inode; + struct inode *src = d_inode(old_dentry); struct ll_sb_info *sbi = ll_i2sbi(dir); struct ptlrpc_request *request = NULL; struct md_op_data *op_data; @@ -1111,10 +1114,9 @@ static int ll_rename(struct inode *old_dir, struct dentry *old_dentry, int err; CDEBUG(D_VFSTRACE, - "VFS Op:oldname=%pd,src_dir=%lu/%u(%p),newname=%pd," - "tgt_dir=%lu/%u(%p)\n", old_dentry, - old_dir->i_ino, old_dir->i_generation, old_dir, new_dentry, - new_dir->i_ino, new_dir->i_generation, new_dir); + "VFS Op:oldname=%pd,src_dir=%lu/%u(%p),newname=%pd,tgt_dir=%lu/%u(%p)\n", + old_dentry, old_dir->i_ino, old_dir->i_generation, old_dir, + new_dentry, new_dir->i_ino, new_dir->i_generation, new_dir); op_data = ll_prep_md_op_data(NULL, old_dir, new_dir, NULL, 0, 0, LUSTRE_OPC_ANY, NULL); |