Lines Matching defs:iint
100 struct ima_iint_cache *iint,
106 if (iint->readcount > 0)
111 if (iint->writecount > 0)
121 static void ima_inc_counts(struct ima_iint_cache *iint, fmode_t mode)
123 BUG_ON(!mutex_is_locked(&iint->mutex));
125 iint->opencount++;
127 iint->readcount++;
129 iint->writecount++;
148 struct ima_iint_cache *iint;
153 iint = ima_iint_find_get(inode);
154 if (!iint)
156 mutex_lock(&iint->mutex);
159 rc = ima_must_measure(iint, inode, MAY_READ, FILE_CHECK);
164 ima_read_write_check(TOMTOU, iint, inode, dentry->d_name.name);
167 ima_read_write_check(OPEN_WRITERS, iint, inode, dentry->d_name.name);
169 ima_inc_counts(iint, file->f_mode);
170 mutex_unlock(&iint->mutex);
172 kref_put(&iint->refcount, iint_free);
178 static void ima_dec_counts(struct ima_iint_cache *iint, struct inode *inode,
182 BUG_ON(!mutex_is_locked(&iint->mutex));
184 iint->opencount--;
186 iint->readcount--;
188 iint->writecount--;
189 if (iint->writecount == 0) {
190 if (iint->version != inode->i_version)
191 iint->flags &= ~IMA_MEASURED;
195 if (((iint->opencount < 0) ||
196 (iint->readcount < 0) ||
197 (iint->writecount < 0)) &&
200 __func__, iint->readcount, iint->writecount,
201 iint->opencount);
211 * and decrement the iint readcount/writecount.
216 struct ima_iint_cache *iint;
220 iint = ima_iint_find_get(inode);
221 if (!iint)
224 mutex_lock(&iint->mutex);
225 ima_dec_counts(iint, inode, file);
226 mutex_unlock(&iint->mutex);
227 kref_put(&iint->refcount, iint_free);
234 struct ima_iint_cache *iint;
239 iint = ima_iint_find_get(inode);
240 if (!iint)
243 mutex_lock(&iint->mutex);
244 rc = ima_must_measure(iint, inode, mask, function);
248 rc = ima_collect_measurement(iint, file);
250 ima_store_measurement(iint, file, filename);
252 mutex_unlock(&iint->mutex);
253 kref_put(&iint->refcount, iint_free);