Message ID | 1519822656-98961-1-git-send-email-cgxu519@icloud.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
> On 28 Feb 2018, at 20:57, Chengguang Xu <cgxu519@icloud.com> wrote: > > fix checkpatch.pl warning about 'Prefer 'unsigned int' to > bare use of 'unsigned'' > > Signed-off-by: Chengguang Xu <cgxu519@icloud.com> > --- > fs/ceph/addr.c | 14 +++++++------- > fs/ceph/cache.c | 2 +- > fs/ceph/cache.h | 4 ++-- > fs/ceph/caps.c | 24 ++++++++++++------------ > fs/ceph/ceph_frag.c | 4 ++-- > fs/ceph/dir.c | 29 +++++++++++++++-------------- > fs/ceph/file.c | 22 +++++++++++----------- > fs/ceph/inode.c | 16 ++++++++-------- > fs/ceph/ioctl.c | 4 ++-- > fs/ceph/mds_client.c | 6 +++--- > fs/ceph/super.h | 20 +++++++++++--------- > net/ceph/osdmap.c | 4 ++-- > 12 files changed, 76 insertions(+), 73 deletions(-) > > diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c > index b4336b4..56acd26 100644 > --- a/fs/ceph/addr.c > +++ b/fs/ceph/addr.c > @@ -434,7 +434,7 @@ static int start_read(struct inode *inode, struct ceph_rw_context *rw_ctx, > * the caller (VM) cleans them up. > */ > static int ceph_readpages(struct file *file, struct address_space *mapping, > - struct list_head *page_list, unsigned nr_pages) > + struct list_head *page_list, unsigned int nr_pages) > { > struct inode *inode = file_inode(file); > struct ceph_fs_client *fsc = ceph_inode_to_client(inode); > @@ -867,7 +867,7 @@ static int ceph_writepages_start(struct address_space *mapping, > stop = false; > while (!stop && index <= end) { > int num_ops = 0, op_idx; > - unsigned i, pvec_pages, max_pages, locked_pages = 0; > + unsigned int i, pvec_pages, max_pages, locked_pages = 0; > struct page **pages = NULL, **data_pages; > mempool_t *pool = NULL; /* Becomes non-null if mempool used */ > struct page *page; > @@ -1010,7 +1010,7 @@ static int ceph_writepages_start(struct address_space *mapping, > if (!locked_pages) > goto release_pvec_pages; > if (i) { > - unsigned j, n = 0; > + unsigned int j, n = 0; > /* shift unused page to beginning of pvec */ > for (j = 0; j < pvec_pages; j++) { > if (!pvec.pages[j]) > @@ -1165,7 +1165,7 @@ static int ceph_writepages_start(struct address_space *mapping, > start_index == 0 && /* all dirty pages were checked */ > !ceph_wbc.head_snapc) { > struct page *page; > - unsigned i, nr; > + unsigned int i, nr; > index = 0; > while ((index <= end) && > (nr = pagevec_lookup_tag(&pvec, mapping, &index, > @@ -1220,7 +1220,7 @@ static int context_is_writeable_or_written(struct inode *inode, > * or any failure (incl -EAGAIN) with page unlocked. > */ > static int ceph_update_writeable_page(struct file *file, > - loff_t pos, unsigned len, > + loff_t pos, unsigned int len, > struct page *page) > { > struct inode *inode = file_inode(file); > @@ -1322,7 +1322,7 @@ static int ceph_update_writeable_page(struct file *file, > * clean, or already dirty within the same snap context. > */ > static int ceph_write_begin(struct file *file, struct address_space *mapping, > - loff_t pos, unsigned len, unsigned flags, > + loff_t pos, unsigned int len, unsigned int flags, > struct page **pagep, void **fsdata) > { > struct inode *inode = file_inode(file); > @@ -1354,7 +1354,7 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping, > * except adjust dirty page accounting > */ > static int ceph_write_end(struct file *file, struct address_space *mapping, > - loff_t pos, unsigned len, unsigned copied, > + loff_t pos, unsigned int len, unsigned int copied, > struct page *page, void *fsdata) > { > struct inode *inode = file_inode(file); > diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c > index a3ab265..f9b27e0 100644 > --- a/fs/ceph/cache.c > +++ b/fs/ceph/cache.c > @@ -314,7 +314,7 @@ int ceph_readpage_from_fscache(struct inode *inode, struct page *page) > int ceph_readpages_from_fscache(struct inode *inode, > struct address_space *mapping, > struct list_head *pages, > - unsigned *nr_pages) > + unsigned int *nr_pages) > { > struct ceph_inode_info *ci = ceph_inode(inode); > int ret; > diff --git a/fs/ceph/cache.h b/fs/ceph/cache.h > index 7e72c75..84997e9 100644 > --- a/fs/ceph/cache.h > +++ b/fs/ceph/cache.h > @@ -43,7 +43,7 @@ > int ceph_readpages_from_fscache(struct inode *inode, > struct address_space *mapping, > struct list_head *pages, > - unsigned *nr_pages); > + unsigned int *nr_pages); > void ceph_readpage_to_fscache(struct inode *inode, struct page *page); > void ceph_invalidate_fscache_page(struct inode* inode, struct page *page); > > @@ -147,7 +147,7 @@ static inline int ceph_readpage_from_fscache(struct inode* inode, > static inline int ceph_readpages_from_fscache(struct inode *inode, > struct address_space *mapping, > struct list_head *pages, > - unsigned *nr_pages) > + unsigned int *nr_pages) > { > return -ENOBUFS; > } > diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c > index 6582c45..a67eef0 100644 > --- a/fs/ceph/caps.c > +++ b/fs/ceph/caps.c > @@ -522,9 +522,9 @@ static void __cap_delay_cancel(struct ceph_mds_client *mdsc, > * Common issue checks for add_cap, handle_cap_grant. > */ > static void __check_cap_issue(struct ceph_inode_info *ci, struct ceph_cap *cap, > - unsigned issued) > + unsigned int issued) > { > - unsigned had = __ceph_caps_issued(ci, NULL); > + unsigned int had = __ceph_caps_issued(ci, NULL); > > /* > * Each time we receive FILE_CACHE anew, we increment > @@ -562,8 +562,8 @@ static void __check_cap_issue(struct ceph_inode_info *ci, struct ceph_cap *cap, > */ > void ceph_add_cap(struct inode *inode, > struct ceph_mds_session *session, u64 cap_id, > - int fmode, unsigned issued, unsigned wanted, > - unsigned seq, unsigned mseq, u64 realmino, int flags, > + int fmode, unsigned int issued, unsigned int wanted, > + unsigned int seq, unsigned int mseq, u64 realmino, int flags, > struct ceph_cap **new_cap) > { > struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; > @@ -3231,7 +3231,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid, > struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; > struct ceph_cap_flush *cf, *tmp_cf; > LIST_HEAD(to_remove); > - unsigned seq = le32_to_cpu(m->seq); > + unsigned int seq = le32_to_cpu(m->seq); > int dirty = le32_to_cpu(m->dirty); > int cleaned = 0; > bool drop = false; > @@ -3437,8 +3437,8 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex, > struct ceph_cap *cap, *tcap, *new_cap = NULL; > struct ceph_inode_info *ci = ceph_inode(inode); > u64 t_cap_id; > - unsigned mseq = le32_to_cpu(ex->migrate_seq); > - unsigned t_seq, t_mseq; > + unsigned int mseq = le32_to_cpu(ex->migrate_seq); > + unsigned int t_seq, t_mseq; > int target, issued; > int mds = session->s_mds; > > @@ -3576,10 +3576,10 @@ static void handle_cap_import(struct ceph_mds_client *mdsc, > struct ceph_cap *cap, *ocap, *new_cap = NULL; > int mds = session->s_mds; > int issued; > - unsigned caps = le32_to_cpu(im->caps); > - unsigned wanted = le32_to_cpu(im->wanted); > - unsigned seq = le32_to_cpu(im->seq); > - unsigned mseq = le32_to_cpu(im->migrate_seq); > + unsigned int caps = le32_to_cpu(im->caps); > + unsigned int wanted = le32_to_cpu(im->wanted); > + unsigned int seq = le32_to_cpu(im->seq); > + unsigned int mseq = le32_to_cpu(im->migrate_seq); > u64 realmino = le64_to_cpu(im->realm); > u64 cap_id = le64_to_cpu(im->cap_id); > u64 p_cap_id; > @@ -3757,7 +3757,7 @@ void ceph_handle_caps(struct ceph_mds_session *session, > mutex_lock(&session->s_mutex); > session->s_seq++; > dout(" mds%d seq %lld cap seq %u\n", session->s_mds, session->s_seq, > - (unsigned)seq); > + (unsigned int)seq); > > if (!inode) { > dout(" i don't have ino %llx\n", vino.ino); > diff --git a/fs/ceph/ceph_frag.c b/fs/ceph/ceph_frag.c > index 6f67d5b..3779ec2 100644 > --- a/fs/ceph/ceph_frag.c > +++ b/fs/ceph/ceph_frag.c > @@ -7,8 +7,8 @@ > > int ceph_frag_compare(__u32 a, __u32 b) > { > - unsigned va = ceph_frag_value(a); > - unsigned vb = ceph_frag_value(b); > + unsigned int va = ceph_frag_value(a); > + unsigned int vb = ceph_frag_value(b); > if (va < vb) > return -1; > if (va > vb) > diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c > index 0c43468..159658d 100644 > --- a/fs/ceph/dir.c > +++ b/fs/ceph/dir.c > @@ -60,7 +60,7 @@ static int ceph_d_init(struct dentry *dentry) > #define OFFSET_BITS 28 > #define OFFSET_MASK ((1 << OFFSET_BITS) - 1) > #define HASH_ORDER (0xffull << (OFFSET_BITS + 24)) > -loff_t ceph_make_fpos(unsigned high, unsigned off, bool hash_order) > +loff_t ceph_make_fpos(unsigned int high, unsigned int off, bool hash_order) > { > loff_t fpos = ((loff_t)high << 28) | (loff_t)off; > if (hash_order) > @@ -73,17 +73,17 @@ static bool is_hash_order(loff_t p) > return (p & HASH_ORDER) == HASH_ORDER; > } > > -static unsigned fpos_frag(loff_t p) > +static unsigned int fpos_frag(loff_t p) > { > return p >> OFFSET_BITS; > } > > -static unsigned fpos_hash(loff_t p) > +static unsigned int fpos_hash(loff_t p) > { > return ceph_frag_value(fpos_frag(p)); > } > > -static unsigned fpos_off(loff_t p) > +static unsigned int fpos_off(loff_t p) > { > return p & OFFSET_MASK; > } > @@ -103,7 +103,7 @@ static int fpos_cmp(loff_t l, loff_t r) > * server. > */ > static int note_last_dentry(struct ceph_file_info *fi, const char *name, > - int len, unsigned next_offset) > + int len, unsigned int next_offset) > { > char *buf = kmalloc(len+1, GFP_KERNEL); > if (!buf) > @@ -124,7 +124,7 @@ static int note_last_dentry(struct ceph_file_info *fi, const char *name, > { > struct inode *dir = d_inode(parent); > struct dentry *dentry; > - unsigned idx_mask = (PAGE_SIZE / sizeof(struct dentry *)) - 1; > + unsigned int idx_mask = (PAGE_SIZE / sizeof(struct dentry *)) - 1; > loff_t ptr_pos = idx * sizeof(struct dentry *); > pgoff_t ptr_pgoff = ptr_pos >> PAGE_SHIFT; > > @@ -184,7 +184,8 @@ static int __dcache_readdir(struct file *file, struct dir_context *ctx, > u64 idx = 0; > int err = 0; > > - dout("__dcache_readdir %p v%u at %llx\n", dir, (unsigned)shared_gen, ctx->pos); > + dout("__dcache_readdir %p v%u at %llx\n", dir, > + (unsigned int)shared_gen, ctx->pos); > > /* search start position */ > if (ctx->pos > 2) { > @@ -306,7 +307,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx) > struct ceph_mds_client *mdsc = fsc->mdsc; > int i; > int err; > - unsigned frag = -1; > + unsigned int frag = -1; > struct ceph_mds_reply_info_parsed *rinfo; > > dout("readdir %p file %p pos %llx\n", inode, file, ctx->pos); > @@ -365,7 +366,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx) > if (is_hash_order(ctx->pos)) { > /* fragtree isn't always accurate. choose frag > * based on previous reply when possible. */ > - if (frag == (unsigned)-1) > + if (frag == (unsigned int)-1) > frag = ceph_choose_frag(ci, fpos_hash(ctx->pos), > NULL, NULL); > } else { > @@ -462,7 +463,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx) > if (rinfo->dir_nr > 0) { > struct ceph_mds_reply_dir_entry *rde = > rinfo->dir_entries + (rinfo->dir_nr-1); > - unsigned next_offset = req->r_reply_info.dir_end ? > + unsigned int next_offset = req->r_reply_info.dir_end ? > 2 : (fpos_off(rde->offset) + 1); > err = note_last_dentry(fi, rde->name, rde->name_len, > next_offset); > @@ -1201,8 +1202,8 @@ static int dir_lease_is_valid(struct inode *dir, struct dentry *dentry) > valid = __ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1); > spin_unlock(&ci->i_ceph_lock); > dout("dir_lease_is_valid dir %p v%u dentry %p v%u = %d\n", > - dir, (unsigned)atomic_read(&ci->i_shared_gen), > - dentry, (unsigned)di->lease_shared_gen, valid); > + dir, (unsigned int)atomic_read(&ci->i_shared_gen), > + dentry, (unsigned int)di->lease_shared_gen, valid); > return valid; > } > > @@ -1406,7 +1407,7 @@ static ssize_t ceph_read_dir(struct file *file, char __user *buf, size_t size, > > if (*ppos >= cf->dir_info_len) > return 0; > - size = min_t(unsigned, size, cf->dir_info_len-*ppos); > + size = min_t(unsigned int, size, cf->dir_info_len-*ppos); > left = copy_to_user(buf, cf->dir_info + *ppos, size); > if (left == size) > return -EFAULT; > @@ -1462,7 +1463,7 @@ void ceph_dentry_lru_del(struct dentry *dn) > * Return name hash for a given dentry. This is dependent on > * the parent directory's hash function. > */ > -unsigned ceph_dentry_hash(struct inode *dir, struct dentry *dn) > +unsigned int ceph_dentry_hash(struct inode *dir, struct dentry *dn) > { > struct ceph_inode_info *dci = ceph_inode(dir); > > diff --git a/fs/ceph/file.c b/fs/ceph/file.c > index 6639926..94bef4e 100644 > --- a/fs/ceph/file.c > +++ b/fs/ceph/file.c > @@ -367,7 +367,7 @@ int ceph_open(struct inode *inode, struct file *file) > * file or symlink, return 1 so the VFS can retry. > */ > int ceph_atomic_open(struct inode *dir, struct dentry *dentry, > - struct file *file, unsigned flags, umode_t mode, > + struct file *file, unsigned int flags, umode_t mode, > int *opened) > { > struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); > @@ -568,7 +568,7 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to, > ssize_t ret; > size_t len = iov_iter_count(to); > > - dout("sync_read on file %p %llu~%u %s\n", file, off, (unsigned)len, > + dout("sync_read on file %p %llu~%u %s\n", file, off, (unsigned int)len, > (file->f_flags & O_DIRECT) ? "O_DIRECT" : ""); > > if (!len) > @@ -643,7 +643,7 @@ struct ceph_aio_request { > int write; > int error; > struct list_head osd_reqs; > - unsigned num_reqs; > + unsigned int num_reqs; > atomic_t pending_reqs; > struct timespec mtime; > struct ceph_cap_flush *prealloc_cf; > @@ -852,7 +852,7 @@ static void ceph_aio_retry_work(struct work_struct *work) > return -EROFS; > > dout("sync_direct_%s on file %p %lld~%u snapc %p seq %lld\n", > - (write ? "write" : "read"), file, pos, (unsigned)count, > + (write ? "write" : "read"), file, pos, (unsigned int)count, > snapc, snapc->seq); > > ret = filemap_write_and_wait_range(inode->i_mapping, pos, pos + count); > @@ -1057,7 +1057,7 @@ static void ceph_aio_retry_work(struct work_struct *work) > return -EROFS; > > dout("sync_write on file %p %lld~%u snapc %p seq %lld\n", > - file, pos, (unsigned)count, snapc, snapc->seq); > + file, pos, (unsigned int)count, snapc, snapc->seq); > > ret = filemap_write_and_wait_range(inode->i_mapping, pos, pos + count); > if (ret < 0) > @@ -1173,7 +1173,7 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to) > > again: > dout("aio_read %p %llx.%llx %llu~%u trying to get caps on %p\n", > - inode, ceph_vinop(inode), iocb->ki_pos, (unsigned)len, inode); > + inode, ceph_vinop(inode), iocb->ki_pos, (unsigned int)len, inode); > > if (fi->fmode & CEPH_FILE_MODE_LAZY) > want = CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_LAZYIO; > @@ -1188,7 +1188,7 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to) > (fi->flags & CEPH_F_SYNC)) { > > dout("aio_sync_read %p %llx.%llx %llu~%u got cap refs on %s\n", > - inode, ceph_vinop(inode), iocb->ki_pos, (unsigned)len, > + inode, ceph_vinop(inode), iocb->ki_pos, (unsigned int)len, > ceph_cap_string(got)); > > if (ci->i_inline_version == CEPH_INLINE_NONE) { > @@ -1206,7 +1206,7 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to) > } else { > CEPH_DEFINE_RW_CONTEXT(rw_ctx, got); > dout("aio_read %p %llx.%llx %llu~%u got cap refs on %s\n", > - inode, ceph_vinop(inode), iocb->ki_pos, (unsigned)len, > + inode, ceph_vinop(inode), iocb->ki_pos, (unsigned int)len, > ceph_cap_string(got)); > ceph_add_rw_context(fi, &rw_ctx); > ret = generic_file_read_iter(iocb, to); > @@ -1426,13 +1426,13 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from) > } > > dout("aio_write %p %llx.%llx %llu~%u dropping cap refs on %s\n", > - inode, ceph_vinop(inode), pos, (unsigned)count, > + inode, ceph_vinop(inode), pos, (unsigned int)count, > ceph_cap_string(got)); > ceph_put_cap_refs(ci, got); > > if (written == -EOLDSNAPC) { > dout("aio_write %p %llx.%llx %llu~%u" "got EOLDSNAPC, retrying\n", > - inode, ceph_vinop(inode), pos, (unsigned)count); > + inode, ceph_vinop(inode), pos, (unsigned int)count); > goto retry_snap; > } > > @@ -1510,7 +1510,7 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int whence) > } > > static inline void ceph_zero_partial_page( > - struct inode *inode, loff_t offset, unsigned size) > + struct inode *inode, loff_t offset, unsigned int size) > { > struct page *page; > pgoff_t index = offset >> PAGE_SHIFT; > diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c > index c6ec5aa..fd1bd0c 100644 > --- a/fs/ceph/inode.c > +++ b/fs/ceph/inode.c > @@ -181,7 +181,7 @@ static u32 __ceph_choose_frag(struct ceph_inode_info *ci, u32 v, > { > u32 t = ceph_frag_make(0, 0); > struct ceph_inode_frag *frag; > - unsigned nway, i; > + unsigned int nway, i; > u32 n; > > if (found) > @@ -323,7 +323,7 @@ static int ceph_fill_fragtree(struct inode *inode, > struct ceph_inode_info *ci = ceph_inode(inode); > struct ceph_inode_frag *frag, *prev_frag = NULL; > struct rb_node *rb_node; > - unsigned i, split_by, nsplits; > + unsigned int i, split_by, nsplits; > u32 id; > bool update = false; > > @@ -921,7 +921,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page, > /* were we issued a capability? */ > if (info->cap.caps) { > if (ceph_snap(inode) == CEPH_NOSNAP) { > - unsigned caps = le32_to_cpu(info->cap.caps); > + unsigned int caps = le32_to_cpu(info->cap.caps); > ceph_add_cap(inode, session, > le64_to_cpu(info->cap.cap_id), > cap_fmode, caps, > @@ -1010,9 +1010,9 @@ static void update_dentry_lease(struct dentry *dentry, > struct ceph_vino *dir_vino) > { > struct ceph_dentry_info *di = ceph_dentry(dentry); > - long unsigned duration = le32_to_cpu(lease->duration_ms); > - long unsigned ttl = from_time + (duration * HZ) / 1000; > - long unsigned half_ttl = from_time + (duration * HZ / 2) / 1000; > + unsigned long duration = le32_to_cpu(lease->duration_ms); > + unsigned long ttl = from_time + (duration * HZ) / 1000; > + unsigned long half_ttl = from_time + (duration * HZ / 2) / 1000; > struct inode *dir; > struct ceph_mds_session *old_lease_session = NULL; > > @@ -1452,8 +1452,8 @@ static int fill_readdir_cache(struct inode *dir, struct dentry *dn, > struct ceph_mds_request *req) > { > struct ceph_inode_info *ci = ceph_inode(dir); > - unsigned nsize = PAGE_SIZE / sizeof(struct dentry*); > - unsigned idx = ctl->index % nsize; > + unsigned int nsize = PAGE_SIZE / sizeof(struct dentry *); > + unsigned int idx = ctl->index % nsize; > pgoff_t pgoff = ctl->index / nsize; > > if (!ctl->page || pgoff != page_index(ctl->page)) { > diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c > index 851aa69..564d6d2 100644 > --- a/fs/ceph/ioctl.c > +++ b/fs/ceph/ioctl.c > @@ -42,8 +42,8 @@ static long __validate_layout(struct ceph_mds_client *mdsc, > /* validate striping parameters */ > if ((l->object_size & ~PAGE_MASK) || > (l->stripe_unit & ~PAGE_MASK) || > - ((unsigned)l->stripe_unit != 0 && > - ((unsigned)l->object_size % (unsigned)l->stripe_unit))) > + ((unsigned int)l->stripe_unit != 0 && > + ((unsigned int)l->object_size % (unsigned int)l->stripe_unit))) > return -EINVAL; > > /* make sure it's a valid data pool */ > diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c > index 2e8f90f..43e3677a 100644 > --- a/fs/ceph/mds_client.c > +++ b/fs/ceph/mds_client.c > @@ -48,7 +48,7 @@ > struct ceph_reconnect_state { > int nr_caps; > struct ceph_pagelist *pagelist; > - unsigned msg_version; > + unsigned int msg_version; > }; > > static void __wake_requests(struct ceph_mds_client *mdsc, > @@ -1815,7 +1815,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *base, > struct dentry *temp; > char *path; > int len, pos; > - unsigned seq; > + unsigned int seq; > > if (!dentry) > return ERR_PTR(-EINVAL); > @@ -3499,7 +3499,7 @@ static void drop_leases(struct ceph_mds_client *mdsc) > static void schedule_delayed(struct ceph_mds_client *mdsc) > { > int delay = 5; > - unsigned hz = round_jiffies_relative(HZ * delay); > + unsigned int hz = round_jiffies_relative(HZ * delay); > schedule_delayed_work(&mdsc->delayed_work, hz); > } > > diff --git a/fs/ceph/super.h b/fs/ceph/super.h > index 21b2e5b..95acbef 100644 > --- a/fs/ceph/super.h > +++ b/fs/ceph/super.h > @@ -296,7 +296,7 @@ struct ceph_inode_info { > u64 i_inline_version; > u32 i_time_warp_seq; > > - unsigned i_ceph_flags; > + unsigned int i_ceph_flags; > atomic64_t i_release_count; > atomic64_t i_ordered_count; > atomic64_t i_complete_seq[2]; > @@ -320,7 +320,7 @@ struct ceph_inode_info { > * s_mutex. */ > struct rb_root i_caps; /* cap list */ > struct ceph_cap *i_auth_cap; /* authoritative cap, if any */ > - unsigned i_dirty_caps, i_flushing_caps; /* mask of dirtied fields */ > + unsigned int i_dirty_caps, i_flushing_caps; /* mask of dirtied fields */ > struct list_head i_dirty_item, i_flushing_item; > /* we need to track cap writeback on a per-cap-bit basis, to allow > * overlapping, pipelined cap flushes to the mds. we can probably > @@ -335,7 +335,7 @@ struct ceph_inode_info { > struct list_head i_cap_snaps; /* snapped state pending flush to mds */ > struct ceph_snap_context *i_head_snapc; /* set if wr_buffer_head > 0 or > dirty|flushing caps */ > - unsigned i_snap_caps; /* cap bits for snapped files */ > + unsigned int i_snap_caps; /* cap bits for snapped files */ > > int i_nr_by_mode[CEPH_FILE_MODE_BITS]; /* open file counts */ > > @@ -677,7 +677,7 @@ struct ceph_file_info { > struct ceph_mds_request *last_readdir; > > /* readdir: position within a frag */ > - unsigned next_offset; /* offset of next chunk (last_name's + 1) */ > + unsigned int next_offset; /* offset of next chunk (last_name's + 1) */ > char *last_name; /* last entry in previous chunk */ > long long dir_release_count; > long long dir_ordered_count; > @@ -957,8 +957,9 @@ extern struct ceph_cap *ceph_get_cap(struct ceph_mds_client *mdsc, > struct ceph_cap_reservation *ctx); > extern void ceph_add_cap(struct inode *inode, > struct ceph_mds_session *session, u64 cap_id, > - int fmode, unsigned issued, unsigned wanted, > - unsigned cap, unsigned seq, u64 realmino, int flags, > + int fmode, unsigned int issued, unsigned int wanted, > + unsigned int cap, unsigned int seq, > + u64 realmino, int flags, > struct ceph_cap **new_cap); > extern void __ceph_remove_cap(struct ceph_cap *cap, bool queue_release); > extern void ceph_put_cap(struct ceph_mds_client *mdsc, > @@ -1016,7 +1017,7 @@ extern int ceph_try_get_caps(struct ceph_inode_info *ci, > extern int ceph_renew_caps(struct inode *inode); > extern int ceph_open(struct inode *inode, struct file *file); > extern int ceph_atomic_open(struct inode *dir, struct dentry *dentry, > - struct file *file, unsigned flags, umode_t mode, > + struct file *file, unsigned int flags, umode_t mode, > int *opened); > extern int ceph_release(struct inode *inode, struct file *filp); > extern void ceph_fill_inline_data(struct inode *inode, struct page *locked_page, > @@ -1029,7 +1030,8 @@ extern void ceph_fill_inline_data(struct inode *inode, struct page *locked_page, > extern const struct inode_operations ceph_snapdir_iops; > extern const struct dentry_operations ceph_dentry_ops; > > -extern loff_t ceph_make_fpos(unsigned high, unsigned off, bool hash_order); > +extern loff_t ceph_make_fpos(unsigned int high, unsigned int off, > + bool hash_order); > extern int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry); > extern int ceph_handle_snapdir(struct ceph_mds_request *req, > struct dentry *dentry, int err); > @@ -1040,7 +1042,7 @@ extern struct dentry *ceph_finish_lookup(struct ceph_mds_request *req, > extern void ceph_dentry_lru_touch(struct dentry *dn); > extern void ceph_dentry_lru_del(struct dentry *dn); > extern void ceph_invalidate_dentry_lease(struct dentry *dentry); > -extern unsigned ceph_dentry_hash(struct inode *dir, struct dentry *dn); > +extern unsigned int ceph_dentry_hash(struct inode *dir, struct dentry *dn); > extern void ceph_readdir_cache_release(struct ceph_readdir_cache_control *ctl); > > /* ioctl.c */ > diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c > index 0da27c6..87c3097 100644 > --- a/net/ceph/osdmap.c > +++ b/net/ceph/osdmap.c > @@ -722,7 +722,7 @@ static void __remove_pg_pool(struct rb_root *root, struct ceph_pg_pool_info *pi) > static int decode_pool(void **p, void *end, struct ceph_pg_pool_info *pi) > { > u8 ev, cv; > - unsigned len, num; > + unsigned int len, num; > void *pool_end; > > ceph_decode_need(p, end, 2 + 4, bad); > @@ -2305,7 +2305,7 @@ static u32 raw_pg_to_pps(struct ceph_pg_pool_info *pi, > */ > return ceph_stable_mod(raw_pgid->seed, pi->pgp_num, > pi->pgp_num_mask) + > - (unsigned)raw_pgid->pool; > + (unsigned int)raw_pgid->pool; > } > } > > -- > 1.8.3.1 > Applied. Thanks Yan, Zheng -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index b4336b4..56acd26 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -434,7 +434,7 @@ static int start_read(struct inode *inode, struct ceph_rw_context *rw_ctx, * the caller (VM) cleans them up. */ static int ceph_readpages(struct file *file, struct address_space *mapping, - struct list_head *page_list, unsigned nr_pages) + struct list_head *page_list, unsigned int nr_pages) { struct inode *inode = file_inode(file); struct ceph_fs_client *fsc = ceph_inode_to_client(inode); @@ -867,7 +867,7 @@ static int ceph_writepages_start(struct address_space *mapping, stop = false; while (!stop && index <= end) { int num_ops = 0, op_idx; - unsigned i, pvec_pages, max_pages, locked_pages = 0; + unsigned int i, pvec_pages, max_pages, locked_pages = 0; struct page **pages = NULL, **data_pages; mempool_t *pool = NULL; /* Becomes non-null if mempool used */ struct page *page; @@ -1010,7 +1010,7 @@ static int ceph_writepages_start(struct address_space *mapping, if (!locked_pages) goto release_pvec_pages; if (i) { - unsigned j, n = 0; + unsigned int j, n = 0; /* shift unused page to beginning of pvec */ for (j = 0; j < pvec_pages; j++) { if (!pvec.pages[j]) @@ -1165,7 +1165,7 @@ static int ceph_writepages_start(struct address_space *mapping, start_index == 0 && /* all dirty pages were checked */ !ceph_wbc.head_snapc) { struct page *page; - unsigned i, nr; + unsigned int i, nr; index = 0; while ((index <= end) && (nr = pagevec_lookup_tag(&pvec, mapping, &index, @@ -1220,7 +1220,7 @@ static int context_is_writeable_or_written(struct inode *inode, * or any failure (incl -EAGAIN) with page unlocked. */ static int ceph_update_writeable_page(struct file *file, - loff_t pos, unsigned len, + loff_t pos, unsigned int len, struct page *page) { struct inode *inode = file_inode(file); @@ -1322,7 +1322,7 @@ static int ceph_update_writeable_page(struct file *file, * clean, or already dirty within the same snap context. */ static int ceph_write_begin(struct file *file, struct address_space *mapping, - loff_t pos, unsigned len, unsigned flags, + loff_t pos, unsigned int len, unsigned int flags, struct page **pagep, void **fsdata) { struct inode *inode = file_inode(file); @@ -1354,7 +1354,7 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping, * except adjust dirty page accounting */ static int ceph_write_end(struct file *file, struct address_space *mapping, - loff_t pos, unsigned len, unsigned copied, + loff_t pos, unsigned int len, unsigned int copied, struct page *page, void *fsdata) { struct inode *inode = file_inode(file); diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c index a3ab265..f9b27e0 100644 --- a/fs/ceph/cache.c +++ b/fs/ceph/cache.c @@ -314,7 +314,7 @@ int ceph_readpage_from_fscache(struct inode *inode, struct page *page) int ceph_readpages_from_fscache(struct inode *inode, struct address_space *mapping, struct list_head *pages, - unsigned *nr_pages) + unsigned int *nr_pages) { struct ceph_inode_info *ci = ceph_inode(inode); int ret; diff --git a/fs/ceph/cache.h b/fs/ceph/cache.h index 7e72c75..84997e9 100644 --- a/fs/ceph/cache.h +++ b/fs/ceph/cache.h @@ -43,7 +43,7 @@ int ceph_readpages_from_fscache(struct inode *inode, struct address_space *mapping, struct list_head *pages, - unsigned *nr_pages); + unsigned int *nr_pages); void ceph_readpage_to_fscache(struct inode *inode, struct page *page); void ceph_invalidate_fscache_page(struct inode* inode, struct page *page); @@ -147,7 +147,7 @@ static inline int ceph_readpage_from_fscache(struct inode* inode, static inline int ceph_readpages_from_fscache(struct inode *inode, struct address_space *mapping, struct list_head *pages, - unsigned *nr_pages) + unsigned int *nr_pages) { return -ENOBUFS; } diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 6582c45..a67eef0 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -522,9 +522,9 @@ static void __cap_delay_cancel(struct ceph_mds_client *mdsc, * Common issue checks for add_cap, handle_cap_grant. */ static void __check_cap_issue(struct ceph_inode_info *ci, struct ceph_cap *cap, - unsigned issued) + unsigned int issued) { - unsigned had = __ceph_caps_issued(ci, NULL); + unsigned int had = __ceph_caps_issued(ci, NULL); /* * Each time we receive FILE_CACHE anew, we increment @@ -562,8 +562,8 @@ static void __check_cap_issue(struct ceph_inode_info *ci, struct ceph_cap *cap, */ void ceph_add_cap(struct inode *inode, struct ceph_mds_session *session, u64 cap_id, - int fmode, unsigned issued, unsigned wanted, - unsigned seq, unsigned mseq, u64 realmino, int flags, + int fmode, unsigned int issued, unsigned int wanted, + unsigned int seq, unsigned int mseq, u64 realmino, int flags, struct ceph_cap **new_cap) { struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; @@ -3231,7 +3231,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid, struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; struct ceph_cap_flush *cf, *tmp_cf; LIST_HEAD(to_remove); - unsigned seq = le32_to_cpu(m->seq); + unsigned int seq = le32_to_cpu(m->seq); int dirty = le32_to_cpu(m->dirty); int cleaned = 0; bool drop = false; @@ -3437,8 +3437,8 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex, struct ceph_cap *cap, *tcap, *new_cap = NULL; struct ceph_inode_info *ci = ceph_inode(inode); u64 t_cap_id; - unsigned mseq = le32_to_cpu(ex->migrate_seq); - unsigned t_seq, t_mseq; + unsigned int mseq = le32_to_cpu(ex->migrate_seq); + unsigned int t_seq, t_mseq; int target, issued; int mds = session->s_mds; @@ -3576,10 +3576,10 @@ static void handle_cap_import(struct ceph_mds_client *mdsc, struct ceph_cap *cap, *ocap, *new_cap = NULL; int mds = session->s_mds; int issued; - unsigned caps = le32_to_cpu(im->caps); - unsigned wanted = le32_to_cpu(im->wanted); - unsigned seq = le32_to_cpu(im->seq); - unsigned mseq = le32_to_cpu(im->migrate_seq); + unsigned int caps = le32_to_cpu(im->caps); + unsigned int wanted = le32_to_cpu(im->wanted); + unsigned int seq = le32_to_cpu(im->seq); + unsigned int mseq = le32_to_cpu(im->migrate_seq); u64 realmino = le64_to_cpu(im->realm); u64 cap_id = le64_to_cpu(im->cap_id); u64 p_cap_id; @@ -3757,7 +3757,7 @@ void ceph_handle_caps(struct ceph_mds_session *session, mutex_lock(&session->s_mutex); session->s_seq++; dout(" mds%d seq %lld cap seq %u\n", session->s_mds, session->s_seq, - (unsigned)seq); + (unsigned int)seq); if (!inode) { dout(" i don't have ino %llx\n", vino.ino); diff --git a/fs/ceph/ceph_frag.c b/fs/ceph/ceph_frag.c index 6f67d5b..3779ec2 100644 --- a/fs/ceph/ceph_frag.c +++ b/fs/ceph/ceph_frag.c @@ -7,8 +7,8 @@ int ceph_frag_compare(__u32 a, __u32 b) { - unsigned va = ceph_frag_value(a); - unsigned vb = ceph_frag_value(b); + unsigned int va = ceph_frag_value(a); + unsigned int vb = ceph_frag_value(b); if (va < vb) return -1; if (va > vb) diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 0c43468..159658d 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -60,7 +60,7 @@ static int ceph_d_init(struct dentry *dentry) #define OFFSET_BITS 28 #define OFFSET_MASK ((1 << OFFSET_BITS) - 1) #define HASH_ORDER (0xffull << (OFFSET_BITS + 24)) -loff_t ceph_make_fpos(unsigned high, unsigned off, bool hash_order) +loff_t ceph_make_fpos(unsigned int high, unsigned int off, bool hash_order) { loff_t fpos = ((loff_t)high << 28) | (loff_t)off; if (hash_order) @@ -73,17 +73,17 @@ static bool is_hash_order(loff_t p) return (p & HASH_ORDER) == HASH_ORDER; } -static unsigned fpos_frag(loff_t p) +static unsigned int fpos_frag(loff_t p) { return p >> OFFSET_BITS; } -static unsigned fpos_hash(loff_t p) +static unsigned int fpos_hash(loff_t p) { return ceph_frag_value(fpos_frag(p)); } -static unsigned fpos_off(loff_t p) +static unsigned int fpos_off(loff_t p) { return p & OFFSET_MASK; } @@ -103,7 +103,7 @@ static int fpos_cmp(loff_t l, loff_t r) * server. */ static int note_last_dentry(struct ceph_file_info *fi, const char *name, - int len, unsigned next_offset) + int len, unsigned int next_offset) { char *buf = kmalloc(len+1, GFP_KERNEL); if (!buf) @@ -124,7 +124,7 @@ static int note_last_dentry(struct ceph_file_info *fi, const char *name, { struct inode *dir = d_inode(parent); struct dentry *dentry; - unsigned idx_mask = (PAGE_SIZE / sizeof(struct dentry *)) - 1; + unsigned int idx_mask = (PAGE_SIZE / sizeof(struct dentry *)) - 1; loff_t ptr_pos = idx * sizeof(struct dentry *); pgoff_t ptr_pgoff = ptr_pos >> PAGE_SHIFT; @@ -184,7 +184,8 @@ static int __dcache_readdir(struct file *file, struct dir_context *ctx, u64 idx = 0; int err = 0; - dout("__dcache_readdir %p v%u at %llx\n", dir, (unsigned)shared_gen, ctx->pos); + dout("__dcache_readdir %p v%u at %llx\n", dir, + (unsigned int)shared_gen, ctx->pos); /* search start position */ if (ctx->pos > 2) { @@ -306,7 +307,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx) struct ceph_mds_client *mdsc = fsc->mdsc; int i; int err; - unsigned frag = -1; + unsigned int frag = -1; struct ceph_mds_reply_info_parsed *rinfo; dout("readdir %p file %p pos %llx\n", inode, file, ctx->pos); @@ -365,7 +366,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx) if (is_hash_order(ctx->pos)) { /* fragtree isn't always accurate. choose frag * based on previous reply when possible. */ - if (frag == (unsigned)-1) + if (frag == (unsigned int)-1) frag = ceph_choose_frag(ci, fpos_hash(ctx->pos), NULL, NULL); } else { @@ -462,7 +463,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx) if (rinfo->dir_nr > 0) { struct ceph_mds_reply_dir_entry *rde = rinfo->dir_entries + (rinfo->dir_nr-1); - unsigned next_offset = req->r_reply_info.dir_end ? + unsigned int next_offset = req->r_reply_info.dir_end ? 2 : (fpos_off(rde->offset) + 1); err = note_last_dentry(fi, rde->name, rde->name_len, next_offset); @@ -1201,8 +1202,8 @@ static int dir_lease_is_valid(struct inode *dir, struct dentry *dentry) valid = __ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1); spin_unlock(&ci->i_ceph_lock); dout("dir_lease_is_valid dir %p v%u dentry %p v%u = %d\n", - dir, (unsigned)atomic_read(&ci->i_shared_gen), - dentry, (unsigned)di->lease_shared_gen, valid); + dir, (unsigned int)atomic_read(&ci->i_shared_gen), + dentry, (unsigned int)di->lease_shared_gen, valid); return valid; } @@ -1406,7 +1407,7 @@ static ssize_t ceph_read_dir(struct file *file, char __user *buf, size_t size, if (*ppos >= cf->dir_info_len) return 0; - size = min_t(unsigned, size, cf->dir_info_len-*ppos); + size = min_t(unsigned int, size, cf->dir_info_len-*ppos); left = copy_to_user(buf, cf->dir_info + *ppos, size); if (left == size) return -EFAULT; @@ -1462,7 +1463,7 @@ void ceph_dentry_lru_del(struct dentry *dn) * Return name hash for a given dentry. This is dependent on * the parent directory's hash function. */ -unsigned ceph_dentry_hash(struct inode *dir, struct dentry *dn) +unsigned int ceph_dentry_hash(struct inode *dir, struct dentry *dn) { struct ceph_inode_info *dci = ceph_inode(dir); diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 6639926..94bef4e 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -367,7 +367,7 @@ int ceph_open(struct inode *inode, struct file *file) * file or symlink, return 1 so the VFS can retry. */ int ceph_atomic_open(struct inode *dir, struct dentry *dentry, - struct file *file, unsigned flags, umode_t mode, + struct file *file, unsigned int flags, umode_t mode, int *opened) { struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); @@ -568,7 +568,7 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to, ssize_t ret; size_t len = iov_iter_count(to); - dout("sync_read on file %p %llu~%u %s\n", file, off, (unsigned)len, + dout("sync_read on file %p %llu~%u %s\n", file, off, (unsigned int)len, (file->f_flags & O_DIRECT) ? "O_DIRECT" : ""); if (!len) @@ -643,7 +643,7 @@ struct ceph_aio_request { int write; int error; struct list_head osd_reqs; - unsigned num_reqs; + unsigned int num_reqs; atomic_t pending_reqs; struct timespec mtime; struct ceph_cap_flush *prealloc_cf; @@ -852,7 +852,7 @@ static void ceph_aio_retry_work(struct work_struct *work) return -EROFS; dout("sync_direct_%s on file %p %lld~%u snapc %p seq %lld\n", - (write ? "write" : "read"), file, pos, (unsigned)count, + (write ? "write" : "read"), file, pos, (unsigned int)count, snapc, snapc->seq); ret = filemap_write_and_wait_range(inode->i_mapping, pos, pos + count); @@ -1057,7 +1057,7 @@ static void ceph_aio_retry_work(struct work_struct *work) return -EROFS; dout("sync_write on file %p %lld~%u snapc %p seq %lld\n", - file, pos, (unsigned)count, snapc, snapc->seq); + file, pos, (unsigned int)count, snapc, snapc->seq); ret = filemap_write_and_wait_range(inode->i_mapping, pos, pos + count); if (ret < 0) @@ -1173,7 +1173,7 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to) again: dout("aio_read %p %llx.%llx %llu~%u trying to get caps on %p\n", - inode, ceph_vinop(inode), iocb->ki_pos, (unsigned)len, inode); + inode, ceph_vinop(inode), iocb->ki_pos, (unsigned int)len, inode); if (fi->fmode & CEPH_FILE_MODE_LAZY) want = CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_LAZYIO; @@ -1188,7 +1188,7 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to) (fi->flags & CEPH_F_SYNC)) { dout("aio_sync_read %p %llx.%llx %llu~%u got cap refs on %s\n", - inode, ceph_vinop(inode), iocb->ki_pos, (unsigned)len, + inode, ceph_vinop(inode), iocb->ki_pos, (unsigned int)len, ceph_cap_string(got)); if (ci->i_inline_version == CEPH_INLINE_NONE) { @@ -1206,7 +1206,7 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to) } else { CEPH_DEFINE_RW_CONTEXT(rw_ctx, got); dout("aio_read %p %llx.%llx %llu~%u got cap refs on %s\n", - inode, ceph_vinop(inode), iocb->ki_pos, (unsigned)len, + inode, ceph_vinop(inode), iocb->ki_pos, (unsigned int)len, ceph_cap_string(got)); ceph_add_rw_context(fi, &rw_ctx); ret = generic_file_read_iter(iocb, to); @@ -1426,13 +1426,13 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from) } dout("aio_write %p %llx.%llx %llu~%u dropping cap refs on %s\n", - inode, ceph_vinop(inode), pos, (unsigned)count, + inode, ceph_vinop(inode), pos, (unsigned int)count, ceph_cap_string(got)); ceph_put_cap_refs(ci, got); if (written == -EOLDSNAPC) { dout("aio_write %p %llx.%llx %llu~%u" "got EOLDSNAPC, retrying\n", - inode, ceph_vinop(inode), pos, (unsigned)count); + inode, ceph_vinop(inode), pos, (unsigned int)count); goto retry_snap; } @@ -1510,7 +1510,7 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int whence) } static inline void ceph_zero_partial_page( - struct inode *inode, loff_t offset, unsigned size) + struct inode *inode, loff_t offset, unsigned int size) { struct page *page; pgoff_t index = offset >> PAGE_SHIFT; diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index c6ec5aa..fd1bd0c 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -181,7 +181,7 @@ static u32 __ceph_choose_frag(struct ceph_inode_info *ci, u32 v, { u32 t = ceph_frag_make(0, 0); struct ceph_inode_frag *frag; - unsigned nway, i; + unsigned int nway, i; u32 n; if (found) @@ -323,7 +323,7 @@ static int ceph_fill_fragtree(struct inode *inode, struct ceph_inode_info *ci = ceph_inode(inode); struct ceph_inode_frag *frag, *prev_frag = NULL; struct rb_node *rb_node; - unsigned i, split_by, nsplits; + unsigned int i, split_by, nsplits; u32 id; bool update = false; @@ -921,7 +921,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page, /* were we issued a capability? */ if (info->cap.caps) { if (ceph_snap(inode) == CEPH_NOSNAP) { - unsigned caps = le32_to_cpu(info->cap.caps); + unsigned int caps = le32_to_cpu(info->cap.caps); ceph_add_cap(inode, session, le64_to_cpu(info->cap.cap_id), cap_fmode, caps, @@ -1010,9 +1010,9 @@ static void update_dentry_lease(struct dentry *dentry, struct ceph_vino *dir_vino) { struct ceph_dentry_info *di = ceph_dentry(dentry); - long unsigned duration = le32_to_cpu(lease->duration_ms); - long unsigned ttl = from_time + (duration * HZ) / 1000; - long unsigned half_ttl = from_time + (duration * HZ / 2) / 1000; + unsigned long duration = le32_to_cpu(lease->duration_ms); + unsigned long ttl = from_time + (duration * HZ) / 1000; + unsigned long half_ttl = from_time + (duration * HZ / 2) / 1000; struct inode *dir; struct ceph_mds_session *old_lease_session = NULL; @@ -1452,8 +1452,8 @@ static int fill_readdir_cache(struct inode *dir, struct dentry *dn, struct ceph_mds_request *req) { struct ceph_inode_info *ci = ceph_inode(dir); - unsigned nsize = PAGE_SIZE / sizeof(struct dentry*); - unsigned idx = ctl->index % nsize; + unsigned int nsize = PAGE_SIZE / sizeof(struct dentry *); + unsigned int idx = ctl->index % nsize; pgoff_t pgoff = ctl->index / nsize; if (!ctl->page || pgoff != page_index(ctl->page)) { diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index 851aa69..564d6d2 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c @@ -42,8 +42,8 @@ static long __validate_layout(struct ceph_mds_client *mdsc, /* validate striping parameters */ if ((l->object_size & ~PAGE_MASK) || (l->stripe_unit & ~PAGE_MASK) || - ((unsigned)l->stripe_unit != 0 && - ((unsigned)l->object_size % (unsigned)l->stripe_unit))) + ((unsigned int)l->stripe_unit != 0 && + ((unsigned int)l->object_size % (unsigned int)l->stripe_unit))) return -EINVAL; /* make sure it's a valid data pool */ diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 2e8f90f..43e3677a 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -48,7 +48,7 @@ struct ceph_reconnect_state { int nr_caps; struct ceph_pagelist *pagelist; - unsigned msg_version; + unsigned int msg_version; }; static void __wake_requests(struct ceph_mds_client *mdsc, @@ -1815,7 +1815,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *base, struct dentry *temp; char *path; int len, pos; - unsigned seq; + unsigned int seq; if (!dentry) return ERR_PTR(-EINVAL); @@ -3499,7 +3499,7 @@ static void drop_leases(struct ceph_mds_client *mdsc) static void schedule_delayed(struct ceph_mds_client *mdsc) { int delay = 5; - unsigned hz = round_jiffies_relative(HZ * delay); + unsigned int hz = round_jiffies_relative(HZ * delay); schedule_delayed_work(&mdsc->delayed_work, hz); } diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 21b2e5b..95acbef 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -296,7 +296,7 @@ struct ceph_inode_info { u64 i_inline_version; u32 i_time_warp_seq; - unsigned i_ceph_flags; + unsigned int i_ceph_flags; atomic64_t i_release_count; atomic64_t i_ordered_count; atomic64_t i_complete_seq[2]; @@ -320,7 +320,7 @@ struct ceph_inode_info { * s_mutex. */ struct rb_root i_caps; /* cap list */ struct ceph_cap *i_auth_cap; /* authoritative cap, if any */ - unsigned i_dirty_caps, i_flushing_caps; /* mask of dirtied fields */ + unsigned int i_dirty_caps, i_flushing_caps; /* mask of dirtied fields */ struct list_head i_dirty_item, i_flushing_item; /* we need to track cap writeback on a per-cap-bit basis, to allow * overlapping, pipelined cap flushes to the mds. we can probably @@ -335,7 +335,7 @@ struct ceph_inode_info { struct list_head i_cap_snaps; /* snapped state pending flush to mds */ struct ceph_snap_context *i_head_snapc; /* set if wr_buffer_head > 0 or dirty|flushing caps */ - unsigned i_snap_caps; /* cap bits for snapped files */ + unsigned int i_snap_caps; /* cap bits for snapped files */ int i_nr_by_mode[CEPH_FILE_MODE_BITS]; /* open file counts */ @@ -677,7 +677,7 @@ struct ceph_file_info { struct ceph_mds_request *last_readdir; /* readdir: position within a frag */ - unsigned next_offset; /* offset of next chunk (last_name's + 1) */ + unsigned int next_offset; /* offset of next chunk (last_name's + 1) */ char *last_name; /* last entry in previous chunk */ long long dir_release_count; long long dir_ordered_count; @@ -957,8 +957,9 @@ extern struct ceph_cap *ceph_get_cap(struct ceph_mds_client *mdsc, struct ceph_cap_reservation *ctx); extern void ceph_add_cap(struct inode *inode, struct ceph_mds_session *session, u64 cap_id, - int fmode, unsigned issued, unsigned wanted, - unsigned cap, unsigned seq, u64 realmino, int flags, + int fmode, unsigned int issued, unsigned int wanted, + unsigned int cap, unsigned int seq, + u64 realmino, int flags, struct ceph_cap **new_cap); extern void __ceph_remove_cap(struct ceph_cap *cap, bool queue_release); extern void ceph_put_cap(struct ceph_mds_client *mdsc, @@ -1016,7 +1017,7 @@ extern int ceph_try_get_caps(struct ceph_inode_info *ci, extern int ceph_renew_caps(struct inode *inode); extern int ceph_open(struct inode *inode, struct file *file); extern int ceph_atomic_open(struct inode *dir, struct dentry *dentry, - struct file *file, unsigned flags, umode_t mode, + struct file *file, unsigned int flags, umode_t mode, int *opened); extern int ceph_release(struct inode *inode, struct file *filp); extern void ceph_fill_inline_data(struct inode *inode, struct page *locked_page, @@ -1029,7 +1030,8 @@ extern void ceph_fill_inline_data(struct inode *inode, struct page *locked_page, extern const struct inode_operations ceph_snapdir_iops; extern const struct dentry_operations ceph_dentry_ops; -extern loff_t ceph_make_fpos(unsigned high, unsigned off, bool hash_order); +extern loff_t ceph_make_fpos(unsigned int high, unsigned int off, + bool hash_order); extern int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry); extern int ceph_handle_snapdir(struct ceph_mds_request *req, struct dentry *dentry, int err); @@ -1040,7 +1042,7 @@ extern struct dentry *ceph_finish_lookup(struct ceph_mds_request *req, extern void ceph_dentry_lru_touch(struct dentry *dn); extern void ceph_dentry_lru_del(struct dentry *dn); extern void ceph_invalidate_dentry_lease(struct dentry *dentry); -extern unsigned ceph_dentry_hash(struct inode *dir, struct dentry *dn); +extern unsigned int ceph_dentry_hash(struct inode *dir, struct dentry *dn); extern void ceph_readdir_cache_release(struct ceph_readdir_cache_control *ctl); /* ioctl.c */ diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 0da27c6..87c3097 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c @@ -722,7 +722,7 @@ static void __remove_pg_pool(struct rb_root *root, struct ceph_pg_pool_info *pi) static int decode_pool(void **p, void *end, struct ceph_pg_pool_info *pi) { u8 ev, cv; - unsigned len, num; + unsigned int len, num; void *pool_end; ceph_decode_need(p, end, 2 + 4, bad); @@ -2305,7 +2305,7 @@ static u32 raw_pg_to_pps(struct ceph_pg_pool_info *pi, */ return ceph_stable_mod(raw_pgid->seed, pi->pgp_num, pi->pgp_num_mask) + - (unsigned)raw_pgid->pool; + (unsigned int)raw_pgid->pool; } }
fix checkpatch.pl warning about 'Prefer 'unsigned int' to bare use of 'unsigned'' Signed-off-by: Chengguang Xu <cgxu519@icloud.com> --- fs/ceph/addr.c | 14 +++++++------- fs/ceph/cache.c | 2 +- fs/ceph/cache.h | 4 ++-- fs/ceph/caps.c | 24 ++++++++++++------------ fs/ceph/ceph_frag.c | 4 ++-- fs/ceph/dir.c | 29 +++++++++++++++-------------- fs/ceph/file.c | 22 +++++++++++----------- fs/ceph/inode.c | 16 ++++++++-------- fs/ceph/ioctl.c | 4 ++-- fs/ceph/mds_client.c | 6 +++--- fs/ceph/super.h | 20 +++++++++++--------- net/ceph/osdmap.c | 4 ++-- 12 files changed, 76 insertions(+), 73 deletions(-)