Commit db2e747b14991a4c6a5c98b0e5f552a193237c03

Authored by Miklos Szeredi
Committed by Al Viro
1 parent 7e79eedb3b

[patch 5/5] vfs: remove mode parameter from vfs_symlink()

Remove the unused mode parameter from vfs_symlink and callers.

Thanks to Tetsuo Handa for noticing.

CC: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>

Showing 4 changed files with 6 additions and 14 deletions Side-by-side Diff

... ... @@ -465,7 +465,6 @@
465 465 int rc;
466 466 struct dentry *lower_dentry;
467 467 struct dentry *lower_dir_dentry;
468   - umode_t mode;
469 468 char *encoded_symname;
470 469 int encoded_symlen;
471 470 struct ecryptfs_crypt_stat *crypt_stat = NULL;
... ... @@ -473,7 +472,6 @@
473 472 lower_dentry = ecryptfs_dentry_to_lower(dentry);
474 473 dget(lower_dentry);
475 474 lower_dir_dentry = lock_parent(lower_dentry);
476   - mode = S_IALLUGO;
477 475 encoded_symlen = ecryptfs_encode_filename(crypt_stat, symname,
478 476 strlen(symname),
479 477 &encoded_symname);
... ... @@ -482,7 +480,7 @@
482 480 goto out_lock;
483 481 }
484 482 rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry,
485   - encoded_symname, mode);
  483 + encoded_symname);
486 484 kfree(encoded_symname);
487 485 if (rc || !lower_dentry->d_inode)
488 486 goto out_lock;
... ... @@ -2434,7 +2434,7 @@
2434 2434 return do_unlinkat(AT_FDCWD, pathname);
2435 2435 }
2436 2436  
2437   -int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname, int mode)
  2437 +int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname)
2438 2438 {
2439 2439 int error = may_create(dir, dentry, NULL);
2440 2440  
... ... @@ -2483,7 +2483,7 @@
2483 2483 error = mnt_want_write(nd.path.mnt);
2484 2484 if (error)
2485 2485 goto out_dput;
2486   - error = vfs_symlink(nd.path.dentry->d_inode, dentry, from, S_IALLUGO);
  2486 + error = vfs_symlink(nd.path.dentry->d_inode, dentry, from);
2487 2487 mnt_drop_write(nd.path.mnt);
2488 2488 out_dput:
2489 2489 dput(dentry);
... ... @@ -1516,7 +1516,6 @@
1516 1516 struct dentry *dentry, *dnew;
1517 1517 __be32 err, cerr;
1518 1518 int host_err;
1519   - umode_t mode;
1520 1519  
1521 1520 err = nfserr_noent;
1522 1521 if (!flen || !plen)
... ... @@ -1535,11 +1534,6 @@
1535 1534 if (IS_ERR(dnew))
1536 1535 goto out_nfserr;
1537 1536  
1538   - mode = S_IALLUGO;
1539   - /* Only the MODE ATTRibute is even vaguely meaningful */
1540   - if (iap && (iap->ia_valid & ATTR_MODE))
1541   - mode = iap->ia_mode & S_IALLUGO;
1542   -
1543 1537 host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
1544 1538 if (host_err)
1545 1539 goto out_nfserr;
1546 1540  
... ... @@ -1551,11 +1545,11 @@
1551 1545 else {
1552 1546 strncpy(path_alloced, path, plen);
1553 1547 path_alloced[plen] = 0;
1554   - host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced, mode);
  1548 + host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced);
1555 1549 kfree(path_alloced);
1556 1550 }
1557 1551 } else
1558   - host_err = vfs_symlink(dentry->d_inode, dnew, path, mode);
  1552 + host_err = vfs_symlink(dentry->d_inode, dnew, path);
1559 1553  
1560 1554 if (!host_err) {
1561 1555 if (EX_ISSYNC(fhp->fh_export))
... ... @@ -1139,7 +1139,7 @@
1139 1139 extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
1140 1140 extern int vfs_mkdir(struct inode *, struct dentry *, int);
1141 1141 extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
1142   -extern int vfs_symlink(struct inode *, struct dentry *, const char *, int);
  1142 +extern int vfs_symlink(struct inode *, struct dentry *, const char *);
1143 1143 extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
1144 1144 extern int vfs_rmdir(struct inode *, struct dentry *);
1145 1145 extern int vfs_unlink(struct inode *, struct dentry *);