函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\sed-opal.c Create Date:2022-07-27 19:46:18
Last Modify:2020-03-17 23:36:33 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:generic_table_write_data

函数原型:static int generic_table_write_data(struct opal_dev *dev, const u64 data, u64 offset, u64 size, const u8 *uid)

返回类型:int

参数:

类型参数名称
struct opal_dev *dev
const u64data
u64offset
u64size
const u8 *uid
1229  __usersrc等于data
1232  off等于0
1236  err等于see TCG SAS 5.3.2.3 for a description of the available columns* the result is provided in dev->resp->tok[4]
1237  如果err
1238  pr_debug("Couldn't get the table size\n")
1239  返回:err
1242  len等于response_get_u64( & parsed, 4)
1243  如果size大于lenoffset大于lensize
1244  pr_debug("Does not fit in the table (%llu vs. %llu)\n", offset + size, len)
1246  返回:负ENOSPC
1250 off小于size循环
1251  err等于cmd_start(dev, uid, TCG Storage SSC Methods.* Derived from: TCG_Storage_Architecture_Core_Spec_v2.01_r1.00* Section: 6.3 Assigned UIDs[OPAL_SET])
1252  add_token_u8( & err, dev, OPAL_STARTNAME)
1253  add_token_u8( & err, dev, OPAL_WHERE)
1254  add_token_u64( & err, dev, offset + off)
1255  add_token_u8( & err, dev, OPAL_ENDNAME)
1257  add_token_u8( & err, dev, OPAL_STARTNAME)
1258  add_token_u8( & err, dev, OPAL_VALUES)
1266  len等于两数取小(remaining_size(dev) - (2 + 1 + Number of bytes needed by cmd_finalize. ), (size_t)(size - off))
1268  pr_debug("Write bytes %zu+%llu/%llu\n", off, len, size)
1270  dst等于add_bytestring_header( & err, dev, len)
1271  如果非dst退出
1274  如果copy_from_user(dst, src + off, len)则
1275  err等于负EFAULT
1276  退出
1279  pos加等于len
1281  add_token_u8( & err, dev, OPAL_ENDNAME)
1282  如果err退出
1285  err等于finalize_and_send(dev, Parses and checks for errors )
1286  如果err退出
1289  off加等于len
1292  返回:err
调用者
名称描述
write_shadow_mbr
write_table_data