diff options
| -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, | |||
| 879 | return rc; | 879 | return rc; |
| 880 | } | 880 | } |
| 881 | 881 | ||
| 882 | static int ll_link_generic(struct inode *src, struct inode *dir, | ||
| 883 | struct qstr *name, struct dentry *dchild) | ||
| 884 | { | ||
| 885 | struct ll_sb_info *sbi = ll_i2sbi(dir); | ||
| 886 | struct ptlrpc_request *request = NULL; | ||
| 887 | struct md_op_data *op_data; | ||
| 888 | int err; | ||
| 889 | |||
| 890 | CDEBUG(D_VFSTRACE, | ||
| 891 | "VFS Op: inode=%lu/%u(%p), dir=%lu/%u(%p), target=%.*s\n", | ||
| 892 | src->i_ino, src->i_generation, src, dir->i_ino, | ||
| 893 | dir->i_generation, dir, name->len, name->name); | ||
| 894 | |||
| 895 | op_data = ll_prep_md_op_data(NULL, src, dir, name->name, name->len, | ||
| 896 | 0, LUSTRE_OPC_ANY, NULL); | ||
| 897 | if (IS_ERR(op_data)) | ||
| 898 | return PTR_ERR(op_data); | ||
| 899 | |||
| 900 | err = md_link(sbi->ll_md_exp, op_data, &request); | ||
| 901 | ll_finish_md_op_data(op_data); | ||
| 902 | if (err) | ||
| 903 | goto out; | ||
| 904 | |||
| 905 | ll_update_times(request, dir); | ||
| 906 | ll_stats_ops_tally(sbi, LPROC_LL_LINK, 1); | ||
| 907 | out: | ||
| 908 | ptlrpc_req_finished(request); | ||
| 909 | return err; | ||
| 910 | } | ||
| 911 | |||
| 912 | static inline void ll_get_child_fid(struct dentry *child, struct lu_fid *fid) | 882 | static inline void ll_get_child_fid(struct dentry *child, struct lu_fid *fid) |
| 913 | { | 883 | { |
| 914 | if (child->d_inode) | 884 | if (child->d_inode) |
| @@ -1134,8 +1104,33 @@ static int ll_symlink(struct inode *dir, struct dentry *dentry, | |||
| 1134 | static int ll_link(struct dentry *old_dentry, struct inode *dir, | 1104 | static int ll_link(struct dentry *old_dentry, struct inode *dir, |
| 1135 | struct dentry *new_dentry) | 1105 | struct dentry *new_dentry) |
| 1136 | { | 1106 | { |
| 1137 | return ll_link_generic(old_dentry->d_inode, dir, &new_dentry->d_name, | 1107 | struct inode *src = old_dentry->d_inode; |
| 1138 | new_dentry); | 1108 | struct ll_sb_info *sbi = ll_i2sbi(dir); |
| 1109 | struct ptlrpc_request *request = NULL; | ||
| 1110 | struct md_op_data *op_data; | ||
| 1111 | int err; | ||
| 1112 | |||
| 1113 | CDEBUG(D_VFSTRACE, | ||
| 1114 | "VFS Op: inode=%lu/%u(%p), dir=%lu/%u(%p), target=%pd\n", | ||
| 1115 | src->i_ino, src->i_generation, src, dir->i_ino, | ||
| 1116 | dir->i_generation, dir, new_dentry); | ||
| 1117 | |||
| 1118 | op_data = ll_prep_md_op_data(NULL, src, dir, new_dentry->d_name.name, | ||
| 1119 | new_dentry->d_name.len, | ||
| 1120 | 0, LUSTRE_OPC_ANY, NULL); | ||
| 1121 | if (IS_ERR(op_data)) | ||
| 1122 | return PTR_ERR(op_data); | ||
| 1123 | |||
| 1124 | err = md_link(sbi->ll_md_exp, op_data, &request); | ||
| 1125 | ll_finish_md_op_data(op_data); | ||
| 1126 | if (err) | ||
| 1127 | goto out; | ||
| 1128 | |||
| 1129 | ll_update_times(request, dir); | ||
| 1130 | ll_stats_ops_tally(sbi, LPROC_LL_LINK, 1); | ||
| 1131 | out: | ||
| 1132 | ptlrpc_req_finished(request); | ||
| 1133 | return err; | ||
| 1139 | } | 1134 | } |
| 1140 | 1135 | ||
| 1141 | static int ll_rename(struct inode *old_dir, struct dentry *old_dentry, | 1136 | static int ll_rename(struct inode *old_dir, struct dentry *old_dentry, |
