Whamcloud - gitweb
LU-6142 libcfs: remove last use of container_of0 21/39321/2
authorJames Simmons <jsimmons@infradead.org>
Wed, 8 Jul 2020 18:54:19 +0000 (14:54 -0400)
committerOleg Drokin <green@whamcloud.com>
Sat, 12 Sep 2020 15:44:12 +0000 (15:44 +0000)
Remove the last use of container_of0 in osd_ldiskfs. Looking at
the code using container_of is safe to use since the handle
shouldn't be NULL or PTR_ERR.

Change-Id: Id018543997884825d1c3cee76de3a520fc3b7c18
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/39321
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/libcfs.h
lustre/osd-ldiskfs/osd_handler.c

index 5caff08..a172dda 100644 (file)
@@ -88,8 +88,6 @@ static inline int notifier_from_ioctl_errno(int err)
 
 int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data);
 
-#define container_of0(ptr, type, member) container_of_safe(ptr, type, member)
-
 extern struct workqueue_struct *cfs_rehash_wq;
 
 struct lnet_debugfs_symlink_def {
index 6ccd372..ce4834a 100644 (file)
@@ -2961,9 +2961,9 @@ static int osd_transfer_project(struct inode *inode, __u32 projid,
 
        raw_inode = ldiskfs_raw_inode(&iloc);
        if (!LDISKFS_FITS_IN_INODE(raw_inode, ei, i_projid)) {
-               struct osd_thandle *oh =
-                               container_of0(handle, struct osd_thandle,
-                                             ot_super);
+               struct osd_thandle *oh = container_of(handle,
+                                                     struct osd_thandle,
+                                                     ot_super);
                /**
                 * try to expand inode size automatically.
                 */