Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207671
b: refs/heads/master
c: c6223f4
h: refs/heads/master
i:
  207669: 6a92281
  207667: 4b3b20b
  207663: dbe2aaa
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Eric Paris committed Jul 28, 2010
1 parent 9d93b57 commit a4c1f28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 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: 88826276dcaf4cef9cc7c2695ff15c6d20d4a74d
refs/heads/master: c6223f464927cab9f4b10169b78c51d84228faf8
31 changes: 10 additions & 21 deletions trunk/fs/notify/fanotify/fanotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,26 +468,6 @@ static int fanotify_add_mark(struct fsnotify_group *group, struct inode *inode,
return PTR_ERR(fsn_mark);
}

static int fanotify_update_mark(struct fsnotify_group *group,
struct inode *inode, struct vfsmount *mnt,
int flags, __u32 mask)
{
pr_debug("%s: group=%p inode=%p mnt=%p flags=%x mask=%x\n",
__func__, group, inode, mnt, flags, mask);

BUG_ON(inode && mnt);
BUG_ON(!inode && !mnt);

if (flags & FAN_MARK_ADD)
fanotify_add_mark(group, inode, mnt, flags, mask);
else if (flags & FAN_MARK_REMOVE)
fanotify_remove_mark(group, inode, mnt, flags, mask);
else
BUG();

return 0;
}

static bool fanotify_mark_validate_input(int flags,
__u32 mask)
{
Expand Down Expand Up @@ -583,7 +563,16 @@ SYSCALL_DEFINE(fanotify_mark)(int fanotify_fd, unsigned int flags,
group = filp->private_data;

/* create/update an inode mark */
ret = fanotify_update_mark(group, inode, NULL, flags, mask);
switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE)) {
case FAN_MARK_ADD:
ret = fanotify_add_mark(group, inode, NULL, flags, mask);
break;
case FAN_MARK_REMOVE:
ret = fanotify_remove_mark(group, inode, NULL, flags, mask);
break;
default:
ret = -EINVAL;
}

path_put(&path);
fput_and_out:
Expand Down

0 comments on commit a4c1f28

Please sign in to comment.