/* * Copyright (C) 2008 Red Hat, Inc., Eric Paris <eparis@redhat.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <linux/fs.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/mount.h> #include <linux/mutex.h> #include <linux/spinlock.h> #include <linux/atomic.h> #include <linux/fsnotify_backend.h> #include "fsnotify.h" void fsnotify_clear_vfsmount_marks_by_group(struct fsnotify_group *group) { fsnotify_clear_marks_by_group_flags(group, FSNOTIFY_MARK_FLAG_VFSMOUNT); } /* * Recalculate the mnt->mnt_fsnotify_mask, or the mask of all FS_* event types * any notifier is interested in hearing for this mount point */ void fsnotify_recalc_vfsmount_mask(struct vfsmount *mnt) { struct mount *m = real_mount(mnt); spin_lock(&mnt->mnt_root->d_lock); m->mnt_fsnotify_mask = fsnotify_recalc_mask(&m->mnt_fsnotify_marks); spin_unlock(&mnt->mnt_root->d_lock); } void fsnotify_destroy_vfsmount_mark(struct fsnotify_mark *mark) { struct vfsmount *mnt = mark->mnt; struct mount *m = real_mount(mnt); BUG_ON(!mutex_is_locked(&mark->group->mark_mutex)); assert_spin_locked(&mark->lock); spin_lock(&mnt->mnt_root->d_lock); hlist_del_init_rcu(&mark->obj_list); mark->mnt = NULL; m->mnt_fsnotify_mask = fsnotify_recalc_mask(&m->mnt_fsnotify_marks); spin_unlock(&mnt->mnt_root->d_lock); } /* * given a group and vfsmount, find the mark associated with that combination. * if found take a reference to that mark and return it, else return NULL */ struct fsnotify_mark *fsnotify_find_vfsmount_mark(struct fsnotify_group *group, struct vfsmount *mnt) { struct mount *m = real_mount(mnt); struct fsnotify_mark *mark; spin_lock(&mnt->mnt_root->d_lock); mark = fsnotify_find_mark(&m->mnt_fsnotify_marks, group); spin_unlock(&mnt->mnt_root->d_lock); return mark; } /* * Attach an initialized mark to a given group and vfsmount. * These marks may be used for the fsnotify backend to determine which * event types should be delivered to which groups. */ int fsnotify_add_vfsmount_mark(struct fsnotify_mark *mark, struct fsnotify_group *group, struct vfsmount *mnt, int allow_dups) { struct mount *m = real_mount(mnt); int ret; mark->flags |= FSNOTIFY_MARK_FLAG_VFSMOUNT; BUG_ON(!mutex_is_locked(&group->mark_mutex)); assert_spin_locked(&mark->lock); spin_lock(&mnt->mnt_root->d_lock); mark->mnt = mnt; ret = fsnotify_add_mark_list(&m->mnt_fsnotify_marks, mark, allow_dups); m->mnt_fsnotify_mask = fsnotify_recalc_mask(&m->mnt_fsnotify_marks); spin_unlock(&mnt->mnt_root->d_lock); return ret; } 663ae0afd'>gadget</a>/<a href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/gadget/function?id=8b1b41ee74f9712c355d66dc105bbea663ae0afd'>function</a>/<a href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/gadget/function/u_ether_configfs.h?id=8b1b41ee74f9712c355d66dc105bbea663ae0afd'>u_ether_configfs.h</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='8b1b41ee74f9712c355d66dc105bbea663ae0afd'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'> <tr><th>author</th><td>Linus Torvalds <torvalds@linux-foundation.org></td><td class='right'>2017-02-06 19:36:04 -0800</td></tr> <tr><th>committer</th><td>Linus Torvalds <torvalds@linux-foundation.org></td><td class='right'>2017-02-06 19:36:04 -0800</td></tr> <tr><th>commit</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/gadget/function/u_ether_configfs.h?id=8b1b41ee74f9712c355d66dc105bbea663ae0afd'>8b1b41ee74f9712c355d66dc105bbea663ae0afd</a> (<a href='/cgit.cgi/linux/net-next.git/patch/drivers/usb/gadget/function/u_ether_configfs.h?id=8b1b41ee74f9712c355d66dc105bbea663ae0afd'>patch</a>)</td></tr> <tr><th>tree</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/tree/?id=8b1b41ee74f9712c355d66dc105bbea663ae0afd'>4c3f410f3cb01c7b00b474e376a60f27a7ff99a8</a> /<a href='/cgit.cgi/linux/net-next.git/tree/drivers/usb/gadget/function/u_ether_configfs.h?id=8b1b41ee74f9712c355d66dc105bbea663ae0afd'>drivers/usb/gadget/function/u_ether_configfs.h</a></td></tr> <tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/gadget/function/u_ether_configfs.h?id=f7d6040aa45df6ffd9e891114125dc919f18b96b'>f7d6040aa45df6ffd9e891114125dc919f18b96b</a> (<a href='/cgit.cgi/linux/net-next.git/diff/drivers/usb/gadget/function/u_ether_configfs.h?id=8b1b41ee74f9712c355d66dc105bbea663ae0afd&id2=f7d6040aa45df6ffd9e891114125dc919f18b96b'>diff</a>)</td></tr><tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/gadget/function/u_ether_configfs.h?id=bfb34527a32a1a576d9bfb7026d3ab0369a6cd60'>bfb34527a32a1a576d9bfb7026d3ab0369a6cd60</a> (<a href='/cgit.cgi/linux/net-next.git/diff/drivers/usb/gadget/function/u_ether_configfs.h?id=8b1b41ee74f9712c355d66dc105bbea663ae0afd&id2=bfb34527a32a1a576d9bfb7026d3ab0369a6cd60'>diff</a>)</td></tr></table> <div class='commit-subject'>Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm</div><div class='commit-msg'>Pull libnvdimm fixes from Dan Williams: "None of these are showstoppers for 4.10 and could wait for 4.11 merge window, but they are low enough risk for this late in the cycle and the fixes have waiting users . They have received a build success notification from the 0day robot, pass the latest ndctl unit tests, and appeared in next: - Fix a crash that can result when SIGINT is sent to a process that is awaiting completion of an address range scrub command. We were not properly cleaning up the workqueue after wait_event_interruptible(). - Fix a memory hotplug failure condition that results from not reserving enough space out of persistent memory for the memmap. By default we align to 2M allocations that the memory hotplug code assumes, but if the administrator specifies a non-default 4K-alignment then we can fail to correctly size the reservation. - A one line fix to improve the predictability of libnvdimm block device names. A common operation is to reconfigure /dev/pmem0 into a different mode. For example, a reconfiguration might set a new mode that reserves some of the capacity for a struct page memmap array. It surprises users if the device name changes to "/dev/pmem0.1" after the mode change and then back to /dev/pmem0 after a reboot. - Add 'const' to some function pointer tables" * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: libnvdimm, pfn: fix memmap reservation size versus 4K alignment acpi, nfit: fix acpi_nfit_flush_probe() crash libnvdimm, namespace: do not delete namespace-id 0 nvdimm: constify device_type structures </div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?id=8b1b41ee74f9712c355d66dc105bbea663ae0afd'>Diffstat</a> (limited to 'drivers/usb/gadget/function/u_ether_configfs.h')</div><table summary='diffstat' class='diffstat'>