Lines Matching +full:xlen +full:- +full:1

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) International Business Machines Corp., 2000-2004
4 * Portions Copyright (C) Christoph Hellwig, 2001-2002
31 return ERR_PTR(-ENOMEM); in jfs_iget()
32 if (!(inode->i_state & I_NEW)) in jfs_iget()
41 if (S_ISREG(inode->i_mode)) { in jfs_iget()
42 inode->i_op = &jfs_file_inode_operations; in jfs_iget()
43 inode->i_fop = &jfs_file_operations; in jfs_iget()
44 inode->i_mapping->a_ops = &jfs_aops; in jfs_iget()
45 } else if (S_ISDIR(inode->i_mode)) { in jfs_iget()
46 inode->i_op = &jfs_dir_inode_operations; in jfs_iget()
47 inode->i_fop = &jfs_dir_operations; in jfs_iget()
48 } else if (S_ISLNK(inode->i_mode)) { in jfs_iget()
49 if (inode->i_size >= IDATASIZE) { in jfs_iget()
50 inode->i_op = &page_symlink_inode_operations; in jfs_iget()
52 inode->i_mapping->a_ops = &jfs_aops; in jfs_iget()
54 inode->i_op = &jfs_fast_symlink_inode_operations; in jfs_iget()
55 inode->i_link = JFS_IP(inode)->i_inline; in jfs_iget()
57 * The inline data should be null-terminated, but in jfs_iget()
58 * don't let on-disk corruption crash the kernel in jfs_iget()
60 inode->i_link[inode->i_size] = '\0'; in jfs_iget()
63 inode->i_op = &jfs_file_inode_operations; in jfs_iget()
64 init_special_inode(inode, inode->i_mode, inode->i_rdev); in jfs_iget()
85 if (inode->i_nlink == 0 || !test_cflag(COMMIT_Dirty, inode)) in jfs_commit_inode()
89 /* kernel allows writes to devices on read-only in jfs_commit_inode()
92 if (!special_file(inode->i_mode) && noisy) { in jfs_commit_inode()
93 jfs_err("jfs_commit_inode(0x%p) called on read-only volume", in jfs_commit_inode()
96 noisy--; in jfs_commit_inode()
101 tid = txBegin(inode->i_sb, COMMIT_INODE); in jfs_commit_inode()
102 mutex_lock(&JFS_IP(inode)->commit_mutex); in jfs_commit_inode()
107 if (inode->i_nlink && test_cflag(COMMIT_Dirty, inode)) in jfs_commit_inode()
108 rc = txCommit(tid, 1, &inode, wait ? COMMIT_SYNC : 0); in jfs_commit_inode()
111 mutex_unlock(&JFS_IP(inode)->commit_mutex); in jfs_commit_inode()
117 int wait = wbc->sync_mode == WB_SYNC_ALL; in jfs_write_inode()
119 if (inode->i_nlink == 0) in jfs_write_inode()
128 jfs_flush_journal(JFS_SBI(inode->i_sb)->log, wait); in jfs_write_inode()
134 return -EIO; in jfs_write_inode()
145 if (!inode->i_nlink && !is_bad_inode(inode)) { in jfs_evict_inode()
148 if (JFS_IP(inode)->fileset == FILESYSTEM_I) { in jfs_evict_inode()
149 struct inode *ipimap = JFS_SBI(inode->i_sb)->ipimap; in jfs_evict_inode()
150 truncate_inode_pages_final(&inode->i_data); in jfs_evict_inode()
155 if (ipimap && JFS_IP(ipimap)->i_imap) in jfs_evict_inode()
164 truncate_inode_pages_final(&inode->i_data); in jfs_evict_inode()
169 BUG_ON(!list_empty(&ji->anon_inode_list)); in jfs_evict_inode()
171 spin_lock_irq(&ji->ag_lock); in jfs_evict_inode()
172 if (ji->active_ag != -1) { in jfs_evict_inode()
173 struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; in jfs_evict_inode()
174 atomic_dec(&bmap->db_active[ji->active_ag]); in jfs_evict_inode()
175 ji->active_ag = -1; in jfs_evict_inode()
177 spin_unlock_irq(&ji->ag_lock); in jfs_evict_inode()
185 if (!special_file(inode->i_mode) && noisy) { in jfs_dirty_inode()
186 /* kernel allows writes to devices on read-only in jfs_dirty_inode()
189 jfs_err("jfs_dirty_inode called on read-only volume"); in jfs_dirty_inode()
191 noisy--; in jfs_dirty_inode()
207 s32 xlen = bh_result->b_size >> ip->i_blkbits; in jfs_get_block() local
217 if (((lblock64 << ip->i_sb->s_blocksize_bits) < ip->i_size) && in jfs_get_block()
218 (!xtLookup(ip, lblock64, xlen, &xflag, &xaddr, &xlen, 0)) && in jfs_get_block()
228 XADlength(&xad, xlen); in jfs_get_block()
236 map_bh(bh_result, ip->i_sb, xaddr); in jfs_get_block()
237 bh_result->b_size = xlen << ip->i_blkbits; in jfs_get_block()
246 if ((rc = extHint(ip, lblock64 << ip->i_sb->s_blocksize_bits, &xad))) in jfs_get_block()
248 rc = extAlloc(ip, xlen, lblock64, &xad, false); in jfs_get_block()
253 map_bh(bh_result, ip->i_sb, addressXAD(&xad)); in jfs_get_block()
254 bh_result->b_size = lengthXAD(&xad) << ip->i_blkbits; in jfs_get_block()
285 struct inode *inode = mapping->host; in jfs_write_failed()
287 if (to > inode->i_size) { in jfs_write_failed()
288 truncate_pagecache(inode, inode->i_size); in jfs_write_failed()
325 struct file *file = iocb->ki_filp; in jfs_direct_IO()
326 struct address_space *mapping = file->f_mapping; in jfs_direct_IO()
327 struct inode *inode = file->f_mapping->host; in jfs_direct_IO()
339 loff_t end = iocb->ki_pos + count; in jfs_direct_IO()
378 tid = txBegin(ip->i_sb, 0); in jfs_truncate_nolock()
386 mutex_lock(&JFS_IP(ip)->commit_mutex); in jfs_truncate_nolock()
392 mutex_unlock(&JFS_IP(ip)->commit_mutex); in jfs_truncate_nolock()
399 txCommit(tid, 1, &ip, 0); in jfs_truncate_nolock()
401 mutex_unlock(&JFS_IP(ip)->commit_mutex); in jfs_truncate_nolock()
407 jfs_info("jfs_truncate: size = 0x%lx", (ulong) ip->i_size); in jfs_truncate()
409 block_truncate_page(ip->i_mapping, ip->i_size, jfs_get_block); in jfs_truncate()
412 jfs_truncate_nolock(ip, ip->i_size); in jfs_truncate()