diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-10-20 23:35:36 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-03 15:21:18 -0500 |
commit | 59cc93ef27cd6acec0f67e5f185ff21efbcaabcb (patch) | |
tree | 53a24a8724271d93302ba026df9bd97edab6b9f2 /drivers/staging | |
parent | ea4df502dcee1d7ff394282f81c640e6a14e1997 (diff) |
kill ll_link_generic()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/lustre/lustre/llite/namei.c | 59 |
1 files changed, 27 insertions, 32 deletions
diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 572e7f7ce6a0..9ea878238b62 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -879,36 +879,6 @@ static int ll_create_nd(struct inode *dir, struct dentry *dentry, return rc; } -static int ll_link_generic(struct inode *src, struct inode *dir, - struct qstr *name, struct dentry *dchild) -{ - struct ll_sb_info *sbi = ll_i2sbi(dir); - struct ptlrpc_request *request = NULL; - struct md_op_data *op_data; - int err; - - CDEBUG(D_VFSTRACE, - "VFS Op: inode=%lu/%u(%p), dir=%lu/%u(%p), target=%.*s\n", - src->i_ino, src->i_generation, src, dir->i_ino, - dir->i_generation, dir, name->len, name->name); - - op_data = ll_prep_md_op_data(NULL, src, dir, name->name, name->len, - 0, LUSTRE_OPC_ANY, NULL); - if (IS_ERR(op_data)) - return PTR_ERR(op_data); - - err = md_link(sbi->ll_md_exp, op_data, &request); - ll_finish_md_op_data(op_data); - if (err) - goto out; - - ll_update_times(request, dir); - ll_stats_ops_tally(sbi, LPROC_LL_LINK, 1); -out: - ptlrpc_req_finished(request); - return err; -} - static inline void ll_get_child_fid(struct dentry *child, struct lu_fid *fid) { if (child->d_inode) @@ -1134,8 +1104,33 @@ 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) { - return ll_link_generic(old_dentry->d_inode, dir, &new_dentry->d_name, - new_dentry); + struct inode *src = old_dentry->d_inode; + struct ll_sb_info *sbi = ll_i2sbi(dir); + struct ptlrpc_request *request = NULL; + struct md_op_data *op_data; + int err; + + CDEBUG(D_VFSTRACE, + "VFS Op: inode=%lu/%u(%p), dir=%lu/%u(%p), target=%pd\n", + src->i_ino, src->i_generation, src, dir->i_ino, + dir->i_generation, dir, new_dentry); + + op_data = ll_prep_md_op_data(NULL, src, dir, new_dentry->d_name.name, + new_dentry->d_name.len, + 0, LUSTRE_OPC_ANY, NULL); + if (IS_ERR(op_data)) + return PTR_ERR(op_data); + + err = md_link(sbi->ll_md_exp, op_data, &request); + ll_finish_md_op_data(op_data); + if (err) + goto out; + + ll_update_times(request, dir); + ll_stats_ops_tally(sbi, LPROC_LL_LINK, 1); +out: + ptlrpc_req_finished(request); + return err; } static int ll_rename(struct inode *old_dir, struct dentry *old_dentry, |