These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / lustre / lustre / llite / rw.c
index 991d20c..f79193f 100644 (file)
@@ -277,14 +277,6 @@ int ll_commit_write(struct file *file, struct page *vmpage, unsigned from,
        return result;
 }
 
-struct obd_capa *cl_capa_lookup(struct inode *inode, enum cl_req_type crt)
-{
-       __u64 opc;
-
-       opc = crt == CRT_WRITE ? CAPA_OPC_OSS_WRITE : CAPA_OPC_OSS_RW;
-       return ll_osscapa_get(inode, opc);
-}
-
 static void ll_ra_stats_inc_sbi(struct ll_sb_info *sbi, enum ra_stat which);
 
 /**
@@ -335,6 +327,7 @@ static unsigned long ll_ra_count_get(struct ll_sb_info *sbi,
         * the RPC boundary from needing an extra read RPC. */
        if (ria->ria_pages == 0) {
                long beyond_rpc = (ria->ria_start + ret) % PTLRPC_MAX_BRW_PAGES;
+
                if (/* beyond_rpc != 0 && */ beyond_rpc < ret)
                        ret -= beyond_rpc;
        }
@@ -351,6 +344,7 @@ out:
 void ll_ra_count_put(struct ll_sb_info *sbi, unsigned long len)
 {
        struct ll_ra_info *ra = &sbi->ll_ra_info;
+
        atomic_sub(len, &ra->ra_cur_pages);
 }
 
@@ -363,6 +357,7 @@ static void ll_ra_stats_inc_sbi(struct ll_sb_info *sbi, enum ra_stat which)
 void ll_ra_stats_inc(struct address_space *mapping, enum ra_stat which)
 {
        struct ll_sb_info *sbi = ll_i2sbi(mapping->host);
+
        ll_ra_stats_inc_sbi(sbi, which);
 }
 
@@ -425,30 +420,6 @@ void ll_ra_read_ex(struct file *f, struct ll_ra_read *rar)
        spin_unlock(&ras->ras_lock);
 }
 
-static struct ll_ra_read *ll_ra_read_get_locked(struct ll_readahead_state *ras)
-{
-       struct ll_ra_read *scan;
-
-       list_for_each_entry(scan, &ras->ras_read_beads, lrr_linkage) {
-               if (scan->lrr_reader == current)
-                       return scan;
-       }
-       return NULL;
-}
-
-struct ll_ra_read *ll_ra_read_get(struct file *f)
-{
-       struct ll_readahead_state *ras;
-       struct ll_ra_read        *bead;
-
-       ras = ll_ras_get(f);
-
-       spin_lock(&ras->ras_lock);
-       bead = ll_ra_read_get_locked(ras);
-       spin_unlock(&ras->ras_lock);
-       return bead;
-}
-
 static int cl_read_ahead_page(const struct lu_env *env, struct cl_io *io,
                              struct cl_page_list *queue, struct cl_page *page,
                              struct page *vmpage)
@@ -557,6 +528,7 @@ static inline int stride_io_mode(struct ll_readahead_state *ras)
 {
        return ras->ras_consecutive_stride_requests > 1;
 }
+
 /* The function calculates how much pages will be read in
  * [off, off + length], in such stride IO area,
  * stride_offset = st_off, stride_length = st_len,
@@ -656,7 +628,7 @@ static int ll_read_ahead_pages(const struct lu_env *env,
                                                page_idx, mapping);
                        if (rc == 1) {
                                (*reserved_pages)--;
-                               count ++;
+                               count++;
                        } else if (rc == -ENOLCK)
                                break;
                } else if (stride_ria) {
@@ -890,7 +862,7 @@ static void ras_update_stride_detector(struct ll_readahead_state *ras,
        if (!stride_io_mode(ras) && (stride_gap != 0 ||
             ras->ras_consecutive_stride_requests == 0)) {
                ras->ras_stride_pages = ras->ras_consecutive_pages;
-               ras->ras_stride_length = stride_gap +ras->ras_consecutive_pages;
+               ras->ras_stride_length = stride_gap+ras->ras_consecutive_pages;
        }
        LASSERT(ras->ras_request_index == 0);
        LASSERT(ras->ras_consecutive_stride_requests == 0);
@@ -902,7 +874,7 @@ static void ras_update_stride_detector(struct ll_readahead_state *ras,
        }
 
        ras->ras_stride_pages = ras->ras_consecutive_pages;
-       ras->ras_stride_length = stride_gap +ras->ras_consecutive_pages;
+       ras->ras_stride_length = stride_gap+ras->ras_consecutive_pages;
 
        RAS_CDEBUG(ras);
        return;