Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42394
b: refs/heads/master
c: d38eb8d
h: refs/heads/master
v: v3
  • Loading branch information
Tiger Yang authored and Mark Fasheh committed Dec 2, 2006
1 parent 79fb5e1 commit f56b858
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 58d206c2fa5cc0b35bf3ca48324d7633aa7d0412
refs/heads/master: d38eb8db6aa359c060dfb72a29cf8d94a96657d8
24 changes: 24 additions & 0 deletions trunk/fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,28 @@ int ocfs2_getattr(struct vfsmount *mnt,
return err;
}

int ocfs2_permission(struct inode *inode, int mask, struct nameidata *nd)
{
int ret;

mlog_entry_void();

ret = ocfs2_meta_lock(inode, NULL, 0);
if (ret) {
mlog_errno(ret);
goto out;
}

ret = generic_permission(inode, mask, NULL);
if (ret)
mlog_errno(ret);

ocfs2_meta_unlock(inode, 0);
out:
mlog_exit(ret);
return ret;
}

static int ocfs2_write_remove_suid(struct inode *inode)
{
int ret;
Expand Down Expand Up @@ -1329,11 +1351,13 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
struct inode_operations ocfs2_file_iops = {
.setattr = ocfs2_setattr,
.getattr = ocfs2_getattr,
.permission = ocfs2_permission,
};

struct inode_operations ocfs2_special_file_iops = {
.setattr = ocfs2_setattr,
.getattr = ocfs2_getattr,
.permission = ocfs2_permission,
};

const struct file_operations ocfs2_fops = {
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/ocfs2/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ int ocfs2_do_extend_allocation(struct ocfs2_super *osb,
int ocfs2_setattr(struct dentry *dentry, struct iattr *attr);
int ocfs2_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct kstat *stat);
int ocfs2_permission(struct inode *inode, int mask,
struct nameidata *nd);

int ocfs2_set_inode_size(handle_t *handle,
struct inode *inode,
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/ocfs2/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2311,4 +2311,5 @@ struct inode_operations ocfs2_dir_iops = {
.rename = ocfs2_rename,
.setattr = ocfs2_setattr,
.getattr = ocfs2_getattr,
.permission = ocfs2_permission,
};

0 comments on commit f56b858

Please sign in to comment.