From 9f8fd53cd05596f6792f769c9fd5fd2b0d624507 Mon Sep 17 00:00:00 2001 From: Martin Brandenburg Date: Thu, 31 May 2018 16:36:59 +0000 Subject: orangefs: revamp block sizes Now the superblock block size is PAGE_SIZE. The inode block size is PAGE_SIZE for directories and symlinks, but is the server-reported block size for regular files. The block size in the OrangeFS private inode is now deleted. Stat now reports PAGE_SIZE for directories and symlinks and the server-reported block size for regular files. The user-space visible change is that the block size for directores and symlinks and the superblock is now PAGE_SIZE rather than the size of the client-core shared memory buffers, which was typically four megabytes. Reported-by: Becky Ligon Signed-off-by: Martin Brandenburg Cc: hubcap@omnibond.com Cc: walt@omnibond.com Signed-off-by: Mike Marshall --- fs/orangefs/inode.c | 6 ++---- fs/orangefs/orangefs-kernel.h | 1 - fs/orangefs/orangefs-utils.c | 12 ++++-------- fs/orangefs/super.c | 4 ++-- 4 files changed, 8 insertions(+), 15 deletions(-) (limited to 'fs') diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index 79c61da8b1bc..b583fbf90665 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -20,8 +20,8 @@ static int read_one_page(struct page *page) int max_block; ssize_t bytes_read = 0; struct inode *inode = page->mapping->host; - const __u32 blocksize = PAGE_SIZE; /* inode->i_blksize */ - const __u32 blockbits = PAGE_SHIFT; /* inode->i_blkbits */ + const __u32 blocksize = PAGE_SIZE; + const __u32 blockbits = PAGE_SHIFT; struct iov_iter to; struct bio_vec bv = {.bv_page = page, .bv_len = PAGE_SIZE}; @@ -262,7 +262,6 @@ int orangefs_getattr(const struct path *path, struct kstat *stat, /* override block size reported to stat */ orangefs_inode = ORANGEFS_I(inode); - stat->blksize = orangefs_inode->blksize; if (request_mask & STATX_SIZE) stat->result_mask = STATX_BASIC_STATS; @@ -325,7 +324,6 @@ static int orangefs_init_iops(struct inode *inode) case S_IFREG: inode->i_op = &orangefs_file_inode_operations; inode->i_fop = &orangefs_file_operations; - inode->i_blkbits = PAGE_SHIFT; break; case S_IFLNK: inode->i_op = &orangefs_symlink_inode_operations; diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index c29bb0ebc6bb..004511617b6d 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h @@ -182,7 +182,6 @@ static inline void set_op_state_purged(struct orangefs_kernel_op_s *op) struct orangefs_inode_s { struct orangefs_object_kref refn; char link_target[ORANGEFS_NAME_MAX]; - __s64 blksize; /* * Reading/Writing Extended attributes need to acquire the appropriate * reader/writer semaphore on the orangefs_inode_s structure. diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c index 00fadaf0da8f..89729040c5b4 100644 --- a/fs/orangefs/orangefs-utils.c +++ b/fs/orangefs/orangefs-utils.c @@ -275,7 +275,7 @@ int orangefs_inode_getattr(struct inode *inode, int new, int bypass, { struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode); struct orangefs_kernel_op_s *new_op; - loff_t inode_size, rounded_up_size; + loff_t inode_size; int ret, type; gossip_debug(GOSSIP_UTILS_DEBUG, "%s: called on inode %pU\n", __func__, @@ -330,22 +330,19 @@ int orangefs_inode_getattr(struct inode *inode, int new, int bypass, if (request_mask & STATX_SIZE || new) { inode_size = (loff_t)new_op-> downcall.resp.getattr.attributes.size; - rounded_up_size = - (inode_size + (4096 - (inode_size % 4096))); inode->i_size = inode_size; - orangefs_inode->blksize = - new_op->downcall.resp.getattr.attributes.blksize; + inode->i_blkbits = ffs(new_op->downcall.resp.getattr. + attributes.blksize); spin_lock(&inode->i_lock); inode->i_bytes = inode_size; inode->i_blocks = - (unsigned long)(rounded_up_size / 512); + (inode_size + 512 - inode_size % 512)/512; spin_unlock(&inode->i_lock); } break; case S_IFDIR: if (request_mask & STATX_SIZE || new) { inode->i_size = PAGE_SIZE; - orangefs_inode->blksize = i_blocksize(inode); spin_lock(&inode->i_lock); inode_set_bytes(inode, inode->i_size); spin_unlock(&inode->i_lock); @@ -356,7 +353,6 @@ int orangefs_inode_getattr(struct inode *inode, int new, int bypass, if (new) { inode->i_size = (loff_t)strlen(new_op-> downcall.resp.getattr.link_target); - orangefs_inode->blksize = i_blocksize(inode); ret = strscpy(orangefs_inode->link_target, new_op->downcall.resp.getattr.link_target, ORANGEFS_NAME_MAX); diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c index 10796d3fe27d..fc34146c56dc 100644 --- a/fs/orangefs/super.c +++ b/fs/orangefs/super.c @@ -423,8 +423,8 @@ static int orangefs_fill_sb(struct super_block *sb, sb->s_op = &orangefs_s_ops; sb->s_d_op = &orangefs_dentry_operations; - sb->s_blocksize = orangefs_bufmap_size_query(); - sb->s_blocksize_bits = orangefs_bufmap_shift_query(); + sb->s_blocksize = PAGE_SIZE; + sb->s_blocksize_bits = PAGE_SHIFT; sb->s_maxbytes = MAX_LFS_FILESIZE; root_object.khandle = ORANGEFS_SB(sb)->root_khandle; -- cgit v1.2.3 From ec62e95ae3f1c5bb23c7fba849fa306ad315ab10 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 5 Apr 2018 11:50:10 +0100 Subject: orangefs: make struct orangefs_file_vm_ops static The struct orangefs_file_vm_ops is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: fs/orangefs/file.c:547:35: warning: symbol 'orangefs_file_vm_ops' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Mike Marshall --- fs/orangefs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index 26358efbf794..84f44365bfb3 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -544,7 +544,7 @@ static int orangefs_fault(struct vm_fault *vmf) return filemap_fault(vmf); } -const struct vm_operations_struct orangefs_file_vm_ops = { +static const struct vm_operations_struct orangefs_file_vm_ops = { .fault = orangefs_fault, .map_pages = filemap_map_pages, .page_mkwrite = filemap_page_mkwrite, -- cgit v1.2.3 From 7f54910fa8dfe504f2e1563f4f6ddc3294dfbf3a Mon Sep 17 00:00:00 2001 From: Martin Brandenburg Date: Thu, 31 May 2018 16:37:00 +0000 Subject: orangefs: report attributes_mask and attributes for statx OrangeFS formerly failed to set attributes_mask with the result that software could not see immutable and append flags present in the filesystem. Reported-by: Becky Ligon Signed-off-by: Martin Brandenburg Fixes: 68a24a6cc4a6 ("orangefs: implement statx") Cc: stable@vger.kernel.org Cc: hubcap@omnibond.com Signed-off-by: Mike Marshall --- fs/orangefs/inode.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'fs') diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index b583fbf90665..f301e4957659 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -268,6 +268,13 @@ int orangefs_getattr(const struct path *path, struct kstat *stat, else stat->result_mask = STATX_BASIC_STATS & ~STATX_SIZE; + + stat->attributes_mask = STATX_ATTR_IMMUTABLE | + STATX_ATTR_APPEND; + if (inode->i_flags & S_IMMUTABLE) + stat->attributes |= STATX_ATTR_IMMUTABLE; + if (inode->i_flags & S_APPEND) + stat->attributes |= STATX_ATTR_APPEND; } return ret; } -- cgit v1.2.3 From f6a4b4c9d07dda90c7c29dae96d6119ac6425dca Mon Sep 17 00:00:00 2001 From: Martin Brandenburg Date: Thu, 31 May 2018 16:36:58 +0000 Subject: orangefs: set i_size on new symlink As long as a symlink inode remains in-core, the destination (and therefore size) will not be re-fetched from the server, as it cannot change. The original implementation of the attribute cache assumed that setting the expiry time in the past was sufficient to cause a re-fetch of all attributes on the next getattr. That does not work in this case. The bug manifested itself as follows. When the command sequence touch foo; ln -s foo bar; ls -l bar is run, the output was lrwxrwxrwx. 1 fedora fedora 4906 Apr 24 19:10 bar -> foo However, after a re-mount, ls -l bar produces lrwxrwxrwx. 1 fedora fedora 3 Apr 24 19:10 bar -> foo After this commit, even before a re-mount, the output is lrwxrwxrwx. 1 fedora fedora 3 Apr 24 19:10 bar -> foo Reported-by: Becky Ligon Signed-off-by: Martin Brandenburg Fixes: 71680c18c8f2 ("orangefs: Cache getattr results.") Cc: stable@vger.kernel.org Cc: hubcap@omnibond.com Signed-off-by: Mike Marshall --- fs/orangefs/namei.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'fs') diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c index 1b5707c44c3f..e026bee02a66 100644 --- a/fs/orangefs/namei.c +++ b/fs/orangefs/namei.c @@ -326,6 +326,13 @@ static int orangefs_symlink(struct inode *dir, ret = PTR_ERR(inode); goto out; } + /* + * This is necessary because orangefs_inode_getattr will not + * re-read symlink size as it is impossible for it to change. + * Invalidating the cache does not help. orangefs_new_inode + * does not set the correct size (it does not know symname). + */ + inode->i_size = strlen(symname); gossip_debug(GOSSIP_NAME_DEBUG, "Assigned symlink inode new number of %pU\n", -- cgit v1.2.3 From 95f5f88f8900c09eb534c8cb42d75ff3cf7ea96c Mon Sep 17 00:00:00 2001 From: Mike Marshall Date: Fri, 11 May 2018 17:11:48 -0400 Subject: orangefs: formatting cleanups Signed-off-by: Mike Marshall --- fs/orangefs/devorangefs-req.c | 17 ++++++++++------- fs/orangefs/file.c | 2 +- fs/orangefs/inode.c | 44 +++++++++++++++++++++++++------------------ fs/orangefs/orangefs-bufmap.c | 4 ++-- fs/orangefs/orangefs-utils.c | 18 +++++++++++------- fs/orangefs/super.c | 9 +++++---- 6 files changed, 55 insertions(+), 39 deletions(-) (limited to 'fs') diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c index 66369ec90020..74b37cbbd5d4 100644 --- a/fs/orangefs/devorangefs-req.c +++ b/fs/orangefs/devorangefs-req.c @@ -281,14 +281,17 @@ restart: ret = copy_to_user(buf, &proto_ver, sizeof(__s32)); if (ret != 0) goto error; - ret = copy_to_user(buf+sizeof(__s32), &magic, sizeof(__s32)); + ret = copy_to_user(buf + sizeof(__s32), &magic, sizeof(__s32)); if (ret != 0) goto error; - ret = copy_to_user(buf+2 * sizeof(__s32), &cur_op->tag, sizeof(__u64)); + ret = copy_to_user(buf + 2 * sizeof(__s32), + &cur_op->tag, + sizeof(__u64)); if (ret != 0) goto error; - ret = copy_to_user(buf+2*sizeof(__s32)+sizeof(__u64), &cur_op->upcall, - sizeof(struct orangefs_upcall_s)); + ret = copy_to_user(buf + 2 * sizeof(__s32) + sizeof(__u64), + &cur_op->upcall, + sizeof(struct orangefs_upcall_s)); if (ret != 0) goto error; @@ -381,7 +384,7 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb, (unsigned int) MAX_DEV_REQ_DOWNSIZE); return -EFAULT; } - + if (!copy_from_iter_full(&head, head_size, iter)) { gossip_err("%s: failed to copy head.\n", __func__); return -EFAULT; @@ -426,7 +429,7 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb, goto wakeup; /* - * We've successfully peeled off the head and the downcall. + * We've successfully peeled off the head and the downcall. * Something has gone awry if total doesn't equal the * sum of head_size, downcall_size and trailer_size. */ @@ -477,7 +480,7 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb, wakeup: /* * Return to vfs waitqueue, and back to service_operation - * through wait_for_matching_downcall. + * through wait_for_matching_downcall. */ spin_lock(&op->lock); if (unlikely(op_is_cancel(op))) { diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index 84f44365bfb3..db0b52187cbc 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -162,7 +162,7 @@ populate_shared_memory: else ret = 0; break; - /* + /* * If the op was in progress when the interrupt * occurred, then the client-core was able to * trigger the write. diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index f301e4957659..d6db252e6200 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -181,16 +181,15 @@ static int orangefs_setattr_size(struct inode *inode, struct iattr *iattr) new_op->upcall.req.truncate.refn = orangefs_inode->refn; new_op->upcall.req.truncate.size = (__s64) iattr->ia_size; - ret = service_operation(new_op, __func__, - get_interruptible_flag(inode)); + ret = service_operation(new_op, + __func__, + get_interruptible_flag(inode)); /* * the truncate has no downcall members to retrieve, but * the status value tells us if it went through ok or not */ - gossip_debug(GOSSIP_INODE_DEBUG, - "orangefs: orangefs_truncate got return value of %d\n", - ret); + gossip_debug(GOSSIP_INODE_DEBUG, "%s: ret:%d:\n", __func__, ret); op_release(new_op); @@ -212,8 +211,9 @@ int orangefs_setattr(struct dentry *dentry, struct iattr *iattr) struct inode *inode = dentry->d_inode; gossip_debug(GOSSIP_INODE_DEBUG, - "orangefs_setattr: called on %pd\n", - dentry); + "%s: called on %pd\n", + __func__, + dentry); ret = setattr_prepare(dentry, iattr); if (ret) @@ -230,15 +230,16 @@ int orangefs_setattr(struct dentry *dentry, struct iattr *iattr) ret = orangefs_inode_setattr(inode, iattr); gossip_debug(GOSSIP_INODE_DEBUG, - "orangefs_setattr: inode_setattr returned %d\n", - ret); + "%s: orangefs_inode_setattr returned %d\n", + __func__, + ret); if (!ret && (iattr->ia_valid & ATTR_MODE)) /* change mod on a file that has ACLs */ ret = posix_acl_chmod(inode, inode->i_mode); out: - gossip_debug(GOSSIP_INODE_DEBUG, "orangefs_setattr: returning %d\n", ret); + gossip_debug(GOSSIP_INODE_DEBUG, "%s: ret:%d:\n", __func__, ret); return ret; } @@ -312,7 +313,7 @@ int orangefs_update_time(struct inode *inode, struct timespec *time, int flags) return orangefs_inode_setattr(inode, &iattr); } -/* ORANGEDS2 implementation of VFS inode operations for files */ +/* ORANGEFS2 implementation of VFS inode operations for files */ static const struct inode_operations orangefs_file_inode_operations = { .get_acl = orangefs_get_acl, .set_acl = orangefs_set_acl, @@ -350,8 +351,8 @@ static int orangefs_init_iops(struct inode *inode) } /* - * Given a ORANGEFS object identifier (fsid, handle), convert it into a ino_t type - * that will be used as a hash-index from where the handle will + * Given an ORANGEFS object identifier (fsid, handle), convert it into + * a ino_t type that will be used as a hash-index from where the handle will * be searched for in the VFS hash table of inodes. */ static inline ino_t orangefs_handle_hash(struct orangefs_object_kref *ref) @@ -381,8 +382,10 @@ static int orangefs_test_inode(struct inode *inode, void *data) struct orangefs_inode_s *orangefs_inode = NULL; orangefs_inode = ORANGEFS_I(inode); - return (!ORANGEFS_khandle_cmp(&(orangefs_inode->refn.khandle), &(ref->khandle)) - && orangefs_inode->refn.fs_id == ref->fs_id); + /* test handles and fs_ids... */ + return (!ORANGEFS_khandle_cmp(&(orangefs_inode->refn.khandle), + &(ref->khandle)) && + orangefs_inode->refn.fs_id == ref->fs_id); } /* @@ -390,16 +393,21 @@ static int orangefs_test_inode(struct inode *inode, void *data) * file handle. * * @sb: the file system super block instance. - * @ref: The ORANGEFS object for which we are trying to locate an inode structure. + * @ref: The ORANGEFS object for which we are trying to locate an inode. */ -struct inode *orangefs_iget(struct super_block *sb, struct orangefs_object_kref *ref) +struct inode *orangefs_iget(struct super_block *sb, + struct orangefs_object_kref *ref) { struct inode *inode = NULL; unsigned long hash; int error; hash = orangefs_handle_hash(ref); - inode = iget5_locked(sb, hash, orangefs_test_inode, orangefs_set_inode, ref); + inode = iget5_locked(sb, + hash, + orangefs_test_inode, + orangefs_set_inode, + ref); if (!inode || !(inode->i_state & I_NEW)) return inode; diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c index 4f927023d095..e3302f8d6429 100644 --- a/fs/orangefs/orangefs-bufmap.c +++ b/fs/orangefs/orangefs-bufmap.c @@ -184,7 +184,7 @@ orangefs_bufmap_free(struct orangefs_bufmap *bufmap) } /* - * XXX: Can the size and shift change while the caller gives up the + * XXX: Can the size and shift change while the caller gives up the * XXX: lock between calling this and doing something useful? */ @@ -496,7 +496,7 @@ void orangefs_readdir_index_put(int buffer_index) } /* - * we've been handed an iovec, we need to copy it to + * we've been handed an iovec, we need to copy it to * the shared memory descriptor at "buffer_index". */ int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter, diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c index 89729040c5b4..804c8a261e4b 100644 --- a/fs/orangefs/orangefs-utils.c +++ b/fs/orangefs/orangefs-utils.c @@ -183,9 +183,9 @@ static inline int copy_attributes_from_inode(struct inode *inode, attrs->mask |= ORANGEFS_ATTR_SYS_CTIME; /* - * ORANGEFS cannot set size with a setattr operation. Probably not likely - * to be requested through the VFS, but just in case, don't worry about - * ATTR_SIZE + * ORANGEFS cannot set size with a setattr operation. Probably not + * likely to be requested through the VFS, but just in case, don't + * worry about ATTR_SIZE */ if (iattr->ia_valid & ATTR_MODE) { @@ -200,14 +200,16 @@ static inline int copy_attributes_from_inode(struct inode *inode, tmp_mode -= S_ISVTX; } else { gossip_debug(GOSSIP_UTILS_DEBUG, - "User attempted to set sticky bit on non-root directory; returning EINVAL.\n"); + "%s: setting sticky bit not supported.\n", + __func__); return -EINVAL; } } if (tmp_mode & (S_ISUID)) { gossip_debug(GOSSIP_UTILS_DEBUG, - "Attempting to set setuid bit (not supported); returning EINVAL.\n"); + "%s: setting setuid bit not supported.\n", + __func__); return -EINVAL; } @@ -521,7 +523,9 @@ int orangefs_normalize_to_errno(__s32 error_code) error_code = -ETIMEDOUT; } else { /* assume a default error code */ - gossip_err("orangefs: warning: got error code without errno equivalent: %d.\n", error_code); + gossip_err("%s: bad error code :%d:.\n", + __func__, + error_code); error_code = -EINVAL; } @@ -538,7 +542,7 @@ int orangefs_normalize_to_errno(__s32 error_code) * there is a bug somewhere. */ } else { - gossip_err("orangefs: orangefs_normalize_to_errno: got error code which is not from ORANGEFS.\n"); + gossip_err("%s: unknown error code.\n", __func__); error_code = -EINVAL; } return error_code; diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c index fc34146c56dc..dfaee90d30bd 100644 --- a/fs/orangefs/super.c +++ b/fs/orangefs/super.c @@ -156,9 +156,10 @@ static int orangefs_statfs(struct dentry *dentry, struct kstatfs *buf) sb = dentry->d_sb; gossip_debug(GOSSIP_SUPER_DEBUG, - "orangefs_statfs: called on sb %p (fs_id is %d)\n", - sb, - (int)(ORANGEFS_SB(sb)->fs_id)); + "%s: called on sb %p (fs_id is %d)\n", + __func__, + sb, + (int)(ORANGEFS_SB(sb)->fs_id)); new_op = op_alloc(ORANGEFS_VFS_OP_STATFS); if (!new_op) @@ -198,7 +199,7 @@ static int orangefs_statfs(struct dentry *dentry, struct kstatfs *buf) out_op_release: op_release(new_op); - gossip_debug(GOSSIP_SUPER_DEBUG, "orangefs_statfs: returning %d\n", ret); + gossip_debug(GOSSIP_SUPER_DEBUG, "%s: returning %d\n", __func__, ret); return ret; } -- cgit v1.2.3 From 817e9b4d9e660761e1e613aa294bf77d2e7c7310 Mon Sep 17 00:00:00 2001 From: Mike Marshall Date: Fri, 1 Jun 2018 12:19:45 -0400 Subject: orangefs: specify user pointers when using dev_map_desc and bufmap Sparse lead me to the dev_map_desc one and Al Viro lead me to the bufmap one. Signed-off-by: Mike Marshall --- fs/orangefs/orangefs-bufmap.c | 2 +- fs/orangefs/protocol.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'fs') diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c index e3302f8d6429..c4699a164f76 100644 --- a/fs/orangefs/orangefs-bufmap.c +++ b/fs/orangefs/orangefs-bufmap.c @@ -138,7 +138,7 @@ static int get(struct slot_map *m) /* used to describe mapped buffers */ struct orangefs_bufmap_desc { - void *uaddr; /* user space address pointer */ + void __user *uaddr; /* user space address pointer */ struct page **page_array; /* array of mapped pages */ int array_count; /* size of above arrays */ struct list_head list_link; diff --git a/fs/orangefs/protocol.h b/fs/orangefs/protocol.h index 61ee8d64c842..d403cf29a99b 100644 --- a/fs/orangefs/protocol.h +++ b/fs/orangefs/protocol.h @@ -342,7 +342,7 @@ enum { * that may be 32 bit! */ struct ORANGEFS_dev_map_desc { - void *ptr; + void __user *ptr; __s32 total_size; __s32 size; __s32 count; -- cgit v1.2.3 From 8a6080f574b172f4d0916f69c52d3a157d355f9c Mon Sep 17 00:00:00 2001 From: Mike Marshall Date: Fri, 1 Jun 2018 13:18:26 -0400 Subject: orangefs: remove unused function orangefs_get_bufmap_init get_bufmap_init is used in the out-of-tree module, but was left in the upstream version as an oversight. Tip-of-the-hat to sparse and Al Viro. Signed-off-by: Mike Marshall --- fs/orangefs/orangefs-bufmap.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'fs') diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c index c4699a164f76..c4e98c9c1621 100644 --- a/fs/orangefs/orangefs-bufmap.c +++ b/fs/orangefs/orangefs-bufmap.c @@ -215,20 +215,6 @@ int orangefs_bufmap_shift_query(void) static DECLARE_WAIT_QUEUE_HEAD(bufmap_waitq); static DECLARE_WAIT_QUEUE_HEAD(readdir_waitq); -/* - * orangefs_get_bufmap_init - * - * If bufmap_init is 1, then the shared memory system, including the - * buffer_index_array, is available. Otherwise, it is not. - * - * returns the value of bufmap_init - */ -int orangefs_get_bufmap_init(void) -{ - return __orangefs_bufmap ? 1 : 0; -} - - static struct orangefs_bufmap * orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc) { -- cgit v1.2.3 From 3cf796afedbbbf880c523707e4d57ba4a1cee5d4 Mon Sep 17 00:00:00 2001 From: Mike Marshall Date: Fri, 1 Jun 2018 13:46:18 -0400 Subject: orangefs: make debug_help_fops static Signed-off-by: Mike Marshall --- fs/orangefs/orangefs-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/orangefs/orangefs-debugfs.c b/fs/orangefs/orangefs-debugfs.c index 6e35f2f3c897..0732cb08173e 100644 --- a/fs/orangefs/orangefs-debugfs.c +++ b/fs/orangefs/orangefs-debugfs.c @@ -114,7 +114,7 @@ static const struct seq_operations help_debug_ops = { .show = help_show, }; -const struct file_operations debug_help_fops = { +static const struct file_operations debug_help_fops = { .owner = THIS_MODULE, .open = orangefs_debug_help_open, .read = seq_read, -- cgit v1.2.3 From b1116bc03c00255b7e5feaed561e8bb2fc38c0f8 Mon Sep 17 00:00:00 2001 From: Mike Marshall Date: Fri, 1 Jun 2018 14:17:23 -0400 Subject: orangefs: use sparse annotations for holding locks across function calls. Sparse complained and Al Viro knew what to do... Signed-off-by: Mike Marshall --- fs/orangefs/waitqueue.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'fs') diff --git a/fs/orangefs/waitqueue.c b/fs/orangefs/waitqueue.c index 0577d6dba8c8..0729d2645d6a 100644 --- a/fs/orangefs/waitqueue.c +++ b/fs/orangefs/waitqueue.c @@ -17,8 +17,12 @@ #include "orangefs-kernel.h" #include "orangefs-bufmap.h" -static int wait_for_matching_downcall(struct orangefs_kernel_op_s *, long, bool); -static void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *); +static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op, + long timeout, + bool interruptible) + __acquires(op->lock); +static void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op) + __releases(op->lock); /* * What we do in this function is to walk the list of operations that are @@ -246,6 +250,7 @@ bool orangefs_cancel_op_in_progress(struct orangefs_kernel_op_s *op) */ static void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op) + __releases(op->lock) { /* * handle interrupted cases depending on what state we were in when @@ -313,8 +318,9 @@ static void * Returns with op->lock taken. */ static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op, - long timeout, - bool interruptible) + long timeout, + bool interruptible) + __acquires(op->lock) { long n; -- cgit v1.2.3