Displaying 20 results from an estimated 60 matches for "kobject_put".
2023 Mar 20
1
[RESEND, PATCH v2 01/10] kobject: introduce kobject_del_and_put()
There are plenty of using kobject_del() and kobject_put() together
in the kernel tree. This patch wraps these two calls in a single helper.
Signed-off-by: Yangtao Li <frank.li at vivo.com>
---
v2:
-add kobject_del_and_put() users
resend patchset to gregkh, Rafael and Damien
include/linux/kobject.h | 1 +
lib/kobject.c | 17 +++++++++++...
2023 Mar 22
3
[PATCH v3 01/10] kobject: introduce kobject_del_and_put()
There are plenty of using kobject_del() and kobject_put() together
in the kernel tree. This patch wraps these two calls in a single helper.
Signed-off-by: Yangtao Li <frank.li at vivo.com>
---
v3:
-convert to inline helper
v2:
-add kobject_del_and_put() users
include/linux/kobject.h | 13 +++++++++++++
lib/kobject.c | 3 +--
2 files c...
2015 Jan 09
2
blk-mq v3.18: Oops during virtio_blk hot-unplug
...ffffffff817b10e3>] mutex_lock+0x23/0x37
[ 165.633045] [<ffffffff81379706>] blk_mq_free_queue+0x26/0x1a0
[ 165.633045] [<ffffffff8136fe22>] blk_release_queue+0xa2/0x100
[ 165.633045] [<ffffffff8139f8a2>] kobject_cleanup+0x82/0x1c0
[ 165.633045] [<ffffffff8139f730>] kobject_put+0x30/0x70
[ 165.633045] [<ffffffff81369495>] blk_put_queue+0x15/0x20
[ 165.633045] [<ffffffff8137e033>] disk_release+0x93/0xd0
[ 165.633045] [<ffffffff814d27de>] device_release+0x3e/0xc0
[ 165.633045] [<ffffffff8139f8a2>] kobject_cleanup+0x82/0x1c0
[ 165.633045] [&...
2015 Jan 09
2
blk-mq v3.18: Oops during virtio_blk hot-unplug
...ffffffff817b10e3>] mutex_lock+0x23/0x37
[ 165.633045] [<ffffffff81379706>] blk_mq_free_queue+0x26/0x1a0
[ 165.633045] [<ffffffff8136fe22>] blk_release_queue+0xa2/0x100
[ 165.633045] [<ffffffff8139f8a2>] kobject_cleanup+0x82/0x1c0
[ 165.633045] [<ffffffff8139f730>] kobject_put+0x30/0x70
[ 165.633045] [<ffffffff81369495>] blk_put_queue+0x15/0x20
[ 165.633045] [<ffffffff8137e033>] disk_release+0x93/0xd0
[ 165.633045] [<ffffffff814d27de>] device_release+0x3e/0xc0
[ 165.633045] [<ffffffff8139f8a2>] kobject_cleanup+0x82/0x1c0
[ 165.633045] [&...
2018 May 03
0
[dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options
....
> >> If it's a filesystem or a device, turn it read only so that people
> >> notice right away.
>
> Mikulas> This vmalloc fallback is similar to
> Mikulas> CONFIG_DEBUG_KOBJECT_RELEASE. CONFIG_DEBUG_KOBJECT_RELEASE
> Mikulas> changes the behavior of kobject_put in order to cause
> Mikulas> deliberate crashes (that wouldn't happen otherwise) in
> Mikulas> drivers that misuse kobject_put. In the same sense, we want
> Mikulas> to cause deliberate crashes (that wouldn't happen otherwise)
> Mikulas> in drivers that misuse kvmall...
2023 Mar 19
1
[PATCH v2, RESEND 08/10] ocfs2: convert to kobject_del_and_put()
...k.c b/fs/ocfs2/filecheck.c
index 1ad7106741f8..fb9cf601245b 100644
--- a/fs/ocfs2/filecheck.c
+++ b/fs/ocfs2/filecheck.c
@@ -198,8 +198,7 @@ void ocfs2_filecheck_remove_sysfs(struct ocfs2_super *osb)
if (!osb->osb_fc_ent.fs_fcheck)
return;
- kobject_del(&osb->osb_fc_ent.fs_kobj);
- kobject_put(&osb->osb_fc_ent.fs_kobj);
+ kobject_del_and_put(&osb->osb_fc_ent.fs_kobj);
wait_for_completion(&osb->osb_fc_ent.fs_kobj_unregister);
ocfs2_filecheck_sysfs_free(&osb->osb_fc_ent);
}
--
2.35.1
2015 Jan 10
0
blk-mq v3.18: Oops during virtio_blk hot-unplug
...] mutex_lock+0x23/0x37
> [ 165.633045] [<ffffffff81379706>] blk_mq_free_queue+0x26/0x1a0
> [ 165.633045] [<ffffffff8136fe22>] blk_release_queue+0xa2/0x100
> [ 165.633045] [<ffffffff8139f8a2>] kobject_cleanup+0x82/0x1c0
> [ 165.633045] [<ffffffff8139f730>] kobject_put+0x30/0x70
> [ 165.633045] [<ffffffff81369495>] blk_put_queue+0x15/0x20
> [ 165.633045] [<ffffffff8137e033>] disk_release+0x93/0xd0
> [ 165.633045] [<ffffffff814d27de>] device_release+0x3e/0xc0
> [ 165.633045] [<ffffffff8139f8a2>] kobject_cleanup+0x82/0x1c...
2015 Jan 10
0
blk-mq v3.18: Oops during virtio_blk hot-unplug
...] mutex_lock+0x23/0x37
> [ 165.633045] [<ffffffff81379706>] blk_mq_free_queue+0x26/0x1a0
> [ 165.633045] [<ffffffff8136fe22>] blk_release_queue+0xa2/0x100
> [ 165.633045] [<ffffffff8139f8a2>] kobject_cleanup+0x82/0x1c0
> [ 165.633045] [<ffffffff8139f730>] kobject_put+0x30/0x70
> [ 165.633045] [<ffffffff81369495>] blk_put_queue+0x15/0x20
> [ 165.633045] [<ffffffff8137e033>] disk_release+0x93/0xd0
> [ 165.633045] [<ffffffff814d27de>] device_release+0x3e/0xc0
> [ 165.633045] [<ffffffff8139f8a2>] kobject_cleanup+0x82/0x1c...
2017 Dec 19
1
[PATCH v3 5/5] virtio: add comments for virtio_register_device
...e/after call device_register, the
> caller should do a proper cleanup. Caller cann't use kfree directly,
> if virtio_register_device has already called device_register. Caller
> cann't use put_device directly, if virtio_register_device has not yet
> call device_register, because kobject_put may give a warning cause
> dev->kobj has not been initialized.
This comment makes me inclined to think that we should also rethink
register_virtio_device(). On failure, we cannot do kfree() due to
driver core interaction; but we cannot do a put_device() either, since
the refcount may not yet...
2017 Dec 19
1
[PATCH v3 5/5] virtio: add comments for virtio_register_device
...e/after call device_register, the
> caller should do a proper cleanup. Caller cann't use kfree directly,
> if virtio_register_device has already called device_register. Caller
> cann't use put_device directly, if virtio_register_device has not yet
> call device_register, because kobject_put may give a warning cause
> dev->kobj has not been initialized.
This comment makes me inclined to think that we should also rethink
register_virtio_device(). On failure, we cannot do kfree() due to
driver core interaction; but we cannot do a put_device() either, since
the refcount may not yet...
2008 Sep 27
3
[PATCH 4/6 v3] PCI: support SR-IOV capability
...&iov_ktype,
+ &iov->kobj, iov->ve[i].name);
+ if (rc)
+ goto failed3;
+ rc = sysfs_create_file(&iov->ve[i].kobj, &vf_attr.attr);
+ if (rc) {
+ kobject_put(&iov->ve[i].kobj);
+ goto failed3;
+ }
+ }
+
+ return;
+
+failed3:
+ for (j = 0; j < i; j++) {
+ sysfs_remove_file(&iov->ve[j].kobj, &vf_attr.attr);
+ kobject_put(&iov->ve[j].kobj);
+...
2008 Sep 27
3
[PATCH 4/6 v3] PCI: support SR-IOV capability
...&iov_ktype,
+ &iov->kobj, iov->ve[i].name);
+ if (rc)
+ goto failed3;
+ rc = sysfs_create_file(&iov->ve[i].kobj, &vf_attr.attr);
+ if (rc) {
+ kobject_put(&iov->ve[i].kobj);
+ goto failed3;
+ }
+ }
+
+ return;
+
+failed3:
+ for (j = 0; j < i; j++) {
+ sysfs_remove_file(&iov->ve[j].kobj, &vf_attr.attr);
+ kobject_put(&iov->ve[j].kobj);
+...
2017 Dec 17
6
[PATCH v3 0/5] proper cleanup if fail to register_virtio_device
Hi,
Patch1 add a helper to get virtio_device's status which will be used
later.
Patch2~4: check virtio_device's status is RTIO_CONFIG_S_ACKNOWLEDGE
or not, if so use put_device otherwise use kfree.
Patch5: add comments for virtio_register_device help caller do a
proper cleanup if got failure.
weiping zhang (5):
virtio: add helper virtio_get_status
virtio_pci: don't kfree device
2017 Dec 17
6
[PATCH v3 0/5] proper cleanup if fail to register_virtio_device
Hi,
Patch1 add a helper to get virtio_device's status which will be used
later.
Patch2~4: check virtio_device's status is RTIO_CONFIG_S_ACKNOWLEDGE
or not, if so use put_device otherwise use kfree.
Patch5: add comments for virtio_register_device help caller do a
proper cleanup if got failure.
weiping zhang (5):
virtio: add helper virtio_get_status
virtio_pci: don't kfree device
2008 Feb 13
2
[PATCH] btrfs: fixes for kobject changes in mainline
..._add(&root->root_kobj, &btrfs_root_ktype,
+ &root->fs_info->super_kobj,
+ "%s", root->name);
if (error)
goto fail;
@@ -253,24 +243,25 @@
void btrfs_sysfs_del_root(struct btrfs_root *root)
{
- kobject_unregister(&root->root_kobj);
+ kobject_put(&root->root_kobj);
wait_for_completion(&root->kobj_unregister);
}
void btrfs_sysfs_del_super(struct btrfs_fs_info *fs)
{
- kobject_unregister(&fs->super_kobj);
+ kobject_put(&fs->super_kobj);
wait_for_completion(&fs->kobj_unregister);
}
int btrfs_init...
2017 Dec 17
0
[PATCH v3 5/5] virtio: add comments for virtio_register_device
...evice may fail before/after call device_register, the
caller should do a proper cleanup. Caller cann't use kfree directly,
if virtio_register_device has already called device_register. Caller
cann't use put_device directly, if virtio_register_device has not yet
call device_register, because kobject_put may give a warning cause
dev->kobj has not been initialized.
Signed-off-by: weiping zhang <zhangweiping at didichuxing.com>
---
drivers/virtio/virtio.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index c5b057bd..4f0...
2023 Mar 19
0
[PATCH v2 08/10] ocfs2: convert to kobject_del_and_put()
...k.c b/fs/ocfs2/filecheck.c
index 1ad7106741f8..fb9cf601245b 100644
--- a/fs/ocfs2/filecheck.c
+++ b/fs/ocfs2/filecheck.c
@@ -198,8 +198,7 @@ void ocfs2_filecheck_remove_sysfs(struct ocfs2_super *osb)
if (!osb->osb_fc_ent.fs_fcheck)
return;
- kobject_del(&osb->osb_fc_ent.fs_kobj);
- kobject_put(&osb->osb_fc_ent.fs_kobj);
+ kobject_del_and_put(&osb->osb_fc_ent.fs_kobj);
wait_for_completion(&osb->osb_fc_ent.fs_kobj_unregister);
ocfs2_filecheck_sysfs_free(&osb->osb_fc_ent);
}
--
2.35.1
2023 Mar 20
0
[RESEND, PATCH v2 08/10] ocfs2: convert to kobject_del_and_put()
...k.c b/fs/ocfs2/filecheck.c
index 1ad7106741f8..fb9cf601245b 100644
--- a/fs/ocfs2/filecheck.c
+++ b/fs/ocfs2/filecheck.c
@@ -198,8 +198,7 @@ void ocfs2_filecheck_remove_sysfs(struct ocfs2_super *osb)
if (!osb->osb_fc_ent.fs_fcheck)
return;
- kobject_del(&osb->osb_fc_ent.fs_kobj);
- kobject_put(&osb->osb_fc_ent.fs_kobj);
+ kobject_del_and_put(&osb->osb_fc_ent.fs_kobj);
wait_for_completion(&osb->osb_fc_ent.fs_kobj_unregister);
ocfs2_filecheck_sysfs_free(&osb->osb_fc_ent);
}
--
2.35.1
2023 Mar 22
1
[PATCH v3 08/10] ocfs2: convert to kobject_del_and_put()
...k.c b/fs/ocfs2/filecheck.c
index 1ad7106741f8..fb9cf601245b 100644
--- a/fs/ocfs2/filecheck.c
+++ b/fs/ocfs2/filecheck.c
@@ -198,8 +198,7 @@ void ocfs2_filecheck_remove_sysfs(struct ocfs2_super *osb)
if (!osb->osb_fc_ent.fs_fcheck)
return;
- kobject_del(&osb->osb_fc_ent.fs_kobj);
- kobject_put(&osb->osb_fc_ent.fs_kobj);
+ kobject_del_and_put(&osb->osb_fc_ent.fs_kobj);
wait_for_completion(&osb->osb_fc_ent.fs_kobj_unregister);
ocfs2_filecheck_sysfs_free(&osb->osb_fc_ent);
}
--
2.35.1
2018 Oct 16
0
[PATCH 2/2] drm/ttm: Provide ttm_bo_global_{init/release}() for struct ttm_bo_global
...2,22 @@ static void ttm_bo_global_kobj_release(struct kobject *kobj)
kfree(glob);
}
-void ttm_bo_global_ref_release(struct drm_global_reference *ref)
+void ttm_bo_global_release(struct ttm_bo_global *glob)
{
- struct ttm_bo_global *glob = ref->object;
-
kobject_del(&glob->kobj);
kobject_put(&glob->kobj);
}
-EXPORT_SYMBOL(ttm_bo_global_ref_release);
+EXPORT_SYMBOL(ttm_bo_global_release);
-int ttm_bo_global_ref_init(struct drm_global_reference *ref)
+int ttm_bo_global_init(struct ttm_bo_global *glob,
+ struct ttm_mem_global *mem_glob)
{
- struct ttm_bo_global_ref *bo_...