Re: [PATCH v2 4/5] bus: hisi_lpc: Expand build test coverage
by kbuild test robot
Hi John,
I love your patch! Yet something to improve:
[auto build test ERROR on linus/master]
[cannot apply to v5.4-rc5 next-20191031]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/John-Garry/lib-logic_pio-Enforce...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 23fdb198ae81f47a574296dab5167c5e136a02ba
config: parisc-allmodconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers//bus/hisi_lpc.c: In function 'hisi_lpc_target_in':
>> drivers//bus/hisi_lpc.c:137:2: error: implicit declaration of function 'readsb'; did you mean 'readb'? [-Werror=implicit-function-declaration]
readsb(lpcdev->membase + LPC_REG_RDATA, buf, opcnt);
^~~~~~
readb
drivers//bus/hisi_lpc.c: In function 'hisi_lpc_target_out':
>> drivers//bus/hisi_lpc.c:180:2: error: implicit declaration of function 'writesb'; did you mean 'writeb'? [-Werror=implicit-function-declaration]
writesb(lpcdev->membase + LPC_REG_WDATA, buf, opcnt);
^~~~~~~
writeb
cc1: some warnings being treated as errors
vim +137 drivers//bus/hisi_lpc.c
adf38bb0b5956a Zhichang Yuan 2018-03-21 90
adf38bb0b5956a Zhichang Yuan 2018-03-21 91 /*
adf38bb0b5956a Zhichang Yuan 2018-03-21 92 * hisi_lpc_target_in - trigger a series of LPC cycles for read operation
adf38bb0b5956a Zhichang Yuan 2018-03-21 93 * @lpcdev: pointer to hisi lpc device
adf38bb0b5956a Zhichang Yuan 2018-03-21 94 * @para: some parameters used to control the lpc I/O operations
adf38bb0b5956a Zhichang Yuan 2018-03-21 95 * @addr: the lpc I/O target port address
adf38bb0b5956a Zhichang Yuan 2018-03-21 96 * @buf: where the read back data is stored
adf38bb0b5956a Zhichang Yuan 2018-03-21 97 * @opcnt: how many I/O operations required, i.e. data width
adf38bb0b5956a Zhichang Yuan 2018-03-21 98 *
adf38bb0b5956a Zhichang Yuan 2018-03-21 99 * Returns 0 on success, non-zero on fail.
adf38bb0b5956a Zhichang Yuan 2018-03-21 100 */
adf38bb0b5956a Zhichang Yuan 2018-03-21 101 static int hisi_lpc_target_in(struct hisi_lpc_dev *lpcdev,
adf38bb0b5956a Zhichang Yuan 2018-03-21 102 struct lpc_cycle_para *para, unsigned long addr,
adf38bb0b5956a Zhichang Yuan 2018-03-21 103 unsigned char *buf, unsigned long opcnt)
adf38bb0b5956a Zhichang Yuan 2018-03-21 104 {
adf38bb0b5956a Zhichang Yuan 2018-03-21 105 unsigned int cmd_word;
adf38bb0b5956a Zhichang Yuan 2018-03-21 106 unsigned int waitcnt;
adf38bb0b5956a Zhichang Yuan 2018-03-21 107 unsigned long flags;
adf38bb0b5956a Zhichang Yuan 2018-03-21 108 int ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21 109
adf38bb0b5956a Zhichang Yuan 2018-03-21 110 if (!buf || !opcnt || !para || !para->csize || !lpcdev)
adf38bb0b5956a Zhichang Yuan 2018-03-21 111 return -EINVAL;
adf38bb0b5956a Zhichang Yuan 2018-03-21 112
adf38bb0b5956a Zhichang Yuan 2018-03-21 113 cmd_word = 0; /* IO mode, Read */
adf38bb0b5956a Zhichang Yuan 2018-03-21 114 waitcnt = LPC_PEROP_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21 115 if (!(para->opflags & FG_INCRADDR_LPC)) {
adf38bb0b5956a Zhichang Yuan 2018-03-21 116 cmd_word |= LPC_REG_CMD_SAMEADDR;
adf38bb0b5956a Zhichang Yuan 2018-03-21 117 waitcnt = LPC_MAX_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21 118 }
adf38bb0b5956a Zhichang Yuan 2018-03-21 119
adf38bb0b5956a Zhichang Yuan 2018-03-21 120 /* whole operation must be atomic */
adf38bb0b5956a Zhichang Yuan 2018-03-21 121 spin_lock_irqsave(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21 122
adf38bb0b5956a Zhichang Yuan 2018-03-21 123 writel_relaxed(opcnt, lpcdev->membase + LPC_REG_OP_LEN);
adf38bb0b5956a Zhichang Yuan 2018-03-21 124 writel_relaxed(cmd_word, lpcdev->membase + LPC_REG_CMD);
adf38bb0b5956a Zhichang Yuan 2018-03-21 125 writel_relaxed(addr, lpcdev->membase + LPC_REG_ADDR);
adf38bb0b5956a Zhichang Yuan 2018-03-21 126
adf38bb0b5956a Zhichang Yuan 2018-03-21 127 writel(LPC_REG_STARTUP_SIGNAL_START,
adf38bb0b5956a Zhichang Yuan 2018-03-21 128 lpcdev->membase + LPC_REG_STARTUP_SIGNAL);
adf38bb0b5956a Zhichang Yuan 2018-03-21 129
adf38bb0b5956a Zhichang Yuan 2018-03-21 130 /* whether the operation is finished */
adf38bb0b5956a Zhichang Yuan 2018-03-21 131 ret = wait_lpc_idle(lpcdev->membase, waitcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21 132 if (ret) {
adf38bb0b5956a Zhichang Yuan 2018-03-21 133 spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21 134 return ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21 135 }
adf38bb0b5956a Zhichang Yuan 2018-03-21 136
adf38bb0b5956a Zhichang Yuan 2018-03-21 @137 readsb(lpcdev->membase + LPC_REG_RDATA, buf, opcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21 138
adf38bb0b5956a Zhichang Yuan 2018-03-21 139 spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21 140
adf38bb0b5956a Zhichang Yuan 2018-03-21 141 return 0;
adf38bb0b5956a Zhichang Yuan 2018-03-21 142 }
adf38bb0b5956a Zhichang Yuan 2018-03-21 143
adf38bb0b5956a Zhichang Yuan 2018-03-21 144 /*
adf38bb0b5956a Zhichang Yuan 2018-03-21 145 * hisi_lpc_target_out - trigger a series of LPC cycles for write operation
adf38bb0b5956a Zhichang Yuan 2018-03-21 146 * @lpcdev: pointer to hisi lpc device
adf38bb0b5956a Zhichang Yuan 2018-03-21 147 * @para: some parameters used to control the lpc I/O operations
adf38bb0b5956a Zhichang Yuan 2018-03-21 148 * @addr: the lpc I/O target port address
adf38bb0b5956a Zhichang Yuan 2018-03-21 149 * @buf: where the data to be written is stored
adf38bb0b5956a Zhichang Yuan 2018-03-21 150 * @opcnt: how many I/O operations required, i.e. data width
adf38bb0b5956a Zhichang Yuan 2018-03-21 151 *
adf38bb0b5956a Zhichang Yuan 2018-03-21 152 * Returns 0 on success, non-zero on fail.
adf38bb0b5956a Zhichang Yuan 2018-03-21 153 */
adf38bb0b5956a Zhichang Yuan 2018-03-21 154 static int hisi_lpc_target_out(struct hisi_lpc_dev *lpcdev,
adf38bb0b5956a Zhichang Yuan 2018-03-21 155 struct lpc_cycle_para *para, unsigned long addr,
adf38bb0b5956a Zhichang Yuan 2018-03-21 156 const unsigned char *buf, unsigned long opcnt)
adf38bb0b5956a Zhichang Yuan 2018-03-21 157 {
adf38bb0b5956a Zhichang Yuan 2018-03-21 158 unsigned int waitcnt;
adf38bb0b5956a Zhichang Yuan 2018-03-21 159 unsigned long flags;
adf38bb0b5956a Zhichang Yuan 2018-03-21 160 u32 cmd_word;
adf38bb0b5956a Zhichang Yuan 2018-03-21 161 int ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21 162
adf38bb0b5956a Zhichang Yuan 2018-03-21 163 if (!buf || !opcnt || !para || !lpcdev)
adf38bb0b5956a Zhichang Yuan 2018-03-21 164 return -EINVAL;
adf38bb0b5956a Zhichang Yuan 2018-03-21 165
adf38bb0b5956a Zhichang Yuan 2018-03-21 166 /* default is increasing address */
adf38bb0b5956a Zhichang Yuan 2018-03-21 167 cmd_word = LPC_REG_CMD_OP; /* IO mode, write */
adf38bb0b5956a Zhichang Yuan 2018-03-21 168 waitcnt = LPC_PEROP_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21 169 if (!(para->opflags & FG_INCRADDR_LPC)) {
adf38bb0b5956a Zhichang Yuan 2018-03-21 170 cmd_word |= LPC_REG_CMD_SAMEADDR;
adf38bb0b5956a Zhichang Yuan 2018-03-21 171 waitcnt = LPC_MAX_WAITCNT;
adf38bb0b5956a Zhichang Yuan 2018-03-21 172 }
adf38bb0b5956a Zhichang Yuan 2018-03-21 173
adf38bb0b5956a Zhichang Yuan 2018-03-21 174 spin_lock_irqsave(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21 175
adf38bb0b5956a Zhichang Yuan 2018-03-21 176 writel_relaxed(opcnt, lpcdev->membase + LPC_REG_OP_LEN);
adf38bb0b5956a Zhichang Yuan 2018-03-21 177 writel_relaxed(cmd_word, lpcdev->membase + LPC_REG_CMD);
adf38bb0b5956a Zhichang Yuan 2018-03-21 178 writel_relaxed(addr, lpcdev->membase + LPC_REG_ADDR);
adf38bb0b5956a Zhichang Yuan 2018-03-21 179
adf38bb0b5956a Zhichang Yuan 2018-03-21 @180 writesb(lpcdev->membase + LPC_REG_WDATA, buf, opcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21 181
adf38bb0b5956a Zhichang Yuan 2018-03-21 182 writel(LPC_REG_STARTUP_SIGNAL_START,
adf38bb0b5956a Zhichang Yuan 2018-03-21 183 lpcdev->membase + LPC_REG_STARTUP_SIGNAL);
adf38bb0b5956a Zhichang Yuan 2018-03-21 184
adf38bb0b5956a Zhichang Yuan 2018-03-21 185 /* whether the operation is finished */
adf38bb0b5956a Zhichang Yuan 2018-03-21 186 ret = wait_lpc_idle(lpcdev->membase, waitcnt);
adf38bb0b5956a Zhichang Yuan 2018-03-21 187
adf38bb0b5956a Zhichang Yuan 2018-03-21 188 spin_unlock_irqrestore(&lpcdev->cycle_lock, flags);
adf38bb0b5956a Zhichang Yuan 2018-03-21 189
adf38bb0b5956a Zhichang Yuan 2018-03-21 190 return ret;
adf38bb0b5956a Zhichang Yuan 2018-03-21 191 }
adf38bb0b5956a Zhichang Yuan 2018-03-21 192
:::::: The code at line 137 was first introduced by commit
:::::: adf38bb0b5956ab5469acb1ca981a9287c7ad1d8 HISI LPC: Support the LPC host on Hip06/Hip07 with DT bindings
:::::: TO: Zhichang Yuan <yuanzhichang(a)hisilicon.com>
:::::: CC: Bjorn Helgaas <helgaas(a)kernel.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
2 years, 6 months
[peterz-queue:perf/core 3/7] kernel/events/core.c:11423:24: sparse: sparse: incorrect type in return expression (different base types)
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core
head: 81d3fdc7ba3ed0763391798a1ba382bd3d3b865c
commit: 878461943fbe9f4ae8bfc32a74727c42f3468f0f [3/7] perf: Disallow aux_output for kernel events
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-dirty
git checkout 878461943fbe9f4ae8bfc32a74727c42f3468f0f
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
kernel/events/core.c:571:26: sparse: sparse: function 'perf_pmu_name' with external linkage has definition
kernel/events/core.c:1384:15: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:1384:15: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:1384:15: sparse: struct perf_event_context *
kernel/events/core.c:1397:28: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:1397:28: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:1397:28: sparse: struct perf_event_context *
kernel/events/core.c:3206:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:3206:18: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:3206:18: sparse: struct perf_event_context *
kernel/events/core.c:3207:23: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:3207:23: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:3207:23: sparse: struct perf_event_context *
kernel/events/core.c:3249:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:3249:25: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:3249:25: sparse: struct perf_event_context *
kernel/events/core.c:3250:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:3250:25: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:3250:25: sparse: struct perf_event_context *
kernel/events/core.c:4325:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:4325:25: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:4325:25: sparse: struct perf_event_context *
kernel/events/core.c:5549:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:5549:9: sparse: struct ring_buffer [noderef] <asn:4> *
kernel/events/core.c:5549:9: sparse: struct ring_buffer *
kernel/events/core.c:5057:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __poll_t [usertype] events @@ got e] events @@
kernel/events/core.c:5057:24: sparse: expected restricted __poll_t [usertype] events
kernel/events/core.c:5057:24: sparse: got int
kernel/events/core.c:5255:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:5255:22: sparse: struct ring_buffer [noderef] <asn:4> *
kernel/events/core.c:5255:22: sparse: struct ring_buffer *
kernel/events/core.c:5391:14: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:5391:14: sparse: struct ring_buffer [noderef] <asn:4> *
kernel/events/core.c:5391:14: sparse: struct ring_buffer *
kernel/events/core.c:5424:14: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:5424:14: sparse: struct ring_buffer [noderef] <asn:4> *
kernel/events/core.c:5424:14: sparse: struct ring_buffer *
kernel/events/core.c:5481:14: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:5481:14: sparse: struct ring_buffer [noderef] <asn:4> *
kernel/events/core.c:5481:14: sparse: struct ring_buffer *
kernel/events/core.c:5567:14: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:5567:14: sparse: struct ring_buffer [noderef] <asn:4> *
kernel/events/core.c:5567:14: sparse: struct ring_buffer *
kernel/events/core.c:5580:14: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:5580:14: sparse: struct ring_buffer [noderef] <asn:4> *
kernel/events/core.c:5580:14: sparse: struct ring_buffer *
kernel/events/internal.h:203:1: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got f] <asn:1> *from @@
kernel/events/internal.h:203:1: sparse: expected void const [noderef] <asn:1> *from
kernel/events/internal.h:203:1: sparse: got void const *buf
kernel/events/core.c:6900:23: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:6900:23: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:6900:23: sparse: struct perf_event_context *
kernel/events/core.c:6991:13: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:6991:13: sparse: struct ring_buffer [noderef] <asn:4> *
kernel/events/core.c:6991:13: sparse: struct ring_buffer *
kernel/events/core.c:7679:23: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:7679:23: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:7679:23: sparse: struct perf_event_context *
kernel/events/core.c:8409:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:8409:17: sparse: struct swevent_hlist [noderef] <asn:4> *
kernel/events/core.c:8409:17: sparse: struct swevent_hlist *
kernel/events/core.c:8429:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:8429:17: sparse: struct swevent_hlist [noderef] <asn:4> *
kernel/events/core.c:8429:17: sparse: struct swevent_hlist *
kernel/events/core.c:8549:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:8549:16: sparse: struct swevent_hlist [noderef] <asn:4> *
kernel/events/core.c:8549:16: sparse: struct swevent_hlist *
kernel/events/core.c:8560:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:8560:9: sparse: struct swevent_hlist [noderef] <asn:4> *
kernel/events/core.c:8560:9: sparse: struct swevent_hlist *
kernel/events/core.c:8549:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:8549:16: sparse: struct swevent_hlist [noderef] <asn:4> *
kernel/events/core.c:8549:16: sparse: struct swevent_hlist *
kernel/events/core.c:8599:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:8599:17: sparse: struct swevent_hlist [noderef] <asn:4> *
kernel/events/core.c:8599:17: sparse: struct swevent_hlist *
kernel/events/core.c:8780:23: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:8780:23: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:8780:23: sparse: struct perf_event_context *
kernel/events/core.c:9951:1: sparse: sparse: symbol 'dev_attr_nr_addr_filters' was not declared. Should it be static?
>> kernel/events/core.c:11423:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected struct perf_event * @@ got t * @@
>> kernel/events/core.c:11423:24: sparse: expected struct perf_event *
kernel/events/core.c:11423:24: sparse: got int
kernel/events/core.c:11666:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:11666:9: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:11666:9: sparse: struct perf_event_context *
kernel/events/core.c:11776:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:11776:17: sparse: struct perf_event_context [noderef] <asn:4> *
kernel/events/core.c:11776:17: sparse: struct perf_event_context *
kernel/events/core.c:8549:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:8549:16: sparse: struct swevent_hlist [noderef] <asn:4> *
kernel/events/core.c:8549:16: sparse: struct swevent_hlist *
kernel/events/core.c:12200:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/core.c:12200:17: sparse: struct swevent_hlist [noderef] <asn:4> *
kernel/events/core.c:12200:17: sparse: struct swevent_hlist *
kernel/events/core.c:155:9: sparse: sparse: context imbalance in 'perf_ctx_lock' - wrong count at exit
kernel/events/core.c:163:17: sparse: sparse: context imbalance in 'perf_ctx_unlock' - unexpected unlock
kernel/events/core.c:1404:17: sparse: sparse: context imbalance in 'perf_lock_task_context' - different lock contexts for basic block
kernel/events/core.c:1431:17: sparse: sparse: context imbalance in 'perf_pin_task_context' - unexpected unlock
kernel/events/core.c:2636:9: sparse: sparse: context imbalance in '__perf_install_in_context' - wrong count at exit
kernel/events/core.c:4297:17: sparse: sparse: context imbalance in 'find_get_context' - unexpected unlock
kernel/events/core.c:10320:9: sparse: sparse: context imbalance in 'perf_init_event' - different lock contexts for basic block
vim +11423 kernel/events/core.c
11400
11401 /**
11402 * perf_event_create_kernel_counter
11403 *
11404 * @attr: attributes of the counter to create
11405 * @cpu: cpu in which the counter is bound
11406 * @task: task to profile (NULL for percpu)
11407 */
11408 struct perf_event *
11409 perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu,
11410 struct task_struct *task,
11411 perf_overflow_handler_t overflow_handler,
11412 void *context)
11413 {
11414 struct perf_event_context *ctx;
11415 struct perf_event *event;
11416 int err;
11417
11418 /*
11419 * Grouping is not supported for kernel events, neither is 'AUX',
11420 * make sure the caller's intentions are adjusted.
11421 */
11422 if (attr->aux_output)
11423 return -EINVAL;
11424
11425 event = perf_event_alloc(attr, cpu, task, NULL, NULL,
11426 overflow_handler, context, -1);
11427 if (IS_ERR(event)) {
11428 err = PTR_ERR(event);
11429 goto err;
11430 }
11431
11432 /* Mark owner so we could distinguish it from user events. */
11433 event->owner = TASK_TOMBSTONE;
11434
11435 /*
11436 * Get the target context (task or percpu):
11437 */
11438 ctx = find_get_context(event->pmu, task, event);
11439 if (IS_ERR(ctx)) {
11440 err = PTR_ERR(ctx);
11441 goto err_free;
11442 }
11443
11444 WARN_ON_ONCE(ctx->parent_ctx);
11445 mutex_lock(&ctx->mutex);
11446 if (ctx->task == TASK_TOMBSTONE) {
11447 err = -ESRCH;
11448 goto err_unlock;
11449 }
11450
11451 if (!task) {
11452 /*
11453 * Check if the @cpu we're creating an event for is online.
11454 *
11455 * We use the perf_cpu_context::ctx::mutex to serialize against
11456 * the hotplug notifiers. See perf_event_{init,exit}_cpu().
11457 */
11458 struct perf_cpu_context *cpuctx =
11459 container_of(ctx, struct perf_cpu_context, ctx);
11460 if (!cpuctx->online) {
11461 err = -ENODEV;
11462 goto err_unlock;
11463 }
11464 }
11465
11466 if (!exclusive_event_installable(event, ctx)) {
11467 err = -EBUSY;
11468 goto err_unlock;
11469 }
11470
11471 perf_install_in_context(ctx, event, event->cpu);
11472 perf_unpin_context(ctx);
11473 mutex_unlock(&ctx->mutex);
11474
11475 return event;
11476
11477 err_unlock:
11478 mutex_unlock(&ctx->mutex);
11479 perf_unpin_context(ctx);
11480 put_ctx(ctx);
11481 err_free:
11482 free_event(event);
11483 err:
11484 return ERR_PTR(err);
11485 }
11486 EXPORT_SYMBOL_GPL(perf_event_create_kernel_counter);
11487
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
2 years, 6 months
Re: [RFC PATCH v2] f2fs: support data compression
by kbuild test robot
Hi Chao,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on f2fs/dev-test]
[also build test ERROR on next-20191031]
[cannot apply to v5.4-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Chao-Yu/f2fs-support-data-compre...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test
config: x86_64-randconfig-e001-201943 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
fs/f2fs/inode.c: In function 'do_read_inode':
>> fs/f2fs/inode.c:448:2: error: implicit declaration of function 'stat_add_compr_blocks'; did you mean 'stat_inc_compr_blocks'? [-Werror=implicit-function-declaration]
stat_add_compr_blocks(inode, F2FS_I(inode)->i_compressed_blocks);
^~~~~~~~~~~~~~~~~~~~~
stat_inc_compr_blocks
fs/f2fs/inode.c: In function 'f2fs_evict_inode':
>> fs/f2fs/inode.c:756:2: error: implicit declaration of function 'stat_sub_compr_blocks'; did you mean 'stat_inc_compr_blocks'? [-Werror=implicit-function-declaration]
stat_sub_compr_blocks(inode, F2FS_I(inode)->i_compressed_blocks);
^~~~~~~~~~~~~~~~~~~~~
stat_inc_compr_blocks
Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_read
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:arch_set_bit
Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:arch_clear_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:constant_test_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
Cyclomatic Complexity 1 include/asm-generic/bitops-instrumented.h:set_bit
Cyclomatic Complexity 1 include/asm-generic/bitops-instrumented.h:clear_bit
Cyclomatic Complexity 3 include/linux/time64.h:timespec64_equal
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_read
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_dec_and_test
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_dec_and_test
Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
Cyclomatic Complexity 3 include/linux/kdev_t.h:old_valid_dev
Cyclomatic Complexity 1 include/linux/kdev_t.h:old_encode_dev
Cyclomatic Complexity 1 include/linux/kdev_t.h:old_decode_dev
Cyclomatic Complexity 1 include/linux/kdev_t.h:new_encode_dev
Cyclomatic Complexity 1 include/linux/kdev_t.h:new_decode_dev
Cyclomatic Complexity 1 include/linux/uidgid.h:__kuid_val
Cyclomatic Complexity 1 include/linux/uidgid.h:__kgid_val
Cyclomatic Complexity 1 include/linux/uidgid.h:make_kuid
Cyclomatic Complexity 1 include/linux/uidgid.h:make_kgid
Cyclomatic Complexity 1 include/linux/uidgid.h:from_kuid
Cyclomatic Complexity 1 include/linux/uidgid.h:from_kgid
Cyclomatic Complexity 1 include/linux/page-flags.h:PageTail
Cyclomatic Complexity 3 include/linux/page-flags.h:PageCompound
Cyclomatic Complexity 1 include/linux/page-flags.h:PagePoisoned
Cyclomatic Complexity 1 include/linux/page-flags.h:PageLocked
Cyclomatic Complexity 1 include/linux/page-flags.h:ClearPageChecked
Cyclomatic Complexity 1 include/linux/projid.h:__kprojid_val
Cyclomatic Complexity 1 include/linux/projid.h:make_kprojid
Cyclomatic Complexity 1 include/linux/projid.h:from_kprojid
Cyclomatic Complexity 1 include/linux/fs.h:i_size_read
Cyclomatic Complexity 1 include/linux/fs.h:i_size_write
Cyclomatic Complexity 1 include/linux/fs.h:i_uid_read
Cyclomatic Complexity 1 include/linux/fs.h:i_gid_read
Cyclomatic Complexity 1 include/linux/fs.h:i_uid_write
Cyclomatic Complexity 1 include/linux/fs.h:i_gid_write
Cyclomatic Complexity 1 include/linux/page_ref.h:page_ref_count
Cyclomatic Complexity 1 include/linux/page_ref.h:page_ref_dec_and_test
Cyclomatic Complexity 1 include/linux/mm.h:put_devmap_managed_page
Cyclomatic Complexity 1 include/linux/mm.h:lowmem_page_address
Cyclomatic Complexity 1 include/linux/pagemap.h:mapping_set_gfp_mask
Cyclomatic Complexity 1 include/crypto/hash.h:crypto_shash_descsize
Cyclomatic Complexity 1 include/linux/fscrypt.h:fscrypt_put_encryption_info
Cyclomatic Complexity 1 include/linux/fsverity.h:fsverity_cleanup_inode
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:set_raw_extent
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:time_to_inject
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_I
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_SB
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_I_SB
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_CKPT
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_NODE
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_INODE
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:SM_I
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:SIT_I
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:FREE_I
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:NODE_MAPPING
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:set_sbi_flag
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:__is_set_ckpt_flags
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:is_set_ckpt_flags
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_HAS_BLOCKS
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:get_pages
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:get_dirty_pages
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:get_blocktype_secs
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:IS_INODE
Cyclomatic Complexity 2 fs/f2fs/f2fs.h:offset_in_addr
Cyclomatic Complexity 8 fs/f2fs/f2fs.h:get_inline_info
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:is_file
Cyclomatic Complexity 5 fs/f2fs/f2fs.h:f2fs_is_time_consistent
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_cp_error
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:get_extra_isize
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:inline_data_addr
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:get_inline_xattr_addrs
Cyclomatic Complexity 2 fs/f2fs/f2fs.h:__is_valid_data_blkaddr
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_extra_attr
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_project_quota
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_inode_chksum
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_flexible_inline_xattr
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_inode_crtime
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_compression
Cyclomatic Complexity 1 fs/f2fs/node.h:ino_of_node
Cyclomatic Complexity 1 fs/f2fs/node.h:nid_of_node
Cyclomatic Complexity 1 fs/f2fs/node.h:is_node
Cyclomatic Complexity 1 fs/f2fs/node.h:clear_inline_node
Cyclomatic Complexity 2 fs/f2fs/node.h:set_cold_node
Cyclomatic Complexity 2 fs/f2fs/segment.h:CURSEG_I
Cyclomatic Complexity 1 fs/f2fs/segment.h:get_seg_entry
Cyclomatic Complexity 1 fs/f2fs/segment.h:reserved_segments
Cyclomatic Complexity 1 fs/f2fs/segment.h:free_sections
Cyclomatic Complexity 1 fs/f2fs/segment.h:reserved_sections
Cyclomatic Complexity 4 fs/f2fs/segment.h:has_curseg_enough_space
Cyclomatic Complexity 1 include/trace/events/f2fs.h:trace_f2fs_iget
Cyclomatic Complexity 1 include/trace/events/f2fs.h:trace_f2fs_iget_exit
vim +448 fs/f2fs/inode.c
305
306 static int do_read_inode(struct inode *inode)
307 {
308 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
309 struct f2fs_inode_info *fi = F2FS_I(inode);
310 struct page *node_page;
311 struct f2fs_inode *ri;
312 projid_t i_projid;
313 int err;
314
315 /* Check if ino is within scope */
316 if (f2fs_check_nid_range(sbi, inode->i_ino))
317 return -EINVAL;
318
319 node_page = f2fs_get_node_page(sbi, inode->i_ino);
320 if (IS_ERR(node_page))
321 return PTR_ERR(node_page);
322
323 ri = F2FS_INODE(node_page);
324
325 inode->i_mode = le16_to_cpu(ri->i_mode);
326 i_uid_write(inode, le32_to_cpu(ri->i_uid));
327 i_gid_write(inode, le32_to_cpu(ri->i_gid));
328 set_nlink(inode, le32_to_cpu(ri->i_links));
329 inode->i_size = le64_to_cpu(ri->i_size);
330 inode->i_blocks = SECTOR_FROM_BLOCK(le64_to_cpu(ri->i_blocks) - 1);
331
332 inode->i_atime.tv_sec = le64_to_cpu(ri->i_atime);
333 inode->i_ctime.tv_sec = le64_to_cpu(ri->i_ctime);
334 inode->i_mtime.tv_sec = le64_to_cpu(ri->i_mtime);
335 inode->i_atime.tv_nsec = le32_to_cpu(ri->i_atime_nsec);
336 inode->i_ctime.tv_nsec = le32_to_cpu(ri->i_ctime_nsec);
337 inode->i_mtime.tv_nsec = le32_to_cpu(ri->i_mtime_nsec);
338 inode->i_generation = le32_to_cpu(ri->i_generation);
339 if (S_ISDIR(inode->i_mode))
340 fi->i_current_depth = le32_to_cpu(ri->i_current_depth);
341 else if (S_ISREG(inode->i_mode))
342 fi->i_gc_failures[GC_FAILURE_PIN] =
343 le16_to_cpu(ri->i_gc_failures);
344 fi->i_xattr_nid = le32_to_cpu(ri->i_xattr_nid);
345 fi->i_flags = le32_to_cpu(ri->i_flags);
346 if (S_ISREG(inode->i_mode))
347 fi->i_flags &= ~F2FS_PROJINHERIT_FL;
348 fi->flags = 0;
349 fi->i_advise = ri->i_advise;
350 fi->i_pino = le32_to_cpu(ri->i_pino);
351 fi->i_dir_level = ri->i_dir_level;
352
353 if (f2fs_init_extent_tree(inode, &ri->i_ext))
354 set_page_dirty(node_page);
355
356 get_inline_info(inode, ri);
357
358 fi->i_extra_isize = f2fs_has_extra_attr(inode) ?
359 le16_to_cpu(ri->i_extra_isize) : 0;
360
361 if (f2fs_sb_has_flexible_inline_xattr(sbi)) {
362 fi->i_inline_xattr_size = le16_to_cpu(ri->i_inline_xattr_size);
363 } else if (f2fs_has_inline_xattr(inode) ||
364 f2fs_has_inline_dentry(inode)) {
365 fi->i_inline_xattr_size = DEFAULT_INLINE_XATTR_ADDRS;
366 } else {
367
368 /*
369 * Previous inline data or directory always reserved 200 bytes
370 * in inode layout, even if inline_xattr is disabled. In order
371 * to keep inline_dentry's structure for backward compatibility,
372 * we get the space back only from inline_data.
373 */
374 fi->i_inline_xattr_size = 0;
375 }
376
377 if (!sanity_check_inode(inode, node_page)) {
378 f2fs_put_page(node_page, 1);
379 return -EFSCORRUPTED;
380 }
381
382 /* check data exist */
383 if (f2fs_has_inline_data(inode) && !f2fs_exist_data(inode))
384 __recover_inline_status(inode, node_page);
385
386 /* try to recover cold bit for non-dir inode */
387 if (!S_ISDIR(inode->i_mode) && !is_cold_node(node_page)) {
388 set_cold_node(node_page, false);
389 set_page_dirty(node_page);
390 }
391
392 /* get rdev by using inline_info */
393 __get_inode_rdev(inode, ri);
394
395 if (S_ISREG(inode->i_mode)) {
396 err = __written_first_block(sbi, ri);
397 if (err < 0) {
398 f2fs_put_page(node_page, 1);
399 return err;
400 }
401 if (!err)
402 set_inode_flag(inode, FI_FIRST_BLOCK_WRITTEN);
403 }
404
405 if (!f2fs_need_inode_block_update(sbi, inode->i_ino))
406 fi->last_disk_size = inode->i_size;
407
408 if (fi->i_flags & F2FS_PROJINHERIT_FL)
409 set_inode_flag(inode, FI_PROJ_INHERIT);
410
411 if (f2fs_has_extra_attr(inode) && f2fs_sb_has_project_quota(sbi) &&
412 F2FS_FITS_IN_INODE(ri, fi->i_extra_isize, i_projid))
413 i_projid = (projid_t)le32_to_cpu(ri->i_projid);
414 else
415 i_projid = F2FS_DEF_PROJID;
416 fi->i_projid = make_kprojid(&init_user_ns, i_projid);
417
418 if (f2fs_has_extra_attr(inode) && f2fs_sb_has_inode_crtime(sbi) &&
419 F2FS_FITS_IN_INODE(ri, fi->i_extra_isize, i_crtime)) {
420 fi->i_crtime.tv_sec = le64_to_cpu(ri->i_crtime);
421 fi->i_crtime.tv_nsec = le32_to_cpu(ri->i_crtime_nsec);
422 }
423
424 if (f2fs_has_extra_attr(inode) && f2fs_sb_has_compression(sbi)) {
425 if (F2FS_FITS_IN_INODE(ri, fi->i_extra_isize,
426 i_log_cluster_size)) {
427 fi->i_compressed_blocks =
428 le64_to_cpu(ri->i_compressed_blocks);
429 fi->i_compress_algorithm = ri->i_compress_algorithm;
430 fi->i_log_cluster_size = ri->i_log_cluster_size;
431 fi->i_cluster_size = 1 << fi->i_log_cluster_size;
432 }
433
434 if ((fi->i_flags & F2FS_COMPR_FL) && f2fs_may_compress(inode))
435 set_inode_flag(inode, FI_COMPRESSED_FILE);
436 }
437
438 F2FS_I(inode)->i_disk_time[0] = inode->i_atime;
439 F2FS_I(inode)->i_disk_time[1] = inode->i_ctime;
440 F2FS_I(inode)->i_disk_time[2] = inode->i_mtime;
441 F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime;
442 f2fs_put_page(node_page, 1);
443
444 stat_inc_inline_xattr(inode);
445 stat_inc_inline_inode(inode);
446 stat_inc_inline_dir(inode);
447 stat_inc_compr_inode(inode);
> 448 stat_add_compr_blocks(inode, F2FS_I(inode)->i_compressed_blocks);
449
450 return 0;
451 }
452
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
2 years, 6 months
Re: [RFC PATCH v2] f2fs: support data compression
by kbuild test robot
Hi Chao,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on f2fs/dev-test]
[cannot apply to v5.4-rc5 next-20191031]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Chao-Yu/f2fs-support-data-compre...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test
config: x86_64-randconfig-e004-201943 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
fs/f2fs/file.c: In function 'f2fs_truncate_data_blocks_range':
>> fs/f2fs/file.c:543:5: error: implicit declaration of function 'stat_sub_compr_blocks'; did you mean 'stat_dec_compr_blocks'? [-Werror=implicit-function-declaration]
stat_sub_compr_blocks(dn->inode, compr_blocks);
^~~~~~~~~~~~~~~~~~~~~
stat_dec_compr_blocks
Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_read
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:arch_set_bit
Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:arch_clear_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:arch_test_and_set_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:arch_test_and_set_bit_lock
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:constant_test_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls64
Cyclomatic Complexity 1 include/asm-generic/bitops-instrumented.h:set_bit
Cyclomatic Complexity 1 include/asm-generic/bitops-instrumented.h:clear_bit
Cyclomatic Complexity 1 include/asm-generic/bitops-instrumented.h:test_and_set_bit_lock
Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u64
Cyclomatic Complexity 1 include/linux/list.h:list_empty
Cyclomatic Complexity 3 include/linux/time64.h:timespec64_equal
Cyclomatic Complexity 1 arch/x86/include/asm/current.h:get_current
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_read
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_inc
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_dec
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_dec_and_test
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_inc
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_dec
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_dec_and_test
Cyclomatic Complexity 1 include/linux/string.h:strnlen
Cyclomatic Complexity 4 include/linux/string.h:strlen
Cyclomatic Complexity 3 include/linux/string.h:memset
Cyclomatic Complexity 4 include/linux/string.h:memcpy
Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
Cyclomatic Complexity 1 include/linux/thread_info.h:check_object_size
Cyclomatic Complexity 5 include/linux/thread_info.h:check_copy_size
Cyclomatic Complexity 5 arch/x86/include/asm/preempt.h:__preempt_count_add
Cyclomatic Complexity 5 arch/x86/include/asm/preempt.h:__preempt_count_sub
Cyclomatic Complexity 1 include/linux/spinlock.h:spin_lock
Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock
Cyclomatic Complexity 1 include/linux/dcache.h:d_inode
Cyclomatic Complexity 1 include/linux/uidgid.h:__kuid_val
Cyclomatic Complexity 1 include/linux/uidgid.h:__kgid_val
Cyclomatic Complexity 1 include/linux/uidgid.h:uid_eq
Cyclomatic Complexity 1 include/linux/uidgid.h:gid_eq
Cyclomatic Complexity 1 include/linux/page-flags.h:PageTail
Cyclomatic Complexity 1 include/linux/page-flags.h:PageLocked
Cyclomatic Complexity 1 include/linux/page-flags.h:PageDirty
Cyclomatic Complexity 1 include/linux/page-flags.h:PageSwapBacked
Cyclomatic Complexity 1 include/linux/page-flags.h:PageMappedToDisk
Cyclomatic Complexity 3 include/linux/page-flags.h:PageSwapCache
Cyclomatic Complexity 1 include/linux/page-flags.h:SetPageUptodate
Cyclomatic Complexity 1 include/linux/projid.h:__kprojid_val
Cyclomatic Complexity 1 include/linux/projid.h:from_kprojid
Cyclomatic Complexity 1 include/linux/fs.h:i_size_read
Cyclomatic Complexity 1 include/linux/fs.h:i_size_write
Cyclomatic Complexity 1 include/linux/fs.h:file_inode
Cyclomatic Complexity 1 include/linux/fs.h:sb_rdonly
Cyclomatic Complexity 1 include/linux/fs.h:parent_ino
Cyclomatic Complexity 1 include/linux/fs.h:simple_fill_fsxattr
Cyclomatic Complexity 1 include/linux/page_ref.h:page_ref_count
Cyclomatic Complexity 1 include/linux/page_ref.h:page_ref_dec_and_test
Cyclomatic Complexity 2 include/linux/overflow.h:array_size
Cyclomatic Complexity 2 include/linux/uaccess.h:copy_from_user
Cyclomatic Complexity 2 include/linux/uaccess.h:copy_to_user
Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_disabled_inc
Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_disabled_dec
Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_disable
Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_enable
Cyclomatic Complexity 1 include/linux/mm.h:put_devmap_managed_page
Cyclomatic Complexity 1 include/linux/mm.h:lowmem_page_address
Cyclomatic Complexity 1 include/asm-generic/cacheflush.h:flush_dcache_page
Cyclomatic Complexity 1 include/linux/highmem.h:kunmap
Cyclomatic Complexity 1 include/linux/highmem.h:kmap_atomic
Cyclomatic Complexity 1 include/linux/highmem.h:__kunmap_atomic
Cyclomatic Complexity 1 include/linux/pagemap.h:page_offset
Cyclomatic Complexity 4 include/linux/buffer_head.h:block_page_mkwrite_return
Cyclomatic Complexity 1 include/linux/file.h:__to_fd
Cyclomatic Complexity 1 include/linux/kasan.h:kasan_kmalloc
Cyclomatic Complexity 3 include/linux/slab.h:kmalloc_type
Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index
Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_alloc_trace
Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace
Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_large
Cyclomatic Complexity 4 include/linux/slab.h:kmalloc
Cyclomatic Complexity 1 include/linux/blkdev.h:blk_queue_zoned_model
Cyclomatic Complexity 2 include/linux/blkdev.h:blk_queue_is_zoned
Cyclomatic Complexity 1 include/linux/blkdev.h:bdev_get_queue
Cyclomatic Complexity 2 include/linux/blkdev.h:bdev_is_zoned
Cyclomatic Complexity 1 include/linux/uio.h:iov_iter_rw
Cyclomatic Complexity 1 include/linux/uio.h:iov_iter_count
Cyclomatic Complexity 1 arch/x86/include/asm/compat.h:compat_ptr
Cyclomatic Complexity 6 include/linux/quotaops.h:is_quota_modification
Cyclomatic Complexity 1 include/linux/quotaops.h:dquot_initialize
Cyclomatic Complexity 1 include/linux/quotaops.h:dquot_transfer
Cyclomatic Complexity 1 include/linux/fscrypt.h:fscrypt_has_encryption_key
Cyclomatic Complexity 1 include/linux/fscrypt.h:fscrypt_ioctl_set_policy
Cyclomatic Complexity 1 include/linux/fscrypt.h:fscrypt_ioctl_get_policy
Cyclomatic Complexity 1 include/linux/fscrypt.h:fscrypt_ioctl_get_policy_ex
Cyclomatic Complexity 1 include/linux/fscrypt.h:fscrypt_ioctl_add_key
--
fs/f2fs/inode.c: In function 'do_read_inode':
>> fs/f2fs/inode.c:448:2: error: implicit declaration of function 'stat_add_compr_blocks'; did you mean 'stat_dec_compr_blocks'? [-Werror=implicit-function-declaration]
stat_add_compr_blocks(inode, F2FS_I(inode)->i_compressed_blocks);
^~~~~~~~~~~~~~~~~~~~~
stat_dec_compr_blocks
fs/f2fs/inode.c: In function 'f2fs_evict_inode':
>> fs/f2fs/inode.c:756:2: error: implicit declaration of function 'stat_sub_compr_blocks'; did you mean 'stat_dec_compr_blocks'? [-Werror=implicit-function-declaration]
stat_sub_compr_blocks(inode, F2FS_I(inode)->i_compressed_blocks);
^~~~~~~~~~~~~~~~~~~~~
stat_dec_compr_blocks
Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_read
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:arch_set_bit
Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:arch_clear_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:constant_test_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
Cyclomatic Complexity 1 include/asm-generic/bitops-instrumented.h:set_bit
Cyclomatic Complexity 1 include/asm-generic/bitops-instrumented.h:clear_bit
Cyclomatic Complexity 3 include/linux/time64.h:timespec64_equal
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_read
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_dec_and_test
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_dec_and_test
Cyclomatic Complexity 3 include/linux/string.h:memset
Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
Cyclomatic Complexity 3 include/linux/kdev_t.h:old_valid_dev
Cyclomatic Complexity 1 include/linux/kdev_t.h:old_encode_dev
Cyclomatic Complexity 1 include/linux/kdev_t.h:old_decode_dev
Cyclomatic Complexity 1 include/linux/kdev_t.h:new_encode_dev
Cyclomatic Complexity 1 include/linux/kdev_t.h:new_decode_dev
Cyclomatic Complexity 1 include/linux/uidgid.h:__kuid_val
Cyclomatic Complexity 1 include/linux/uidgid.h:__kgid_val
Cyclomatic Complexity 1 include/linux/uidgid.h:make_kuid
Cyclomatic Complexity 1 include/linux/uidgid.h:make_kgid
Cyclomatic Complexity 1 include/linux/uidgid.h:from_kuid
Cyclomatic Complexity 1 include/linux/uidgid.h:from_kgid
Cyclomatic Complexity 1 include/linux/page-flags.h:PageLocked
Cyclomatic Complexity 1 include/linux/page-flags.h:PageDirty
Cyclomatic Complexity 1 include/linux/page-flags.h:ClearPageChecked
Cyclomatic Complexity 1 include/linux/page-flags.h:PageSwapBacked
Cyclomatic Complexity 1 include/linux/page-flags.h:PageWriteback
Cyclomatic Complexity 3 include/linux/page-flags.h:PageSwapCache
Cyclomatic Complexity 1 include/linux/projid.h:__kprojid_val
Cyclomatic Complexity 1 include/linux/projid.h:make_kprojid
Cyclomatic Complexity 1 include/linux/projid.h:from_kprojid
Cyclomatic Complexity 1 include/linux/fs.h:i_size_read
Cyclomatic Complexity 1 include/linux/fs.h:i_size_write
Cyclomatic Complexity 1 include/linux/fs.h:i_uid_read
Cyclomatic Complexity 1 include/linux/fs.h:i_gid_read
Cyclomatic Complexity 1 include/linux/fs.h:i_uid_write
Cyclomatic Complexity 1 include/linux/fs.h:i_gid_write
Cyclomatic Complexity 1 include/linux/page_ref.h:page_ref_count
Cyclomatic Complexity 1 include/linux/page_ref.h:page_ref_dec_and_test
Cyclomatic Complexity 1 include/linux/mm.h:put_devmap_managed_page
Cyclomatic Complexity 1 include/linux/mm.h:lowmem_page_address
Cyclomatic Complexity 1 include/linux/pagemap.h:mapping_set_gfp_mask
Cyclomatic Complexity 1 include/crypto/hash.h:crypto_shash_descsize
Cyclomatic Complexity 1 include/linux/quotaops.h:dquot_initialize
Cyclomatic Complexity 1 include/linux/quotaops.h:dquot_initialize_needed
Cyclomatic Complexity 1 include/linux/quotaops.h:dquot_drop
Cyclomatic Complexity 1 include/linux/fscrypt.h:fscrypt_put_encryption_info
Cyclomatic Complexity 1 include/linux/fsverity.h:fsverity_cleanup_inode
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:set_raw_extent
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:time_to_inject
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_I
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_SB
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_I_SB
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_M_SB
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_CKPT
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_NODE
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_INODE
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:SM_I
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:SIT_I
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:FREE_I
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:NODE_MAPPING
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:set_sbi_flag
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:__is_set_ckpt_flags
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:is_set_ckpt_flags
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:F2FS_HAS_BLOCKS
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:get_pages
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:get_dirty_pages
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:get_blocktype_secs
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:IS_INODE
Cyclomatic Complexity 2 fs/f2fs/f2fs.h:offset_in_addr
Cyclomatic Complexity 8 fs/f2fs/f2fs.h:get_inline_info
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:is_file
Cyclomatic Complexity 5 fs/f2fs/f2fs.h:f2fs_is_time_consistent
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_cp_error
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:get_extra_isize
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:inline_data_addr
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:get_inline_xattr_addrs
Cyclomatic Complexity 2 fs/f2fs/f2fs.h:__is_valid_data_blkaddr
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_extra_attr
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_project_quota
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_inode_chksum
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_flexible_inline_xattr
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_inode_crtime
Cyclomatic Complexity 1 fs/f2fs/f2fs.h:f2fs_sb_has_compression
Cyclomatic Complexity 1 fs/f2fs/node.h:ino_of_node
Cyclomatic Complexity 1 fs/f2fs/node.h:nid_of_node
Cyclomatic Complexity 1 fs/f2fs/node.h:is_node
Cyclomatic Complexity 1 fs/f2fs/node.h:clear_inline_node
Cyclomatic Complexity 2 fs/f2fs/node.h:set_cold_node
Cyclomatic Complexity 2 fs/f2fs/segment.h:CURSEG_I
Cyclomatic Complexity 1 fs/f2fs/segment.h:get_seg_entry
vim +543 fs/f2fs/file.c
516
517 void f2fs_truncate_data_blocks_range(struct dnode_of_data *dn, int count)
518 {
519 struct f2fs_sb_info *sbi = F2FS_I_SB(dn->inode);
520 struct f2fs_node *raw_node;
521 int nr_free = 0, ofs = dn->ofs_in_node, len = count;
522 __le32 *addr;
523 int base = 0;
524 bool compressed_cluster = false;
525 int cluster_index = 0, valid_blocks = 0;
526 int cluster_size = F2FS_I(dn->inode)->i_cluster_size;
527
528 if (IS_INODE(dn->node_page) && f2fs_has_extra_attr(dn->inode))
529 base = get_extra_isize(dn->inode);
530
531 raw_node = F2FS_NODE(dn->node_page);
532 addr = blkaddr_in_node(raw_node) + base + ofs;
533
534 /* Assumption: truncateion starts with cluster */
535 for (; count > 0; count--, addr++, dn->ofs_in_node++, cluster_index++) {
536 block_t blkaddr = le32_to_cpu(*addr);
537
538 if (f2fs_compressed_file(dn->inode) &&
539 !(cluster_index & (cluster_size - 1))) {
540 if (compressed_cluster) {
541 int compr_blocks = cluster_size - valid_blocks;
542
> 543 stat_sub_compr_blocks(dn->inode, compr_blocks);
544 F2FS_I(dn->inode)->i_compressed_blocks -=
545 compr_blocks;
546 }
547 compressed_cluster = (blkaddr == COMPRESS_ADDR);
548 valid_blocks = 0;
549 }
550
551 if (blkaddr == NULL_ADDR)
552 continue;
553
554 dn->data_blkaddr = NULL_ADDR;
555 f2fs_set_data_blkaddr(dn);
556
557 if (__is_valid_data_blkaddr(blkaddr)) {
558 if (!f2fs_is_valid_blkaddr(sbi, blkaddr,
559 DATA_GENERIC_ENHANCE))
560 continue;
561 if (compressed_cluster)
562 valid_blocks++;
563 }
564
565 if (dn->ofs_in_node == 0 && IS_INODE(dn->node_page))
566 clear_inode_flag(dn->inode, FI_FIRST_BLOCK_WRITTEN);
567
568 f2fs_invalidate_blocks(sbi, blkaddr);
569 nr_free++;
570 }
571
572 if (compressed_cluster) {
573 int compr_blocks = cluster_size - valid_blocks;
574
575 stat_sub_compr_blocks(dn->inode, compr_blocks);
576 F2FS_I(dn->inode)->i_compressed_blocks -= compr_blocks;
577 }
578
579 if (nr_free) {
580 pgoff_t fofs;
581 /*
582 * once we invalidate valid blkaddr in range [ofs, ofs + count],
583 * we will invalidate all blkaddr in the whole range.
584 */
585 fofs = f2fs_start_bidx_of_node(ofs_of_node(dn->node_page),
586 dn->inode) + ofs;
587 f2fs_update_extent_cache_range(dn, fofs, 0, len);
588 dec_valid_block_count(sbi, dn->inode, nr_free);
589 }
590 dn->ofs_in_node = ofs;
591
592 f2fs_update_time(sbi, REQ_TIME);
593 trace_f2fs_truncate_data_blocks_range(dn->inode, dn->nid,
594 dn->ofs_in_node, nr_free);
595 }
596
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
2 years, 6 months