Skip to content

Commit 84d0215

Browse files
committed
Orangefs: sooth most sparse complaints
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
1 parent 2c590d5 commit 84d0215

11 files changed

Lines changed: 33 additions & 30 deletions

File tree

‎fs/orangefs/devpvfs2-req.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ static unsigned long translate_dev_map26(unsigned long args, long *error)
857857
*/
858858
struct PVFS_dev_map_desc __user *p =
859859
compat_alloc_user_space(sizeof(*p));
860-
u32 addr;
860+
compat_uptr_t addr;
861861

862862
*error = 0;
863863
/* get the ptr from the 32 bit user-space */

‎fs/orangefs/file.c‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ static ssize_t pvfs2_file_write_iter(struct kiocb *iocb, struct iov_iter *iter)
799799
/*
800800
* Perform a miscellaneous operation on a file.
801801
*/
802-
long pvfs2_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
802+
static long pvfs2_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
803803
{
804804
int ret = -ENOTTY;
805805
__u64 val = 0;
@@ -885,7 +885,7 @@ static int pvfs2_file_mmap(struct file *file, struct vm_area_struct *vma)
885885
*
886886
* \note Not called when each file is closed.
887887
*/
888-
int pvfs2_file_release(struct inode *inode, struct file *file)
888+
static int pvfs2_file_release(struct inode *inode, struct file *file)
889889
{
890890
gossip_debug(GOSSIP_FILE_DEBUG,
891891
"pvfs2_file_release: called on %s\n",
@@ -909,7 +909,10 @@ int pvfs2_file_release(struct inode *inode, struct file *file)
909909
/*
910910
* Push all data for a specific file onto permanent storage.
911911
*/
912-
int pvfs2_fsync(struct file *file, loff_t start, loff_t end, int datasync)
912+
static int pvfs2_fsync(struct file *file,
913+
loff_t start,
914+
loff_t end,
915+
int datasync)
913916
{
914917
int ret = -EINVAL;
915918
struct pvfs2_inode_s *pvfs2_inode =
@@ -947,7 +950,7 @@ int pvfs2_fsync(struct file *file, loff_t start, loff_t end, int datasync)
947950
* Future upgrade could support SEEK_DATA and SEEK_HOLE but would
948951
* require much changes to the FS
949952
*/
950-
loff_t pvfs2_file_llseek(struct file *file, loff_t offset, int origin)
953+
static loff_t pvfs2_file_llseek(struct file *file, loff_t offset, int origin)
951954
{
952955
int ret = -EINVAL;
953956
struct inode *inode = file->f_path.dentry->d_inode;
@@ -989,7 +992,7 @@ loff_t pvfs2_file_llseek(struct file *file, loff_t offset, int origin)
989992
* Support local locks (locks that only this kernel knows about)
990993
* if Orangefs was mounted -o local_lock.
991994
*/
992-
int pvfs2_lock(struct file *filp, int cmd, struct file_lock *fl)
995+
static int pvfs2_lock(struct file *filp, int cmd, struct file_lock *fl)
993996
{
994997
int rc = -ENOLCK;
995998

‎fs/orangefs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static int read_one_page(struct page *page)
3333
loff_t blockptr_offset = (((loff_t) page->index) << blockbits);
3434

3535
bytes_read = pvfs2_inode_read(inode,
36-
page_data,
36+
(char __user *) page_data,
3737
blocksize,
3838
&blockptr_offset,
3939
inode->i_size);

‎fs/orangefs/protocol.h‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ __s32 PINT_non_errno_mapping[] = { \
341341
extern __s32 PINT_errno_mapping[]; \
342342
extern __s32 PINT_non_errno_mapping[]; \
343343
extern const char *PINT_non_errno_strerror_mapping[]; \
344-
__s32 PVFS_get_errno_mapping(__s32 error) \
344+
static __s32 PVFS_get_errno_mapping(__s32 error) \
345345
{ \
346346
__s32 ret = error, mask = 0; \
347347
__s32 positive = ((error > -1) ? 1 : 0); \
@@ -364,16 +364,6 @@ __s32 PVFS_get_errno_mapping(__s32 error) \
364364
} \
365365
return ret; \
366366
} \
367-
__s32 PVFS_errno_to_error(int err) \
368-
{ \
369-
__s32 e = 0; \
370-
\
371-
for (; e < PVFS_ERRNO_MAX; ++e) \
372-
if (PINT_errno_mapping[e] == err) \
373-
return e | PVFS_ERROR_BIT; \
374-
\
375-
return err; \
376-
} \
377367
DECLARE_ERRNO_MAPPING()
378368

379369
/* permission bits */

‎fs/orangefs/pvfs2-bufmap.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
DECLARE_WAIT_QUEUE_HEAD(pvfs2_bufmap_init_waitq);
1111

12-
struct pvfs2_bufmap {
12+
static struct pvfs2_bufmap {
1313
atomic_t refcnt;
1414

1515
int desc_size;
@@ -663,6 +663,7 @@ int pvfs_bufmap_copy_iovec_from_kernel(struct pvfs2_bufmap *bufmap,
663663
int to_page_index = 0;
664664
void *to_kaddr = NULL;
665665
void *from_kaddr = NULL;
666+
struct kvec *iv = NULL;
666667
struct iovec *copied_iovec = NULL;
667668
struct pvfs_bufmap_desc *to;
668669
unsigned int seg;
@@ -708,9 +709,10 @@ int pvfs_bufmap_copy_iovec_from_kernel(struct pvfs2_bufmap *bufmap,
708709
* buffer into the mapped buffer one page at a time though
709710
*/
710711
while (amt_copied < size) {
711-
struct iovec *iv = &copied_iovec[seg];
712712
int inc_to_page_index;
713713

714+
iv = (struct kvec *) &copied_iovec[seg];
715+
714716
if (iv->iov_len < (PAGE_SIZE - to_page_offset)) {
715717
cur_copy_size =
716718
PVFS_util_min(iv->iov_len, size - amt_copied);
@@ -885,6 +887,7 @@ int pvfs_bufmap_copy_to_kernel_iovec(struct pvfs2_bufmap *bufmap,
885887
int from_page_index = 0;
886888
void *from_kaddr = NULL;
887889
void *to_kaddr = NULL;
890+
struct kvec *iv;
888891
struct iovec *copied_iovec = NULL;
889892
struct pvfs_bufmap_desc *from;
890893
unsigned int seg;
@@ -930,9 +933,10 @@ int pvfs_bufmap_copy_to_kernel_iovec(struct pvfs2_bufmap *bufmap,
930933
* but make sure that we do so one page at a time.
931934
*/
932935
while (amt_copied < size) {
933-
struct iovec *iv = &copied_iovec[seg];
934936
int inc_from_page_index;
935937

938+
iv = (struct kvec *) &copied_iovec[seg];
939+
936940
if (iv->iov_len < (PAGE_SIZE - from_page_offset)) {
937941
cur_copy_size =
938942
PVFS_util_min(iv->iov_len, size - amt_copied);

‎fs/orangefs/pvfs2-debugfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static const struct seq_operations help_debug_ops = {
7070
* Used to protect data in ORANGEFS_KMOD_DEBUG_FILE and
7171
* ORANGEFS_KMOD_DEBUG_FILE.
7272
*/
73-
DEFINE_MUTEX(orangefs_debug_lock);
73+
static DEFINE_MUTEX(orangefs_debug_lock);
7474

7575
int orangefs_debug_open(struct inode *, struct file *);
7676

‎fs/orangefs/pvfs2-kernel.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ struct inode *pvfs2_iget(struct super_block *sb,
608608
struct pvfs2_object_kref *ref);
609609

610610
ssize_t pvfs2_inode_read(struct inode *inode,
611-
char *buf,
611+
char __user *buf,
612612
size_t count,
613613
loff_t *offset,
614614
loff_t readahead_size);

‎fs/orangefs/pvfs2-mod.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ struct client_debug_mask client_debug_mask = { NULL, 0, 0 };
4747
unsigned int kernel_mask_set_mod_init; /* implicitly false */
4848
int op_timeout_secs = PVFS2_DEFAULT_OP_TIMEOUT_SECS;
4949
int slot_timeout_secs = PVFS2_DEFAULT_SLOT_TIMEOUT_SECS;
50-
__u32 DEBUG_LINE = 50;
5150

5251
MODULE_LICENSE("GPL");
5352
MODULE_AUTHOR("PVFS2 Development Team");

‎fs/orangefs/pvfs2-sysfs.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ static ssize_t int_store(struct orangefs_obj *orangefs_obj,
750750
/*
751751
* obtain attribute values from userspace with a service operation.
752752
*/
753-
int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
753+
static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
754754
{
755755
struct pvfs2_kernel_op_s *new_op = NULL;
756756
int rc = 0;
@@ -1023,7 +1023,7 @@ static ssize_t
10231023
* We want to return 1 if we think everything went OK, and
10241024
* EINVAL if not.
10251025
*/
1026-
int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
1026+
static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
10271027
{
10281028
struct pvfs2_kernel_op_s *new_op = NULL;
10291029
int val = 0;

‎fs/orangefs/super.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static void pvfs2_dirty_inode(struct inode *inode, int flags)
269269
SetAtimeFlag(pvfs2_inode);
270270
}
271271

272-
struct super_operations pvfs2_s_ops = {
272+
static const struct super_operations pvfs2_s_ops = {
273273
.alloc_inode = pvfs2_alloc_inode,
274274
.destroy_inode = pvfs2_destroy_inode,
275275
.dirty_inode = pvfs2_dirty_inode,
@@ -279,7 +279,7 @@ struct super_operations pvfs2_s_ops = {
279279
.show_options = generic_show_options,
280280
};
281281

282-
struct dentry *pvfs2_fh_to_dentry(struct super_block *sb,
282+
static struct dentry *pvfs2_fh_to_dentry(struct super_block *sb,
283283
struct fid *fid,
284284
int fh_len,
285285
int fh_type)
@@ -299,7 +299,7 @@ struct dentry *pvfs2_fh_to_dentry(struct super_block *sb,
299299
return d_obtain_alias(pvfs2_iget(sb, &refn));
300300
}
301301

302-
int pvfs2_encode_fh(struct inode *inode,
302+
static int pvfs2_encode_fh(struct inode *inode,
303303
__u32 *fh,
304304
int *max_len,
305305
struct inode *parent)
@@ -347,7 +347,7 @@ static struct export_operations pvfs2_export_ops = {
347347
.fh_to_dentry = pvfs2_fh_to_dentry,
348348
};
349349

350-
int pvfs2_fill_sb(struct super_block *sb, void *data, int silent)
350+
static int pvfs2_fill_sb(struct super_block *sb, void *data, int silent)
351351
{
352352
int ret = -EINVAL;
353353
struct inode *root = NULL;

0 commit comments

Comments
 (0)