Skip to content

Commit

Permalink
ocfs2: Remove ocfs2_write_should_remove_suid()
Browse files Browse the repository at this point in the history
Use should_remove_suid() instead.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
  • Loading branch information
Mark Fasheh committed Dec 2, 2006
1 parent d23a147 commit e88d0c9
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,20 +943,6 @@ static int ocfs2_write_remove_suid(struct inode *inode)
return ret;
}

static inline int ocfs2_write_should_remove_suid(struct inode *inode)
{
mode_t mode = inode->i_mode;

if (!capable(CAP_FSETID)) {
if (unlikely(mode & S_ISUID))
return 1;

if (unlikely((mode & S_ISGID) && (mode & S_IXGRP)))
return 1;
}
return 0;
}

static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
const struct iovec *iov,
unsigned long nr_segs,
Expand Down Expand Up @@ -1021,7 +1007,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
* inode. There's also the dinode i_size state which
* can be lost via setattr during extending writes (we
* set inode->i_size at the end of a write. */
if (ocfs2_write_should_remove_suid(inode)) {
if (should_remove_suid(filp->f_dentry)) {
if (meta_level == 0) {
ocfs2_meta_unlock(inode, meta_level);
meta_level = 1;
Expand Down

0 comments on commit e88d0c9

Please sign in to comment.