Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197973
b: refs/heads/master
c: a1bd120
h: refs/heads/master
i:
  197971: bd1b12d
v: v3
  • Loading branch information
Dmitry Monakhov authored and Al Viro committed May 21, 2010
1 parent b95ac97 commit 65db981
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52957fe1c709d5ca3732456d73f4e4d95492c72c
refs/heads/master: a1bd120d13e586ea1c424048fd2c8420a442852a
20 changes: 20 additions & 0 deletions trunk/fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1606,3 +1606,23 @@ void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev)
inode->i_ino);
}
EXPORT_SYMBOL(init_special_inode);

/**
* Init uid,gid,mode for new inode according to posix standards
* @inode: New inode
* @dir: Directory inode
* @mode: mode of the new inode
*/
void inode_init_owner(struct inode *inode, const struct inode *dir,
mode_t mode)
{
inode->i_uid = current_fsuid();
if (dir && dir->i_mode & S_ISGID) {
inode->i_gid = dir->i_gid;
if (S_ISDIR(mode))
mode |= S_ISGID;
} else
inode->i_gid = current_fsgid();
inode->i_mode = mode;
}
EXPORT_SYMBOL(inode_init_owner);
3 changes: 2 additions & 1 deletion trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,8 @@ extern void dentry_unhash(struct dentry *dentry);
* VFS file helper functions.
*/
extern int file_permission(struct file *, int);

extern void inode_init_owner(struct inode *inode, const struct inode *dir,
mode_t mode);
/*
* VFS FS_IOC_FIEMAP helper definitions.
*/
Expand Down

0 comments on commit 65db981

Please sign in to comment.