~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to fs/splice.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
        .get = generic_pipe_buf_get,
163
163
};
164
164
 
 
165
static void wakeup_pipe_readers(struct pipe_inode_info *pipe)
 
166
{
 
167
        smp_mb();
 
168
        if (waitqueue_active(&pipe->wait))
 
169
                wake_up_interruptible(&pipe->wait);
 
170
        kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
 
171
}
 
172
 
165
173
/**
166
174
 * splice_to_pipe - fill passed data into a pipe
167
175
 * @pipe:       pipe to fill
247
255
 
248
256
        pipe_unlock(pipe);
249
257
 
250
 
        if (do_wakeup) {
251
 
                smp_mb();
252
 
                if (waitqueue_active(&pipe->wait))
253
 
                        wake_up_interruptible(&pipe->wait);
254
 
                kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
255
 
        }
 
258
        if (do_wakeup)
 
259
                wakeup_pipe_readers(pipe);
256
260
 
257
261
        while (page_nr < spd_pages)
258
262
                spd->spd_release(spd, page_nr++);
259
263
 
260
264
        return ret;
261
265
}
262
 
EXPORT_SYMBOL_GPL(splice_to_pipe);
263
266
 
264
267
static void spd_release_page(struct splice_pipe_desc *spd, unsigned int i)
265
268
{
1895
1898
        /*
1896
1899
         * If we put data in the output pipe, wakeup any potential readers.
1897
1900
         */
1898
 
        if (ret > 0) {
1899
 
                smp_mb();
1900
 
                if (waitqueue_active(&opipe->wait))
1901
 
                        wake_up_interruptible(&opipe->wait);
1902
 
                kill_fasync(&opipe->fasync_readers, SIGIO, POLL_IN);
1903
 
        }
 
1901
        if (ret > 0)
 
1902
                wakeup_pipe_readers(opipe);
 
1903
 
1904
1904
        if (input_wakeup)
1905
1905
                wakeup_pipe_writers(ipipe);
1906
1906
 
1979
1979
        /*
1980
1980
         * If we put data in the output pipe, wakeup any potential readers.
1981
1981
         */
1982
 
        if (ret > 0) {
1983
 
                smp_mb();
1984
 
                if (waitqueue_active(&opipe->wait))
1985
 
                        wake_up_interruptible(&opipe->wait);
1986
 
                kill_fasync(&opipe->fasync_readers, SIGIO, POLL_IN);
1987
 
        }
 
1982
        if (ret > 0)
 
1983
                wakeup_pipe_readers(opipe);
1988
1984
 
1989
1985
        return ret;
1990
1986
}