Lines Matching refs:inode

14  * @inode: inode to wait for
20 * to i_dio_count, usually by inode->i_mutex.
22 static int inode_dio_wait_interruptible(struct inode *inode)
24 if (!atomic_read(&inode->i_dio_count))
27 wait_queue_head_t *wq = bit_waitqueue(&inode->i_state, __I_DIO_WAKEUP);
28 DEFINE_WAIT_BIT(q, &inode->i_state, __I_DIO_WAKEUP);
32 if (!atomic_read(&inode->i_dio_count))
40 return atomic_read(&inode->i_dio_count) ? -ERESTARTSYS : 0;
43 /* Call with exclusively locked inode->i_rwsem */
49 return inode_dio_wait_interruptible(&ictx->inode);
54 * @inode: file inode
59 * and holds a shared lock on inode->i_rwsem to ensure that the flag
66 * inode->i_rwsem, meaning that those are serialised w.r.t. the reads.
68 int netfs_start_io_read(struct inode *inode)
69 __acquires(inode->i_rwsem)
71 struct netfs_inode *ictx = netfs_inode(inode);
74 if (down_read_interruptible(&inode->i_rwsem) < 0)
78 up_read(&inode->i_rwsem);
81 if (down_write_killable(&inode->i_rwsem) < 0)
84 up_write(&inode->i_rwsem);
87 downgrade_write(&inode->i_rwsem);
94 * @inode: file inode
97 * lock on inode->i_rwsem.
99 void netfs_end_io_read(struct inode *inode)
100 __releases(inode->i_rwsem)
102 up_read(&inode->i_rwsem);
108 * @inode: file inode
113 int netfs_start_io_write(struct inode *inode)
114 __acquires(inode->i_rwsem)
116 struct netfs_inode *ictx = netfs_inode(inode);
118 if (down_write_killable(&inode->i_rwsem) < 0)
121 up_write(&inode->i_rwsem);
130 * @inode: file inode
133 * lock on inode->i_rwsem.
135 void netfs_end_io_write(struct inode *inode)
136 __releases(inode->i_rwsem)
138 up_write(&inode->i_rwsem);
142 /* Call with exclusively locked inode->i_rwsem */
143 static int netfs_block_buffered(struct inode *inode)
145 struct netfs_inode *ictx = netfs_inode(inode);
150 if (inode->i_mapping->nrpages != 0) {
151 unmap_mapping_range(inode->i_mapping, 0, 0, 0);
152 ret = filemap_fdatawait(inode->i_mapping);
164 * @inode: file inode
169 * and holds a shared lock on inode->i_rwsem to ensure that the flag
176 * inode->i_rwsem, meaning that those are serialised w.r.t. O_DIRECT.
178 int netfs_start_io_direct(struct inode *inode)
179 __acquires(inode->i_rwsem)
181 struct netfs_inode *ictx = netfs_inode(inode);
185 if (down_read_interruptible(&inode->i_rwsem) < 0)
189 up_read(&inode->i_rwsem);
192 if (down_write_killable(&inode->i_rwsem) < 0)
194 ret = netfs_block_buffered(inode);
196 up_write(&inode->i_rwsem);
199 downgrade_write(&inode->i_rwsem);
206 * @inode: file inode
209 * lock on inode->i_rwsem.
211 void netfs_end_io_direct(struct inode *inode)
212 __releases(inode->i_rwsem)
214 up_read(&inode->i_rwsem);