LKML Archive on lore.kernel.org help / color / mirror / Atom feed
From: Mark Fasheh <mfasheh@suse.de> To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, Mark Fasheh <mfasheh@suse.de> Subject: [PATCH 37/76] fs/hfs: Use inode_sb() helper instead of inode->i_sb Date: Tue, 8 May 2018 11:03:57 -0700 [thread overview] Message-ID: <20180508180436.716-38-mfasheh@suse.de> (raw) In-Reply-To: <20180508180436.716-1-mfasheh@suse.de> Signed-off-by: Mark Fasheh <mfasheh@suse.de> --- fs/hfs/attr.c | 4 ++-- fs/hfs/catalog.c | 10 +++++----- fs/hfs/dir.c | 11 ++++++----- fs/hfs/extent.c | 10 +++++----- fs/hfs/inode.c | 32 ++++++++++++++++---------------- 5 files changed, 34 insertions(+), 33 deletions(-) diff --git a/fs/hfs/attr.c b/fs/hfs/attr.c index 74fa62643136..60075ee27192 100644 --- a/fs/hfs/attr.c +++ b/fs/hfs/attr.c @@ -30,7 +30,7 @@ static int __hfs_setxattr(struct inode *inode, enum hfs_xattr_type type, if (!S_ISREG(inode->i_mode) || HFS_IS_RSRC(inode)) return -EOPNOTSUPP; - res = hfs_find_init(HFS_SB(inode->i_sb)->cat_tree, &fd); + res = hfs_find_init(HFS_SB(inode_sb(inode))->cat_tree, &fd); if (res) return res; fd.search_key->cat = HFS_I(inode)->cat_key; @@ -77,7 +77,7 @@ static ssize_t __hfs_getxattr(struct inode *inode, enum hfs_xattr_type type, return -EOPNOTSUPP; if (size) { - res = hfs_find_init(HFS_SB(inode->i_sb)->cat_tree, &fd); + res = hfs_find_init(HFS_SB(inode_sb(inode))->cat_tree, &fd); if (res) return res; fd.search_key->cat = HFS_I(inode)->cat_key; diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c index 8a66405b0f8b..790d488a2c24 100644 --- a/fs/hfs/catalog.c +++ b/fs/hfs/catalog.c @@ -56,8 +56,8 @@ static int hfs_cat_build_record(hfs_cat_rec *rec, u32 cnid, struct inode *inode) rec->file.CrDat = mtime; rec->file.MdDat = mtime; rec->file.BkDat = 0; - rec->file.UsrWds.fdType = HFS_SB(inode->i_sb)->s_type; - rec->file.UsrWds.fdCreator = HFS_SB(inode->i_sb)->s_creator; + rec->file.UsrWds.fdType = HFS_SB(inode_sb(inode))->s_type; + rec->file.UsrWds.fdCreator = HFS_SB(inode_sb(inode))->s_creator; return sizeof(struct hfs_cat_file); } } @@ -92,7 +92,7 @@ int hfs_cat_create(u32 cnid, struct inode *dir, const struct qstr *str, struct i if (dir->i_size >= HFS_MAX_VALENCE) return -ENOSPC; - sb = dir->i_sb; + sb = inode_sb(dir); err = hfs_find_init(HFS_SB(sb)->cat_tree, &fd); if (err) return err; @@ -218,7 +218,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, const struct qstr *str) int res, type; hfs_dbg(CAT_MOD, "delete_cat: %s,%u\n", str ? str->name : NULL, cnid); - sb = dir->i_sb; + sb = inode_sb(dir); res = hfs_find_init(HFS_SB(sb)->cat_tree, &fd); if (res) return res; @@ -289,7 +289,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name, hfs_dbg(CAT_MOD, "rename_cat: %u - %lu,%s - %lu,%s\n", cnid, src_dir->i_ino, src_name->name, dst_dir->i_ino, dst_name->name); - sb = src_dir->i_sb; + sb = inode_sb(src_dir); err = hfs_find_init(HFS_SB(sb)->cat_tree, &src_fd); if (err) return err; diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 75b254280ff6..ae29580b3d0c 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -25,10 +25,11 @@ static struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry, struct inode *inode = NULL; int res; - res = hfs_find_init(HFS_SB(dir->i_sb)->cat_tree, &fd); + res = hfs_find_init(HFS_SB(inode_sb(dir))->cat_tree, &fd); if (res) return ERR_PTR(res); - hfs_cat_build_key(dir->i_sb, fd.search_key, dir->i_ino, &dentry->d_name); + hfs_cat_build_key(inode_sb(dir), fd.search_key, dir->i_ino, + &dentry->d_name); res = hfs_brec_read(&fd, &rec, sizeof(rec)); if (res) { hfs_find_exit(&fd); @@ -39,7 +40,7 @@ static struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry, } return ERR_PTR(res); } - inode = hfs_iget(dir->i_sb, &fd.search_key->cat, &rec); + inode = hfs_iget(inode_sb(dir), &fd.search_key->cat, &rec); hfs_find_exit(&fd); if (!inode) return ERR_PTR(-EACCES); @@ -54,7 +55,7 @@ static struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry, static int hfs_readdir(struct file *file, struct dir_context *ctx) { struct inode *inode = file_inode(file); - struct super_block *sb = inode->i_sb; + struct super_block *sb = inode_sb(inode); int len, err; char strbuf[HFS_MAX_NAMELEN]; union hfs_cat_rec entry; @@ -305,7 +306,7 @@ static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry, old_dir, &old_dentry->d_name, new_dir, &new_dentry->d_name); if (!res) - hfs_cat_build_key(old_dir->i_sb, + hfs_cat_build_key(inode_sb(old_dir), (btree_key *)&HFS_I(d_inode(old_dentry))->cat_key, new_dir->i_ino, &new_dentry->d_name); return res; diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c index 5d0182654580..03e1f49fee30 100644 --- a/fs/hfs/extent.c +++ b/fs/hfs/extent.c @@ -134,7 +134,7 @@ int hfs_ext_write_extent(struct inode *inode) int res = 0; if (HFS_I(inode)->flags & HFS_FLG_EXT_DIRTY) { - res = hfs_find_init(HFS_SB(inode->i_sb)->ext_tree, &fd); + res = hfs_find_init(HFS_SB(inode_sb(inode))->ext_tree, &fd); if (res) return res; res = __hfs_ext_write_extent(inode, &fd); @@ -193,7 +193,7 @@ static int hfs_ext_read_extent(struct inode *inode, u16 block) block < HFS_I(inode)->cached_start + HFS_I(inode)->cached_blocks) return 0; - res = hfs_find_init(HFS_SB(inode->i_sb)->ext_tree, &fd); + res = hfs_find_init(HFS_SB(inode_sb(inode))->ext_tree, &fd); if (!res) { res = __hfs_ext_cache_extent(&fd, inode, block); hfs_find_exit(&fd); @@ -336,7 +336,7 @@ int hfs_get_block(struct inode *inode, sector_t block, u16 dblock, ablock; int res; - sb = inode->i_sb; + sb = inode_sb(inode); /* Convert inode block to disk allocation block */ ablock = (u32)block / HFS_SB(sb)->fs_div; @@ -384,7 +384,7 @@ int hfs_get_block(struct inode *inode, sector_t block, int hfs_extend_file(struct inode *inode) { - struct super_block *sb = inode->i_sb; + struct super_block *sb = inode_sb(inode); u32 start, len, goal; int res; @@ -469,7 +469,7 @@ int hfs_extend_file(struct inode *inode) void hfs_file_truncate(struct inode *inode) { - struct super_block *sb = inode->i_sb; + struct super_block *sb = inode_sb(inode); struct hfs_find_data fd; u16 blk_cnt, alloc_cnt, start; u32 size; diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 2538b49cc349..1d8e35f3f72d 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c @@ -72,7 +72,7 @@ static sector_t hfs_bmap(struct address_space *mapping, sector_t block) static int hfs_releasepage(struct page *page, gfp_t mask) { struct inode *inode = page->mapping->host; - struct super_block *sb = inode->i_sb; + struct super_block *sb = inode_sb(inode); struct hfs_btree *tree; struct hfs_bnode *node; u32 nidx; @@ -181,7 +181,7 @@ const struct address_space_operations hfs_aops = { */ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t mode) { - struct super_block *sb = dir->i_sb; + struct super_block *sb = inode_sb(dir); struct inode *inode = new_inode(sb); if (!inode) return NULL; @@ -207,7 +207,7 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t inode->i_op = &hfs_dir_inode_operations; inode->i_fop = &hfs_dir_operations; inode->i_mode |= S_IRWXUGO; - inode->i_mode &= ~HFS_SB(inode->i_sb)->s_dir_umask; + inode->i_mode &= ~HFS_SB(inode_sb(inode))->s_dir_umask; } else if (S_ISREG(mode)) { HFS_I(inode)->clump_blocks = HFS_SB(sb)->clumpablks; HFS_SB(sb)->file_count++; @@ -219,7 +219,7 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t inode->i_mode |= S_IRUGO|S_IXUGO; if (mode & S_IWUSR) inode->i_mode |= S_IWUGO; - inode->i_mode &= ~HFS_SB(inode->i_sb)->s_file_umask; + inode->i_mode &= ~HFS_SB(inode_sb(inode))->s_file_umask; HFS_I(inode)->phys_size = 0; HFS_I(inode)->alloc_blocks = 0; HFS_I(inode)->first_blocks = 0; @@ -238,7 +238,7 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t void hfs_delete_inode(struct inode *inode) { - struct super_block *sb = inode->i_sb; + struct super_block *sb = inode_sb(inode); hfs_dbg(INODE, "delete_inode: %lu\n", inode->i_ino); if (S_ISDIR(inode->i_mode)) { @@ -265,7 +265,7 @@ void hfs_delete_inode(struct inode *inode) void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext, __be32 __log_size, __be32 phys_size, u32 clump_size) { - struct super_block *sb = inode->i_sb; + struct super_block *sb = inode_sb(inode); u32 log_size = be32_to_cpu(__log_size); u16 count; int i; @@ -313,7 +313,7 @@ static int hfs_test_inode(struct inode *inode, void *data) static int hfs_read_inode(struct inode *inode, void *data) { struct hfs_iget_data *idata = data; - struct hfs_sb_info *hsb = HFS_SB(inode->i_sb); + struct hfs_sb_info *hsb = HFS_SB(inode_sb(inode)); hfs_cat_rec *rec; HFS_I(inode)->flags = 0; @@ -412,7 +412,7 @@ void hfs_inode_write_fork(struct inode *inode, struct hfs_extent *ext, *log_size = cpu_to_be32(inode->i_size); if (phys_size) *phys_size = cpu_to_be32(HFS_I(inode)->alloc_blocks * - HFS_SB(inode->i_sb)->alloc_blksz); + HFS_SB(inode_sb(inode))->alloc_blksz); } int hfs_write_inode(struct inode *inode, struct writeback_control *wbc) @@ -432,10 +432,10 @@ int hfs_write_inode(struct inode *inode, struct writeback_control *wbc) case HFS_ROOT_CNID: break; case HFS_EXT_CNID: - hfs_btree_write(HFS_SB(inode->i_sb)->ext_tree); + hfs_btree_write(HFS_SB(inode_sb(inode))->ext_tree); return 0; case HFS_CAT_CNID: - hfs_btree_write(HFS_SB(inode->i_sb)->cat_tree); + hfs_btree_write(HFS_SB(inode_sb(inode))->cat_tree); return 0; default: BUG(); @@ -449,7 +449,7 @@ int hfs_write_inode(struct inode *inode, struct writeback_control *wbc) if (!main_inode->i_nlink) return 0; - if (hfs_find_init(HFS_SB(main_inode->i_sb)->cat_tree, &fd)) + if (hfs_find_init(HFS_SB(inode_sb(main_inode))->cat_tree, &fd)) /* panic? */ return -EIO; @@ -518,11 +518,11 @@ static struct dentry *hfs_file_lookup(struct inode *dir, struct dentry *dentry, if (inode) goto out; - inode = new_inode(dir->i_sb); + inode = new_inode(inode_sb(dir)); if (!inode) return ERR_PTR(-ENOMEM); - res = hfs_find_init(HFS_SB(dir->i_sb)->cat_tree, &fd); + res = hfs_find_init(HFS_SB(inode_sb(dir))->cat_tree, &fd); if (res) { iput(inode); return ERR_PTR(res); @@ -568,7 +568,7 @@ static int hfs_file_open(struct inode *inode, struct file *file) static int hfs_file_release(struct inode *inode, struct file *file) { - //struct super_block *sb = inode->i_sb; + //struct super_block *sb = inode_sb(inode); if (HFS_IS_RSRC(inode)) inode = HFS_I(inode)->rsrc_inode; @@ -604,7 +604,7 @@ static int hfs_file_release(struct inode *inode, struct file *file) int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr) { struct inode *inode = d_inode(dentry); - struct hfs_sb_info *hsb = HFS_SB(inode->i_sb); + struct hfs_sb_info *hsb = HFS_SB(inode_sb(inode)); int error; error = setattr_prepare(dentry, attr); /* basic permission checks */ @@ -665,7 +665,7 @@ static int hfs_file_fsync(struct file *filp, loff_t start, loff_t end, ret = write_inode_now(inode, 0); /* sync the superblock to buffers */ - sb = inode->i_sb; + sb = inode_sb(inode); flush_delayed_work(&HFS_SB(sb)->mdb_work); /* .. finally sync the buffers to disk */ err = sync_blockdev(sb->s_bdev); -- 2.15.1
next prev parent reply other threads:[~2018-05-08 18:30 UTC|newest] Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-05-08 18:03 [RFC][PATCH 0/76] vfs: 'views' for filesystems with more than one root Mark Fasheh 2018-05-08 18:03 ` [PATCH 01/76] vfs: Introduce struct fs_view Mark Fasheh 2018-05-08 18:03 ` [PATCH 02/76] arch: Use inode_sb() helper instead of inode->i_sb Mark Fasheh 2018-05-08 18:03 ` [PATCH 03/76] drivers: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 04/76] fs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 05/76] include: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 06/76] ipc: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 07/76] kernel: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 08/76] mm: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 09/76] net: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 10/76] security: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 11/76] fs/9p: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 12/76] fs/adfs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 13/76] fs/affs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 14/76] fs/afs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 15/76] fs/autofs4: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 16/76] fs/befs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 17/76] fs/bfs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 18/76] fs/btrfs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 19/76] fs/ceph: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 20/76] fs/cifs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 21/76] fs/coda: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 22/76] fs/configfs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 23/76] fs/cramfs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 24/76] fs/crypto: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 25/76] fs/ecryptfs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 26/76] fs/efivarfs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 27/76] fs/efs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 28/76] fs/exofs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 29/76] fs/exportfs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 30/76] fs/ext2: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 31/76] fs/ext4: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 32/76] fs/f2fs: " Mark Fasheh 2018-05-10 10:10 ` Chao Yu 2018-05-08 18:03 ` [PATCH 33/76] fs/fat: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 34/76] fs/freevxfs: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 35/76] fs/fuse: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 36/76] fs/gfs2: " Mark Fasheh 2018-05-08 18:03 ` Mark Fasheh [this message] 2018-05-08 18:03 ` [PATCH 38/76] fs/hfsplus: " Mark Fasheh 2018-05-08 18:03 ` [PATCH 39/76] fs/hostfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 40/76] fs/hpfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 41/76] fs/hugetlbfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 42/76] fs/isofs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 43/76] fs/jbd2: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 44/76] fs/jffs2: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 45/76] fs/jfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 46/76] fs/kernfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 47/76] fs/lockd: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 48/76] fs/minix: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 49/76] fs/nfsd: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 50/76] fs/nfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 51/76] fs/nilfs2: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 52/76] fs/notify: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 53/76] fs/ntfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 54/76] fs/ocfs2: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 55/76] fs/omfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 56/76] fs/openpromfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 57/76] fs/orangefs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 58/76] fs/overlayfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 59/76] fs/proc: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 60/76] fs/qnx4: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 61/76] fs/qnx6: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 62/76] fs/quota: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 63/76] fs/ramfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 64/76] fs/read: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 65/76] fs/reiserfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 66/76] fs/romfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 67/76] fs/squashfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 68/76] fs/sysv: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 69/76] fs/ubifs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 70/76] fs/udf: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 71/76] fs/ufs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 72/76] fs/xfs: " Mark Fasheh 2018-05-08 18:04 ` [PATCH 73/76] vfs: Move s_dev to to struct fs_view Mark Fasheh 2018-05-08 18:04 ` [PATCH 74/76] fs: Use fs_view device from struct inode Mark Fasheh 2018-05-08 18:04 ` [PATCH 75/76] fs: Use fs view device from struct super_block Mark Fasheh 2018-05-08 18:04 ` [PATCH 76/76] btrfs: Use fs_view in roots, point inodes to it Mark Fasheh 2018-05-08 23:38 ` [RFC][PATCH 0/76] vfs: 'views' for filesystems with more than one root Dave Chinner 2018-05-09 2:06 ` Jeff Mahoney 2018-05-09 6:41 ` Dave Chinner 2018-06-05 20:17 ` Jeff Mahoney 2018-06-06 9:49 ` Amir Goldstein 2018-06-06 20:42 ` Mark Fasheh 2018-06-07 6:06 ` Amir Goldstein 2018-06-07 20:44 ` Mark Fasheh 2018-06-06 21:19 ` Jeff Mahoney 2018-06-07 6:17 ` Amir Goldstein
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20180508180436.716-38-mfasheh@suse.de \ --to=mfasheh@suse.de \ --cc=linux-btrfs@vger.kernel.org \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).