dnotify: rename mark_entry to mark
nomenclature change. Used to call things 'entries' but now we just call them 'marks.' Do those changes for dnotify. Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
Родитель
000285deb9
Коммит
ef5e2b785f
|
@ -29,7 +29,7 @@
|
||||||
int dir_notify_enable __read_mostly = 1;
|
int dir_notify_enable __read_mostly = 1;
|
||||||
|
|
||||||
static struct kmem_cache *dnotify_struct_cache __read_mostly;
|
static struct kmem_cache *dnotify_struct_cache __read_mostly;
|
||||||
static struct kmem_cache *dnotify_mark_entry_cache __read_mostly;
|
static struct kmem_cache *dnotify_mark_cache __read_mostly;
|
||||||
static struct fsnotify_group *dnotify_group __read_mostly;
|
static struct fsnotify_group *dnotify_group __read_mostly;
|
||||||
static DEFINE_MUTEX(dnotify_mark_mutex);
|
static DEFINE_MUTEX(dnotify_mark_mutex);
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ static DEFINE_MUTEX(dnotify_mark_mutex);
|
||||||
* is being watched by dnotify. If multiple userspace applications are watching
|
* is being watched by dnotify. If multiple userspace applications are watching
|
||||||
* the same directory with dnotify their information is chained in dn
|
* the same directory with dnotify their information is chained in dn
|
||||||
*/
|
*/
|
||||||
struct dnotify_mark_entry {
|
struct dnotify_mark {
|
||||||
struct fsnotify_mark fsn_entry;
|
struct fsnotify_mark fsn_mark;
|
||||||
struct dnotify_struct *dn;
|
struct dnotify_struct *dn;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -51,27 +51,27 @@ struct dnotify_mark_entry {
|
||||||
* it calls the fsnotify function so it can update the set of all events relevant
|
* it calls the fsnotify function so it can update the set of all events relevant
|
||||||
* to this inode.
|
* to this inode.
|
||||||
*/
|
*/
|
||||||
static void dnotify_recalc_inode_mask(struct fsnotify_mark *entry)
|
static void dnotify_recalc_inode_mask(struct fsnotify_mark *fsn_mark)
|
||||||
{
|
{
|
||||||
__u32 new_mask, old_mask;
|
__u32 new_mask, old_mask;
|
||||||
struct dnotify_struct *dn;
|
struct dnotify_struct *dn;
|
||||||
struct dnotify_mark_entry *dnentry = container_of(entry,
|
struct dnotify_mark *dn_mark = container_of(fsn_mark,
|
||||||
struct dnotify_mark_entry,
|
struct dnotify_mark,
|
||||||
fsn_entry);
|
fsn_mark);
|
||||||
|
|
||||||
assert_spin_locked(&entry->lock);
|
assert_spin_locked(&fsn_mark->lock);
|
||||||
|
|
||||||
old_mask = entry->mask;
|
old_mask = fsn_mark->mask;
|
||||||
new_mask = 0;
|
new_mask = 0;
|
||||||
for (dn = dnentry->dn; dn != NULL; dn = dn->dn_next)
|
for (dn = dn_mark->dn; dn != NULL; dn = dn->dn_next)
|
||||||
new_mask |= (dn->dn_mask & ~FS_DN_MULTISHOT);
|
new_mask |= (dn->dn_mask & ~FS_DN_MULTISHOT);
|
||||||
entry->mask = new_mask;
|
fsn_mark->mask = new_mask;
|
||||||
|
|
||||||
if (old_mask == new_mask)
|
if (old_mask == new_mask)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (entry->i.inode)
|
if (fsn_mark->i.inode)
|
||||||
fsnotify_recalc_inode_mask(entry->i.inode);
|
fsnotify_recalc_inode_mask(fsn_mark->i.inode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -85,8 +85,8 @@ static void dnotify_recalc_inode_mask(struct fsnotify_mark *entry)
|
||||||
static int dnotify_handle_event(struct fsnotify_group *group,
|
static int dnotify_handle_event(struct fsnotify_group *group,
|
||||||
struct fsnotify_event *event)
|
struct fsnotify_event *event)
|
||||||
{
|
{
|
||||||
struct fsnotify_mark *entry = NULL;
|
struct fsnotify_mark *fsn_mark = NULL;
|
||||||
struct dnotify_mark_entry *dnentry;
|
struct dnotify_mark *dn_mark;
|
||||||
struct inode *to_tell;
|
struct inode *to_tell;
|
||||||
struct dnotify_struct *dn;
|
struct dnotify_struct *dn;
|
||||||
struct dnotify_struct **prev;
|
struct dnotify_struct **prev;
|
||||||
|
@ -96,16 +96,16 @@ static int dnotify_handle_event(struct fsnotify_group *group,
|
||||||
to_tell = event->to_tell;
|
to_tell = event->to_tell;
|
||||||
|
|
||||||
spin_lock(&to_tell->i_lock);
|
spin_lock(&to_tell->i_lock);
|
||||||
entry = fsnotify_find_mark(group, to_tell);
|
fsn_mark = fsnotify_find_mark(group, to_tell);
|
||||||
spin_unlock(&to_tell->i_lock);
|
spin_unlock(&to_tell->i_lock);
|
||||||
|
|
||||||
/* unlikely since we alreay passed dnotify_should_send_event() */
|
/* unlikely since we alreay passed dnotify_should_send_event() */
|
||||||
if (unlikely(!entry))
|
if (unlikely(!fsn_mark))
|
||||||
return 0;
|
return 0;
|
||||||
dnentry = container_of(entry, struct dnotify_mark_entry, fsn_entry);
|
dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
|
||||||
|
|
||||||
spin_lock(&entry->lock);
|
spin_lock(&fsn_mark->lock);
|
||||||
prev = &dnentry->dn;
|
prev = &dn_mark->dn;
|
||||||
while ((dn = *prev) != NULL) {
|
while ((dn = *prev) != NULL) {
|
||||||
if ((dn->dn_mask & test_mask) == 0) {
|
if ((dn->dn_mask & test_mask) == 0) {
|
||||||
prev = &dn->dn_next;
|
prev = &dn->dn_next;
|
||||||
|
@ -118,12 +118,12 @@ static int dnotify_handle_event(struct fsnotify_group *group,
|
||||||
else {
|
else {
|
||||||
*prev = dn->dn_next;
|
*prev = dn->dn_next;
|
||||||
kmem_cache_free(dnotify_struct_cache, dn);
|
kmem_cache_free(dnotify_struct_cache, dn);
|
||||||
dnotify_recalc_inode_mask(entry);
|
dnotify_recalc_inode_mask(fsn_mark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock(&entry->lock);
|
spin_unlock(&fsn_mark->lock);
|
||||||
fsnotify_put_mark(entry);
|
fsnotify_put_mark(fsn_mark);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
|
||||||
struct inode *inode, struct vfsmount *mnt,
|
struct inode *inode, struct vfsmount *mnt,
|
||||||
__u32 mask, void *data, int data_type)
|
__u32 mask, void *data, int data_type)
|
||||||
{
|
{
|
||||||
struct fsnotify_mark *entry;
|
struct fsnotify_mark *fsn_mark;
|
||||||
bool send;
|
bool send;
|
||||||
|
|
||||||
/* !dir_notify_enable should never get here, don't waste time checking
|
/* !dir_notify_enable should never get here, don't waste time checking
|
||||||
|
@ -148,30 +148,30 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
spin_lock(&inode->i_lock);
|
spin_lock(&inode->i_lock);
|
||||||
entry = fsnotify_find_mark(group, inode);
|
fsn_mark = fsnotify_find_mark(group, inode);
|
||||||
spin_unlock(&inode->i_lock);
|
spin_unlock(&inode->i_lock);
|
||||||
|
|
||||||
/* no mark means no dnotify watch */
|
/* no mark means no dnotify watch */
|
||||||
if (!entry)
|
if (!fsn_mark)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
mask = (mask & ~FS_EVENT_ON_CHILD);
|
mask = (mask & ~FS_EVENT_ON_CHILD);
|
||||||
send = (mask & entry->mask);
|
send = (mask & fsn_mark->mask);
|
||||||
|
|
||||||
fsnotify_put_mark(entry); /* matches fsnotify_find_mark */
|
fsnotify_put_mark(fsn_mark); /* matches fsnotify_find_mark */
|
||||||
|
|
||||||
return send;
|
return send;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dnotify_free_mark(struct fsnotify_mark *entry)
|
static void dnotify_free_mark(struct fsnotify_mark *fsn_mark)
|
||||||
{
|
{
|
||||||
struct dnotify_mark_entry *dnentry = container_of(entry,
|
struct dnotify_mark *dn_mark = container_of(fsn_mark,
|
||||||
struct dnotify_mark_entry,
|
struct dnotify_mark,
|
||||||
fsn_entry);
|
fsn_mark);
|
||||||
|
|
||||||
BUG_ON(dnentry->dn);
|
BUG_ON(dn_mark->dn);
|
||||||
|
|
||||||
kmem_cache_free(dnotify_mark_entry_cache, dnentry);
|
kmem_cache_free(dnotify_mark_cache, dn_mark);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct fsnotify_ops dnotify_fsnotify_ops = {
|
static struct fsnotify_ops dnotify_fsnotify_ops = {
|
||||||
|
@ -191,8 +191,8 @@ static struct fsnotify_ops dnotify_fsnotify_ops = {
|
||||||
*/
|
*/
|
||||||
void dnotify_flush(struct file *filp, fl_owner_t id)
|
void dnotify_flush(struct file *filp, fl_owner_t id)
|
||||||
{
|
{
|
||||||
struct fsnotify_mark *entry;
|
struct fsnotify_mark *fsn_mark;
|
||||||
struct dnotify_mark_entry *dnentry;
|
struct dnotify_mark *dn_mark;
|
||||||
struct dnotify_struct *dn;
|
struct dnotify_struct *dn;
|
||||||
struct dnotify_struct **prev;
|
struct dnotify_struct **prev;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
@ -202,37 +202,37 @@ void dnotify_flush(struct file *filp, fl_owner_t id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
spin_lock(&inode->i_lock);
|
spin_lock(&inode->i_lock);
|
||||||
entry = fsnotify_find_mark(dnotify_group, inode);
|
fsn_mark = fsnotify_find_mark(dnotify_group, inode);
|
||||||
spin_unlock(&inode->i_lock);
|
spin_unlock(&inode->i_lock);
|
||||||
if (!entry)
|
if (!fsn_mark)
|
||||||
return;
|
return;
|
||||||
dnentry = container_of(entry, struct dnotify_mark_entry, fsn_entry);
|
dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
|
||||||
|
|
||||||
mutex_lock(&dnotify_mark_mutex);
|
mutex_lock(&dnotify_mark_mutex);
|
||||||
|
|
||||||
spin_lock(&entry->lock);
|
spin_lock(&fsn_mark->lock);
|
||||||
prev = &dnentry->dn;
|
prev = &dn_mark->dn;
|
||||||
while ((dn = *prev) != NULL) {
|
while ((dn = *prev) != NULL) {
|
||||||
if ((dn->dn_owner == id) && (dn->dn_filp == filp)) {
|
if ((dn->dn_owner == id) && (dn->dn_filp == filp)) {
|
||||||
*prev = dn->dn_next;
|
*prev = dn->dn_next;
|
||||||
kmem_cache_free(dnotify_struct_cache, dn);
|
kmem_cache_free(dnotify_struct_cache, dn);
|
||||||
dnotify_recalc_inode_mask(entry);
|
dnotify_recalc_inode_mask(fsn_mark);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
prev = &dn->dn_next;
|
prev = &dn->dn_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock(&entry->lock);
|
spin_unlock(&fsn_mark->lock);
|
||||||
|
|
||||||
/* nothing else could have found us thanks to the dnotify_mark_mutex */
|
/* nothing else could have found us thanks to the dnotify_mark_mutex */
|
||||||
if (dnentry->dn == NULL)
|
if (dn_mark->dn == NULL)
|
||||||
fsnotify_destroy_mark(entry);
|
fsnotify_destroy_mark(fsn_mark);
|
||||||
|
|
||||||
fsnotify_recalc_group_mask(dnotify_group);
|
fsnotify_recalc_group_mask(dnotify_group);
|
||||||
|
|
||||||
mutex_unlock(&dnotify_mark_mutex);
|
mutex_unlock(&dnotify_mark_mutex);
|
||||||
|
|
||||||
fsnotify_put_mark(entry);
|
fsnotify_put_mark(fsn_mark);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this conversion is done only at watch creation */
|
/* this conversion is done only at watch creation */
|
||||||
|
@ -264,12 +264,12 @@ static __u32 convert_arg(unsigned long arg)
|
||||||
* onto that mark. This function either attaches the new dnotify_struct onto
|
* onto that mark. This function either attaches the new dnotify_struct onto
|
||||||
* that list, or it |= the mask onto an existing dnofiy_struct.
|
* that list, or it |= the mask onto an existing dnofiy_struct.
|
||||||
*/
|
*/
|
||||||
static int attach_dn(struct dnotify_struct *dn, struct dnotify_mark_entry *dnentry,
|
static int attach_dn(struct dnotify_struct *dn, struct dnotify_mark *dn_mark,
|
||||||
fl_owner_t id, int fd, struct file *filp, __u32 mask)
|
fl_owner_t id, int fd, struct file *filp, __u32 mask)
|
||||||
{
|
{
|
||||||
struct dnotify_struct *odn;
|
struct dnotify_struct *odn;
|
||||||
|
|
||||||
odn = dnentry->dn;
|
odn = dn_mark->dn;
|
||||||
while (odn != NULL) {
|
while (odn != NULL) {
|
||||||
/* adding more events to existing dnofiy_struct? */
|
/* adding more events to existing dnofiy_struct? */
|
||||||
if ((odn->dn_owner == id) && (odn->dn_filp == filp)) {
|
if ((odn->dn_owner == id) && (odn->dn_filp == filp)) {
|
||||||
|
@ -284,8 +284,8 @@ static int attach_dn(struct dnotify_struct *dn, struct dnotify_mark_entry *dnent
|
||||||
dn->dn_fd = fd;
|
dn->dn_fd = fd;
|
||||||
dn->dn_filp = filp;
|
dn->dn_filp = filp;
|
||||||
dn->dn_owner = id;
|
dn->dn_owner = id;
|
||||||
dn->dn_next = dnentry->dn;
|
dn->dn_next = dn_mark->dn;
|
||||||
dnentry->dn = dn;
|
dn_mark->dn = dn;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -297,8 +297,8 @@ static int attach_dn(struct dnotify_struct *dn, struct dnotify_mark_entry *dnent
|
||||||
*/
|
*/
|
||||||
int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
|
int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct dnotify_mark_entry *new_dnentry, *dnentry;
|
struct dnotify_mark *new_dn_mark, *dn_mark;
|
||||||
struct fsnotify_mark *new_entry, *entry;
|
struct fsnotify_mark *new_fsn_mark, *fsn_mark;
|
||||||
struct dnotify_struct *dn;
|
struct dnotify_struct *dn;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
fl_owner_t id = current->files;
|
fl_owner_t id = current->files;
|
||||||
|
@ -307,7 +307,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
|
||||||
__u32 mask;
|
__u32 mask;
|
||||||
|
|
||||||
/* we use these to tell if we need to kfree */
|
/* we use these to tell if we need to kfree */
|
||||||
new_entry = NULL;
|
new_fsn_mark = NULL;
|
||||||
dn = NULL;
|
dn = NULL;
|
||||||
|
|
||||||
if (!dir_notify_enable) {
|
if (!dir_notify_enable) {
|
||||||
|
@ -337,8 +337,8 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* new fsnotify mark, we expect most fcntl calls to add a new mark */
|
/* new fsnotify mark, we expect most fcntl calls to add a new mark */
|
||||||
new_dnentry = kmem_cache_alloc(dnotify_mark_entry_cache, GFP_KERNEL);
|
new_dn_mark = kmem_cache_alloc(dnotify_mark_cache, GFP_KERNEL);
|
||||||
if (!new_dnentry) {
|
if (!new_dn_mark) {
|
||||||
error = -ENOMEM;
|
error = -ENOMEM;
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
@ -346,29 +346,29 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
|
||||||
/* convert the userspace DN_* "arg" to the internal FS_* defines in fsnotify */
|
/* convert the userspace DN_* "arg" to the internal FS_* defines in fsnotify */
|
||||||
mask = convert_arg(arg);
|
mask = convert_arg(arg);
|
||||||
|
|
||||||
/* set up the new_entry and new_dnentry */
|
/* set up the new_fsn_mark and new_dn_mark */
|
||||||
new_entry = &new_dnentry->fsn_entry;
|
new_fsn_mark = &new_dn_mark->fsn_mark;
|
||||||
fsnotify_init_mark(new_entry, dnotify_free_mark);
|
fsnotify_init_mark(new_fsn_mark, dnotify_free_mark);
|
||||||
new_entry->mask = mask;
|
new_fsn_mark->mask = mask;
|
||||||
new_dnentry->dn = NULL;
|
new_dn_mark->dn = NULL;
|
||||||
|
|
||||||
/* this is needed to prevent the fcntl/close race described below */
|
/* this is needed to prevent the fcntl/close race described below */
|
||||||
mutex_lock(&dnotify_mark_mutex);
|
mutex_lock(&dnotify_mark_mutex);
|
||||||
|
|
||||||
/* add the new_entry or find an old one. */
|
/* add the new_fsn_mark or find an old one. */
|
||||||
spin_lock(&inode->i_lock);
|
spin_lock(&inode->i_lock);
|
||||||
entry = fsnotify_find_mark(dnotify_group, inode);
|
fsn_mark = fsnotify_find_mark(dnotify_group, inode);
|
||||||
spin_unlock(&inode->i_lock);
|
spin_unlock(&inode->i_lock);
|
||||||
if (entry) {
|
if (fsn_mark) {
|
||||||
dnentry = container_of(entry, struct dnotify_mark_entry, fsn_entry);
|
dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
|
||||||
spin_lock(&entry->lock);
|
spin_lock(&fsn_mark->lock);
|
||||||
} else {
|
} else {
|
||||||
fsnotify_add_mark(new_entry, dnotify_group, inode, 0);
|
fsnotify_add_mark(new_fsn_mark, dnotify_group, inode, 0);
|
||||||
spin_lock(&new_entry->lock);
|
spin_lock(&new_fsn_mark->lock);
|
||||||
entry = new_entry;
|
fsn_mark = new_fsn_mark;
|
||||||
dnentry = new_dnentry;
|
dn_mark = new_dn_mark;
|
||||||
/* we used new_entry, so don't free it */
|
/* we used new_fsn_mark, so don't free it */
|
||||||
new_entry = NULL;
|
new_fsn_mark = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
|
@ -377,17 +377,17 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
|
||||||
|
|
||||||
/* if (f != filp) means that we lost a race and another task/thread
|
/* if (f != filp) means that we lost a race and another task/thread
|
||||||
* actually closed the fd we are still playing with before we grabbed
|
* actually closed the fd we are still playing with before we grabbed
|
||||||
* the dnotify_mark_mutex and entry->lock. Since closing the fd is the
|
* the dnotify_mark_mutex and fsn_mark->lock. Since closing the fd is the
|
||||||
* only time we clean up the marks we need to get our mark off
|
* only time we clean up the marks we need to get our mark off
|
||||||
* the list. */
|
* the list. */
|
||||||
if (f != filp) {
|
if (f != filp) {
|
||||||
/* if we added ourselves, shoot ourselves, it's possible that
|
/* if we added ourselves, shoot ourselves, it's possible that
|
||||||
* the flush actually did shoot this entry. That's fine too
|
* the flush actually did shoot this fsn_mark. That's fine too
|
||||||
* since multiple calls to destroy_mark is perfectly safe, if
|
* since multiple calls to destroy_mark is perfectly safe, if
|
||||||
* we found a dnentry already attached to the inode, just sod
|
* we found a dn_mark already attached to the inode, just sod
|
||||||
* off silently as the flush at close time dealt with it.
|
* off silently as the flush at close time dealt with it.
|
||||||
*/
|
*/
|
||||||
if (dnentry == new_dnentry)
|
if (dn_mark == new_dn_mark)
|
||||||
destroy = 1;
|
destroy = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -395,13 +395,13 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
|
||||||
error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0);
|
error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0);
|
||||||
if (error) {
|
if (error) {
|
||||||
/* if we added, we must shoot */
|
/* if we added, we must shoot */
|
||||||
if (dnentry == new_dnentry)
|
if (dn_mark == new_dn_mark)
|
||||||
destroy = 1;
|
destroy = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = attach_dn(dn, dnentry, id, fd, filp, mask);
|
error = attach_dn(dn, dn_mark, id, fd, filp, mask);
|
||||||
/* !error means that we attached the dn to the dnentry, so don't free it */
|
/* !error means that we attached the dn to the dn_mark, so don't free it */
|
||||||
if (!error)
|
if (!error)
|
||||||
dn = NULL;
|
dn = NULL;
|
||||||
/* -EEXIST means that we didn't add this new dn and used an old one.
|
/* -EEXIST means that we didn't add this new dn and used an old one.
|
||||||
|
@ -409,20 +409,20 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
|
||||||
else if (error == -EEXIST)
|
else if (error == -EEXIST)
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
dnotify_recalc_inode_mask(entry);
|
dnotify_recalc_inode_mask(fsn_mark);
|
||||||
out:
|
out:
|
||||||
spin_unlock(&entry->lock);
|
spin_unlock(&fsn_mark->lock);
|
||||||
|
|
||||||
if (destroy)
|
if (destroy)
|
||||||
fsnotify_destroy_mark(entry);
|
fsnotify_destroy_mark(fsn_mark);
|
||||||
|
|
||||||
fsnotify_recalc_group_mask(dnotify_group);
|
fsnotify_recalc_group_mask(dnotify_group);
|
||||||
|
|
||||||
mutex_unlock(&dnotify_mark_mutex);
|
mutex_unlock(&dnotify_mark_mutex);
|
||||||
fsnotify_put_mark(entry);
|
fsnotify_put_mark(fsn_mark);
|
||||||
out_err:
|
out_err:
|
||||||
if (new_entry)
|
if (new_fsn_mark)
|
||||||
fsnotify_put_mark(new_entry);
|
fsnotify_put_mark(new_fsn_mark);
|
||||||
if (dn)
|
if (dn)
|
||||||
kmem_cache_free(dnotify_struct_cache, dn);
|
kmem_cache_free(dnotify_struct_cache, dn);
|
||||||
return error;
|
return error;
|
||||||
|
@ -431,7 +431,7 @@ out_err:
|
||||||
static int __init dnotify_init(void)
|
static int __init dnotify_init(void)
|
||||||
{
|
{
|
||||||
dnotify_struct_cache = KMEM_CACHE(dnotify_struct, SLAB_PANIC);
|
dnotify_struct_cache = KMEM_CACHE(dnotify_struct, SLAB_PANIC);
|
||||||
dnotify_mark_entry_cache = KMEM_CACHE(dnotify_mark_entry, SLAB_PANIC);
|
dnotify_mark_cache = KMEM_CACHE(dnotify_mark, SLAB_PANIC);
|
||||||
|
|
||||||
dnotify_group = fsnotify_alloc_group(&dnotify_fsnotify_ops);
|
dnotify_group = fsnotify_alloc_group(&dnotify_fsnotify_ops);
|
||||||
if (IS_ERR(dnotify_group))
|
if (IS_ERR(dnotify_group))
|
||||||
|
|
Загрузка…
Ссылка в новой задаче