namei.c (a55f2d861585006f493e933ad32d65d71ba631fa) namei.c (db0267e7afc72e04d92b845a00928e39be211d6a)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * (C) 2001 Clemson University and The University of Chicago
4 *
5 * See COPYING in top-level directory.
6 */
7
8/*

--- 8 unchanged lines hidden (view full) ---

17 */
18static int orangefs_create(struct inode *dir,
19 struct dentry *dentry,
20 umode_t mode,
21 bool exclusive)
22{
23 struct orangefs_inode_s *parent = ORANGEFS_I(dir);
24 struct orangefs_kernel_op_s *new_op;
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * (C) 2001 Clemson University and The University of Chicago
4 *
5 * See COPYING in top-level directory.
6 */
7
8/*

--- 8 unchanged lines hidden (view full) ---

17 */
18static int orangefs_create(struct inode *dir,
19 struct dentry *dentry,
20 umode_t mode,
21 bool exclusive)
22{
23 struct orangefs_inode_s *parent = ORANGEFS_I(dir);
24 struct orangefs_kernel_op_s *new_op;
25 struct orangefs_object_kref ref;
25 struct inode *inode;
26 struct iattr iattr;
27 int ret;
28
29 gossip_debug(GOSSIP_NAME_DEBUG, "%s: %pd\n",
30 __func__,
31 dentry);
32

--- 18 unchanged lines hidden (view full) ---

51 &new_op->downcall.resp.create.refn.khandle,
52 new_op->downcall.resp.create.refn.fs_id,
53 new_op,
54 ret);
55
56 if (ret < 0)
57 goto out;
58
26 struct inode *inode;
27 struct iattr iattr;
28 int ret;
29
30 gossip_debug(GOSSIP_NAME_DEBUG, "%s: %pd\n",
31 __func__,
32 dentry);
33

--- 18 unchanged lines hidden (view full) ---

52 &new_op->downcall.resp.create.refn.khandle,
53 new_op->downcall.resp.create.refn.fs_id,
54 new_op,
55 ret);
56
57 if (ret < 0)
58 goto out;
59
59 inode = orangefs_new_inode(dir->i_sb, dir, S_IFREG | mode, 0,
60 &new_op->downcall.resp.create.refn);
60 ref = new_op->downcall.resp.create.refn;
61 op_release(new_op);
62
63 inode = orangefs_new_inode(dir->i_sb, dir, S_IFREG | mode, 0, &ref);
61 if (IS_ERR(inode)) {
62 gossip_err("%s: Failed to allocate inode for file :%pd:\n",
63 __func__,
64 dentry);
65 ret = PTR_ERR(inode);
66 goto out;
67 }
68

--- 16 unchanged lines hidden (view full) ---

85
86 dir->i_mtime = dir->i_ctime = current_time(dir);
87 memset(&iattr, 0, sizeof iattr);
88 iattr.ia_valid |= ATTR_MTIME;
89 orangefs_inode_setattr(dir, &iattr);
90 mark_inode_dirty_sync(dir);
91 ret = 0;
92out:
64 if (IS_ERR(inode)) {
65 gossip_err("%s: Failed to allocate inode for file :%pd:\n",
66 __func__,
67 dentry);
68 ret = PTR_ERR(inode);
69 goto out;
70 }
71

--- 16 unchanged lines hidden (view full) ---

88
89 dir->i_mtime = dir->i_ctime = current_time(dir);
90 memset(&iattr, 0, sizeof iattr);
91 iattr.ia_valid |= ATTR_MTIME;
92 orangefs_inode_setattr(dir, &iattr);
93 mark_inode_dirty_sync(dir);
94 ret = 0;
95out:
93 op_release(new_op);
94 gossip_debug(GOSSIP_NAME_DEBUG,
95 "%s: %pd: returning %d\n",
96 __func__,
97 dentry,
98 ret);
99 return ret;
100}
101

--- 165 unchanged lines hidden (view full) ---

267}
268
269static int orangefs_symlink(struct inode *dir,
270 struct dentry *dentry,
271 const char *symname)
272{
273 struct orangefs_inode_s *parent = ORANGEFS_I(dir);
274 struct orangefs_kernel_op_s *new_op;
96 gossip_debug(GOSSIP_NAME_DEBUG,
97 "%s: %pd: returning %d\n",
98 __func__,
99 dentry,
100 ret);
101 return ret;
102}
103

--- 165 unchanged lines hidden (view full) ---

269}
270
271static int orangefs_symlink(struct inode *dir,
272 struct dentry *dentry,
273 const char *symname)
274{
275 struct orangefs_inode_s *parent = ORANGEFS_I(dir);
276 struct orangefs_kernel_op_s *new_op;
277 struct orangefs_object_kref ref;
275 struct inode *inode;
276 struct iattr iattr;
277 int mode = 755;
278 int ret;
279
280 gossip_debug(GOSSIP_NAME_DEBUG, "%s: called\n", __func__);
281
282 if (!symname)

--- 26 unchanged lines hidden (view full) ---

309
310 if (ret < 0) {
311 gossip_debug(GOSSIP_NAME_DEBUG,
312 "%s: failed with error code %d\n",
313 __func__, ret);
314 goto out;
315 }
316
278 struct inode *inode;
279 struct iattr iattr;
280 int mode = 755;
281 int ret;
282
283 gossip_debug(GOSSIP_NAME_DEBUG, "%s: called\n", __func__);
284
285 if (!symname)

--- 26 unchanged lines hidden (view full) ---

312
313 if (ret < 0) {
314 gossip_debug(GOSSIP_NAME_DEBUG,
315 "%s: failed with error code %d\n",
316 __func__, ret);
317 goto out;
318 }
319
317 inode = orangefs_new_inode(dir->i_sb, dir, S_IFLNK | mode, 0,
318 &new_op->downcall.resp.sym.refn);
320 ref = new_op->downcall.resp.sym.refn;
321 op_release(new_op);
322
323 inode = orangefs_new_inode(dir->i_sb, dir, S_IFLNK | mode, 0, &ref);
319 if (IS_ERR(inode)) {
320 gossip_err
321 ("*** Failed to allocate orangefs symlink inode\n");
322 ret = PTR_ERR(inode);
323 goto out;
324 }
325
326 gossip_debug(GOSSIP_NAME_DEBUG,

--- 13 unchanged lines hidden (view full) ---

340
341 dir->i_mtime = dir->i_ctime = current_time(dir);
342 memset(&iattr, 0, sizeof iattr);
343 iattr.ia_valid |= ATTR_MTIME;
344 orangefs_inode_setattr(dir, &iattr);
345 mark_inode_dirty_sync(dir);
346 ret = 0;
347out:
324 if (IS_ERR(inode)) {
325 gossip_err
326 ("*** Failed to allocate orangefs symlink inode\n");
327 ret = PTR_ERR(inode);
328 goto out;
329 }
330
331 gossip_debug(GOSSIP_NAME_DEBUG,

--- 13 unchanged lines hidden (view full) ---

345
346 dir->i_mtime = dir->i_ctime = current_time(dir);
347 memset(&iattr, 0, sizeof iattr);
348 iattr.ia_valid |= ATTR_MTIME;
349 orangefs_inode_setattr(dir, &iattr);
350 mark_inode_dirty_sync(dir);
351 ret = 0;
352out:
348 op_release(new_op);
349 return ret;
350}
351
352static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
353{
354 struct orangefs_inode_s *parent = ORANGEFS_I(dir);
355 struct orangefs_kernel_op_s *new_op;
353 return ret;
354}
355
356static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
357{
358 struct orangefs_inode_s *parent = ORANGEFS_I(dir);
359 struct orangefs_kernel_op_s *new_op;
360 struct orangefs_object_kref ref;
356 struct inode *inode;
357 struct iattr iattr;
358 int ret;
359
360 new_op = op_alloc(ORANGEFS_VFS_OP_MKDIR);
361 if (!new_op)
362 return -ENOMEM;
363

--- 14 unchanged lines hidden (view full) ---

378
379 if (ret < 0) {
380 gossip_debug(GOSSIP_NAME_DEBUG,
381 "%s: failed with error code %d\n",
382 __func__, ret);
383 goto out;
384 }
385
361 struct inode *inode;
362 struct iattr iattr;
363 int ret;
364
365 new_op = op_alloc(ORANGEFS_VFS_OP_MKDIR);
366 if (!new_op)
367 return -ENOMEM;
368

--- 14 unchanged lines hidden (view full) ---

383
384 if (ret < 0) {
385 gossip_debug(GOSSIP_NAME_DEBUG,
386 "%s: failed with error code %d\n",
387 __func__, ret);
388 goto out;
389 }
390
386 inode = orangefs_new_inode(dir->i_sb, dir, S_IFDIR | mode, 0,
387 &new_op->downcall.resp.mkdir.refn);
391 ref = new_op->downcall.resp.mkdir.refn;
392 op_release(new_op);
393
394 inode = orangefs_new_inode(dir->i_sb, dir, S_IFDIR | mode, 0, &ref);
388 if (IS_ERR(inode)) {
389 gossip_err("*** Failed to allocate orangefs dir inode\n");
390 ret = PTR_ERR(inode);
391 goto out;
392 }
393
394 gossip_debug(GOSSIP_NAME_DEBUG,
395 "Assigned dir inode new number of %pU\n",

--- 15 unchanged lines hidden (view full) ---

411 * across clients; keep constant at 1.
412 */
413 dir->i_mtime = dir->i_ctime = current_time(dir);
414 memset(&iattr, 0, sizeof iattr);
415 iattr.ia_valid |= ATTR_MTIME;
416 orangefs_inode_setattr(dir, &iattr);
417 mark_inode_dirty_sync(dir);
418out:
395 if (IS_ERR(inode)) {
396 gossip_err("*** Failed to allocate orangefs dir inode\n");
397 ret = PTR_ERR(inode);
398 goto out;
399 }
400
401 gossip_debug(GOSSIP_NAME_DEBUG,
402 "Assigned dir inode new number of %pU\n",

--- 15 unchanged lines hidden (view full) ---

418 * across clients; keep constant at 1.
419 */
420 dir->i_mtime = dir->i_ctime = current_time(dir);
421 memset(&iattr, 0, sizeof iattr);
422 iattr.ia_valid |= ATTR_MTIME;
423 orangefs_inode_setattr(dir, &iattr);
424 mark_inode_dirty_sync(dir);
425out:
419 op_release(new_op);
420 return ret;
421}
422
423static int orangefs_rename(struct inode *old_dir,
424 struct dentry *old_dentry,
425 struct inode *new_dir,
426 struct dentry *new_dentry,
427 unsigned int flags)

--- 59 unchanged lines hidden ---
426 return ret;
427}
428
429static int orangefs_rename(struct inode *old_dir,
430 struct dentry *old_dentry,
431 struct inode *new_dir,
432 struct dentry *new_dentry,
433 unsigned int flags)

--- 59 unchanged lines hidden ---