diff mbox series

[37/50] lustre: osc: add OBD_IOC_GETATTR support for osc

Message ID 1647783064-20688-38-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: update to OpenSFS tree as of March 20, 2022 | expand

Commit Message

James Simmons March 20, 2022, 1:30 p.m. UTC
From: "John L. Hammond" <jhammond@whamcloud.com>

Add a supporting OBD_IOC_GETATTR case to osc_iocontrol().

WC-bug-id: https://jira.whamcloud.com/browse/LU-15452
Lustre-commit: 4143c3bdec2a87319 ("LU-15452 utils: support lctl getattr for osc")
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46131
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/osc/osc_request.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/lustre/osc/osc_request.c b/fs/lustre/osc/osc_request.c
index c442819..43cd6c5 100644
--- a/fs/lustre/osc/osc_request.c
+++ b/fs/lustre/osc/osc_request.c
@@ -3222,18 +3222,21 @@  static int osc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 					   data->ioc_inlbuf1, 0);
 		if (rc > 0)
 			rc = 0;
-		goto out;
+		break;
+	case OBD_IOC_GETATTR:
+		rc = obd_getattr(NULL, exp, &data->ioc_obdo1);
+		break;
 	case IOC_OSC_SET_ACTIVE:
 		rc = ptlrpc_set_import_active(obd->u.cli.cl_import,
 					      data->ioc_offset);
-		goto out;
+		break;
 	default:
 		CDEBUG(D_INODE, "%s: unrecognised ioctl %#x by %s\n",
 		       obd->obd_name, cmd, current->comm);
 		rc = -ENOTTY;
-		goto out;
+		break;
 	}
-out:
+
 	module_put(THIS_MODULE);
 	return rc;
 }