Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-12631 llite: report latency for filesystem ops
[fs/lustre-release.git]
/
lustre
/
llite
/
xattr.c
diff --git
a/lustre/llite/xattr.c
b/lustre/llite/xattr.c
index
50e98a1
..
6cfad04
100644
(file)
--- a/
lustre/llite/xattr.c
+++ b/
lustre/llite/xattr.c
@@
-112,6
+112,7
@@
static int ll_xattr_set_common(const struct xattr_handler *handler,
struct ptlrpc_request *req = NULL;
const char *pv = value;
char *fullname;
struct ptlrpc_request *req = NULL;
const char *pv = value;
char *fullname;
+ ktime_t kstart = ktime_get();
u64 valid;
int rc;
ENTRY;
u64 valid;
int rc;
ENTRY;
@@
-119,13
+120,10
@@
static int ll_xattr_set_common(const struct xattr_handler *handler,
/* When setxattr() is called with a size of 0 the value is
* unconditionally replaced by "". When removexattr() is
* called we get a NULL value and XATTR_REPLACE for flags. */
/* When setxattr() is called with a size of 0 the value is
* unconditionally replaced by "". When removexattr() is
* called we get a NULL value and XATTR_REPLACE for flags. */
- if (!value && flags == XATTR_REPLACE) {
- ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_REMOVEXATTR, 1);
+ if (!value && flags == XATTR_REPLACE)
valid = OBD_MD_FLXATTRRM;
valid = OBD_MD_FLXATTRRM;
- } else {
- ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_SETXATTR, 1);
+ else
valid = OBD_MD_FLXATTR;
valid = OBD_MD_FLXATTR;
- }
/* FIXME: enable IMA when the conditions are ready */
if (handler->flags == XATTR_SECURITY_T &&
/* FIXME: enable IMA when the conditions are ready */
if (handler->flags == XATTR_SECURITY_T &&
@@
-170,12
+168,17
@@
static int ll_xattr_set_common(const struct xattr_handler *handler,
if (rc) {
if (rc == -EOPNOTSUPP && handler->flags == XATTR_USER_T) {
LCONSOLE_INFO("Disabling user_xattr feature because it is not supported on the server\n");
if (rc) {
if (rc == -EOPNOTSUPP && handler->flags == XATTR_USER_T) {
LCONSOLE_INFO("Disabling user_xattr feature because it is not supported on the server\n");
-
sbi->ll_flags &= ~LL_SBI_USER_XATTR;
-
}
+ sbi->ll_flags &= ~LL_SBI_USER_XATTR;
+ }
RETURN(rc);
RETURN(rc);
- }
+ }
+
+ ptlrpc_req_finished(req);
+
+ ll_stats_ops_tally(ll_i2sbi(inode), valid == OBD_MD_FLXATTRRM ?
+ LPROC_LL_REMOVEXATTR : LPROC_LL_SETXATTR,
+ ktime_us_delta(ktime_get(), kstart));
- ptlrpc_req_finished(req);
RETURN(0);
}
RETURN(0);
}
@@
-319,6
+322,11
@@
static int ll_xattr_set(const struct xattr_handler *handler,
const char *name, const void *value, size_t size,
int flags)
{
const char *name, const void *value, size_t size,
int flags)
{
+ ktime_t kstart = ktime_get();
+ int op_type = flags == XATTR_REPLACE ? LPROC_LL_REMOVEXATTR :
+ LPROC_LL_SETXATTR;
+ int rc;
+
LASSERT(inode);
LASSERT(name);
LASSERT(inode);
LASSERT(name);
@@
-327,18
+335,14
@@
static int ll_xattr_set(const struct xattr_handler *handler,
/* lustre/trusted.lov.xxx would be passed through xattr API */
if (!strcmp(name, "lov")) {
/* lustre/trusted.lov.xxx would be passed through xattr API */
if (!strcmp(name, "lov")) {
- int op_type = flags == XATTR_REPLACE ? LPROC_LL_REMOVEXATTR :
- LPROC_LL_SETXATTR;
-
- ll_stats_ops_tally(ll_i2sbi(inode), op_type, 1);
-
- return ll_setstripe_ea(dentry, (struct lov_user_md *)value,
+ rc = ll_setstripe_ea(dentry, (struct lov_user_md *)value,
size);
size);
+ ll_stats_ops_tally(ll_i2sbi(inode), op_type,
+ ktime_us_delta(ktime_get(), kstart));
+ return rc;
} else if (!strcmp(name, "lma") || !strcmp(name, "link")) {
} else if (!strcmp(name, "lma") || !strcmp(name, "link")) {
- int op_type = flags == XATTR_REPLACE ? LPROC_LL_REMOVEXATTR :
- LPROC_LL_SETXATTR;
-
- ll_stats_ops_tally(ll_i2sbi(inode), op_type, 1);
+ ll_stats_ops_tally(ll_i2sbi(inode), op_type,
+ ktime_us_delta(ktime_get(), kstart));
return 0;
}
return 0;
}
@@
-424,13
+428,12
@@
static int ll_xattr_get_common(const struct xattr_handler *handler,
const char *name, void *buffer, size_t size)
{
struct ll_sb_info *sbi = ll_i2sbi(inode);
const char *name, void *buffer, size_t size)
{
struct ll_sb_info *sbi = ll_i2sbi(inode);
+ ktime_t kstart = ktime_get();
char *fullname;
int rc;
ENTRY;
char *fullname;
int rc;
ENTRY;
- ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_GETXATTR, 1);
-
rc = xattr_type_filter(sbi, handler);
if (rc)
RETURN(rc);
rc = xattr_type_filter(sbi, handler);
if (rc)
RETURN(rc);
@@
-470,6
+473,9
@@
static int ll_xattr_get_common(const struct xattr_handler *handler,
rc = ll_xattr_list(inode, fullname, handler->flags, buffer, size,
OBD_MD_FLXATTR);
kfree(fullname);
rc = ll_xattr_list(inode, fullname, handler->flags, buffer, size,
OBD_MD_FLXATTR);
kfree(fullname);
+ ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_GETXATTR,
+ ktime_us_delta(ktime_get(), kstart));
+
RETURN(rc);
}
RETURN(rc);
}
@@
-588,6
+594,7
@@
ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size)
{
struct inode *inode = dentry->d_inode;
struct ll_sb_info *sbi = ll_i2sbi(inode);
{
struct inode *inode = dentry->d_inode;
struct ll_sb_info *sbi = ll_i2sbi(inode);
+ ktime_t kstart = ktime_get();
char *xattr_name;
ssize_t rc, rc2;
size_t len, rem;
char *xattr_name;
ssize_t rc, rc2;
size_t len, rem;
@@
-597,8
+604,6
@@
ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size)
CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n",
PFID(ll_inode2fid(inode)), inode);
CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n",
PFID(ll_inode2fid(inode)), inode);
- ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_LISTXATTR, 1);
-
rc = ll_xattr_list(inode, NULL, XATTR_OTHER_T, buffer, size,
OBD_MD_FLXATTRLS);
if (rc < 0)
rc = ll_xattr_list(inode, NULL, XATTR_OTHER_T, buffer, size,
OBD_MD_FLXATTRLS);
if (rc < 0)
@@
-610,7
+615,7
@@
ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size)
* exists.
*/
if (!size)
* exists.
*/
if (!size)
-
RETURN(rc + sizeof(XATTR_LUSTRE_LOV))
;
+
goto out
;
xattr_name = buffer;
rem = rc;
xattr_name = buffer;
rem = rc;
@@
-644,6
+649,10
@@
ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size)
memcpy(buffer + rc, XATTR_LUSTRE_LOV, sizeof(XATTR_LUSTRE_LOV));
memcpy(buffer + rc, XATTR_LUSTRE_LOV, sizeof(XATTR_LUSTRE_LOV));
+out:
+ ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_LISTXATTR,
+ ktime_us_delta(ktime_get(), kstart));
+
RETURN(rc + sizeof(XATTR_LUSTRE_LOV));
}
RETURN(rc + sizeof(XATTR_LUSTRE_LOV));
}