blob: 99e7ada448908210d5b1e569e503b09a9068822c [file] [log] [blame]
Miklos Szeredi5e183482001-10-31 14:52:35 +00001/*
2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001 Miklos Szeredi (mszeredi@inf.bme.hu)
4
5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING.
7*/
8#include "fuse_i.h"
9
Miklos Szeredi5e183482001-10-31 14:52:35 +000010#include <linux/pagemap.h>
Miklos Szeredia181e612001-11-06 12:03:23 +000011#include <linux/slab.h>
Miklos Szeredif85ab242004-01-07 12:16:45 +000012#ifdef KERNEL_2_6
13#include <linux/backing-dev.h>
Miklos Szeredi7c35cf92004-01-14 16:56:49 +000014#include <linux/writeback.h>
Miklos Szeredif85ab242004-01-07 12:16:45 +000015#endif
16
17#ifndef KERNEL_2_6
Miklos Szeredi920bab22004-01-26 14:18:43 +000018#define PageUptodate(page) Page_Uptodate(page)
19#define filemap_fdatawrite filemap_fdatasync
Miklos Szeredif85ab242004-01-07 12:16:45 +000020#endif
Miklos Szeredi5e183482001-10-31 14:52:35 +000021
Miklos Szeredi5e183482001-10-31 14:52:35 +000022static int fuse_open(struct inode *inode, struct file *file)
23{
24 struct fuse_conn *fc = INO_FC(inode);
25 struct fuse_in in = FUSE_IN_INIT;
26 struct fuse_out out = FUSE_OUT_INIT;
Miklos Szeredi43696432001-11-18 19:15:05 +000027 struct fuse_open_in inarg;
Miklos Szeredif58cc612004-02-06 13:52:00 +000028 int err;
29
30 err = generic_file_open(inode, file);
31 if(err)
32 return err;
Miklos Szeredi5e183482001-10-31 14:52:35 +000033
Miklos Szeredife25def2001-12-20 15:38:05 +000034 /* If opening the root node, no lookup has been performed on
35 it, so the attributes must be refreshed */
36 if(inode->i_ino == FUSE_ROOT_INO) {
Miklos Szeredif85ab242004-01-07 12:16:45 +000037 int err = fuse_do_getattr(inode);
Miklos Szeredife25def2001-12-20 15:38:05 +000038 if(err)
39 return err;
40 }
41
Miklos Szeredi43696432001-11-18 19:15:05 +000042 memset(&inarg, 0, sizeof(inarg));
43 inarg.flags = file->f_flags & ~O_EXCL;
44
Miklos Szeredi5e183482001-10-31 14:52:35 +000045 in.h.opcode = FUSE_OPEN;
46 in.h.ino = inode->i_ino;
Miklos Szeredi43696432001-11-18 19:15:05 +000047 in.numargs = 1;
48 in.args[0].size = sizeof(inarg);
49 in.args[0].value = &inarg;
Miklos Szeredi5e183482001-10-31 14:52:35 +000050 request_send(fc, &in, &out);
Miklos Szeredif85ab242004-01-07 12:16:45 +000051 if(!out.h.error && !(fc->flags & FUSE_KERNEL_CACHE)) {
52#ifdef KERNEL_2_6
53 invalidate_inode_pages(inode->i_mapping);
54#else
Miklos Szeredia181e612001-11-06 12:03:23 +000055 invalidate_inode_pages(inode);
Miklos Szeredif85ab242004-01-07 12:16:45 +000056#endif
57 }
Miklos Szeredi5e183482001-10-31 14:52:35 +000058
59 return out.h.error;
60}
61
Miklos Szeredic8ba2372002-12-10 12:26:00 +000062static int fuse_release(struct inode *inode, struct file *file)
63{
64 struct fuse_conn *fc = INO_FC(inode);
Miklos Szeredi383a9df2002-12-10 14:54:57 +000065 struct fuse_in *in = NULL;
Miklos Szeredi9478e862002-12-11 09:50:26 +000066 struct fuse_open_in *inarg = NULL;
Miklos Szeredi7c35cf92004-01-14 16:56:49 +000067 unsigned int s = sizeof(struct fuse_in) + sizeof(struct fuse_open_in);
Miklos Szeredic8ba2372002-12-10 12:26:00 +000068
Miklos Szeredi307242f2004-01-26 11:28:44 +000069 if(file->f_mode & FMODE_WRITE)
70 filemap_fdatawrite(inode->i_mapping);
71
Miklos Szeredi7c35cf92004-01-14 16:56:49 +000072 in = kmalloc(s, GFP_NOFS);
Miklos Szeredi383a9df2002-12-10 14:54:57 +000073 if(!in)
74 return -ENOMEM;
Miklos Szeredi7c35cf92004-01-14 16:56:49 +000075 memset(in, 0, s);
76 inarg = (struct fuse_open_in *) (in + 1);
Miklos Szeredi9478e862002-12-11 09:50:26 +000077 inarg->flags = file->f_flags & ~O_EXCL;
Miklos Szeredi383a9df2002-12-10 14:54:57 +000078
79 in->h.opcode = FUSE_RELEASE;
80 in->h.ino = inode->i_ino;
Miklos Szeredi9478e862002-12-11 09:50:26 +000081 in->numargs = 1;
82 in->args[0].size = sizeof(struct fuse_open_in);
83 in->args[0].value = inarg;
Miklos Szeredi383a9df2002-12-10 14:54:57 +000084 if(!request_send_noreply(fc, in))
Miklos Szeredic8ba2372002-12-10 12:26:00 +000085 return 0;
86
Miklos Szeredi383a9df2002-12-10 14:54:57 +000087 kfree(in);
88 return 0;
Miklos Szeredic8ba2372002-12-10 12:26:00 +000089}
90
Miklos Szeredie4cf7332003-12-12 11:53:31 +000091static int fuse_fsync(struct file *file, struct dentry *de, int datasync)
92{
Miklos Szeredi5e43f2c2003-12-12 14:06:41 +000093 struct inode *inode = de->d_inode;
94 struct fuse_conn *fc = INO_FC(inode);
95 struct fuse_in in = FUSE_IN_INIT;
96 struct fuse_out out = FUSE_OUT_INIT;
97 struct fuse_fsync_in inarg;
98
99 memset(&inarg, 0, sizeof(inarg));
100 inarg.datasync = datasync;
101
102 in.h.opcode = FUSE_FSYNC;
103 in.h.ino = inode->i_ino;
104 in.numargs = 1;
105 in.args[0].size = sizeof(inarg);
106 in.args[0].value = &inarg;
107 request_send(fc, &in, &out);
108 return out.h.error;
Miklos Szeredi7c35cf92004-01-14 16:56:49 +0000109
110 /* FIXME: need to ensure, that all write requests issued
111 before this request are completed. Should userspace take
112 care of this? */
Miklos Szeredie4cf7332003-12-12 11:53:31 +0000113}
Miklos Szeredia181e612001-11-06 12:03:23 +0000114
Miklos Szeredi5e183482001-10-31 14:52:35 +0000115static int fuse_readpage(struct file *file, struct page *page)
116{
117 struct inode *inode = page->mapping->host;
118 struct fuse_conn *fc = INO_FC(inode);
119 struct fuse_in in = FUSE_IN_INIT;
120 struct fuse_out out = FUSE_OUT_INIT;
Miklos Szeredi43696432001-11-18 19:15:05 +0000121 struct fuse_read_in inarg;
Miklos Szeredi5e183482001-10-31 14:52:35 +0000122 char *buffer;
123
124 buffer = kmap(page);
Miklos Szeredi43696432001-11-18 19:15:05 +0000125
126 memset(&inarg, 0, sizeof(inarg));
Miklos Szeredi0f48a262002-12-05 14:23:01 +0000127 inarg.offset = (unsigned long long) page->index << PAGE_CACHE_SHIFT;
Miklos Szeredi43696432001-11-18 19:15:05 +0000128 inarg.size = PAGE_CACHE_SIZE;
Miklos Szeredi5e183482001-10-31 14:52:35 +0000129
130 in.h.opcode = FUSE_READ;
131 in.h.ino = inode->i_ino;
Miklos Szeredi43696432001-11-18 19:15:05 +0000132 in.numargs = 1;
133 in.args[0].size = sizeof(inarg);
134 in.args[0].value = &inarg;
Miklos Szeredi5e183482001-10-31 14:52:35 +0000135 out.argvar = 1;
Miklos Szeredi43696432001-11-18 19:15:05 +0000136 out.numargs = 1;
137 out.args[0].size = PAGE_CACHE_SIZE;
138 out.args[0].value = buffer;
Miklos Szeredi5e183482001-10-31 14:52:35 +0000139
140 request_send(fc, &in, &out);
141 if(!out.h.error) {
Miklos Szeredi43696432001-11-18 19:15:05 +0000142 size_t outsize = out.args[0].size;
143 if(outsize < PAGE_CACHE_SIZE)
144 memset(buffer + outsize, 0, PAGE_CACHE_SIZE - outsize);
Miklos Szeredid1199f82004-02-06 15:29:22 +0000145 flush_dcache_page(page);
Miklos Szeredi5e183482001-10-31 14:52:35 +0000146 SetPageUptodate(page);
147 }
148
149 kunmap(page);
Miklos Szeredif85ab242004-01-07 12:16:45 +0000150 unlock_page(page);
Miklos Szeredi5e183482001-10-31 14:52:35 +0000151
152 return out.h.error;
153}
154
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000155static int fuse_is_block_uptodate(struct address_space *mapping,
156 struct inode *inode, size_t bl_index)
157{
158 size_t index = bl_index << FUSE_BLOCK_PAGE_SHIFT;
159 size_t end_index = ((bl_index + 1) << FUSE_BLOCK_PAGE_SHIFT) - 1;
Miklos Szeredid1199f82004-02-06 15:29:22 +0000160 size_t file_end_index = i_size_read(inode) >> PAGE_CACHE_SHIFT;
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000161
162 if (end_index > file_end_index)
163 end_index = file_end_index;
164
165 for (; index <= end_index; index++) {
166 struct page *page = find_get_page(mapping, index);
167
168 if (!page)
169 return 0;
170
Miklos Szeredif85ab242004-01-07 12:16:45 +0000171 if (!PageUptodate(page)) {
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000172 page_cache_release(page);
173 return 0;
174 }
175
176 page_cache_release(page);
177 }
178
179 return 1;
180}
181
182
183static int fuse_cache_block(struct address_space *mapping,
184 struct inode *inode, char *bl_buf,
185 size_t bl_index)
186{
187 size_t start_index = bl_index << FUSE_BLOCK_PAGE_SHIFT;
188 size_t end_index = ((bl_index + 1) << FUSE_BLOCK_PAGE_SHIFT) - 1;
Miklos Szeredid1199f82004-02-06 15:29:22 +0000189 size_t file_end_index = i_size_read(inode) >> PAGE_CACHE_SHIFT;
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000190
Michael Grigoriev37b3f3b2003-11-09 15:33:24 +0000191 int i;
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000192
193 if (end_index > file_end_index)
194 end_index = file_end_index;
195
196 for (i = 0; start_index + i <= end_index; i++) {
197 size_t index = start_index + i;
198 struct page *page;
199 char *buffer;
200
Miklos Szeredie4cf7332003-12-12 11:53:31 +0000201 page = grab_cache_page(mapping, index);
Michael Grigoriev37b3f3b2003-11-09 15:33:24 +0000202 if (!page)
203 return -1;
204
Miklos Szeredif85ab242004-01-07 12:16:45 +0000205 if (!PageUptodate(page)) {
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000206 buffer = kmap(page);
207 memcpy(buffer, bl_buf + i * PAGE_CACHE_SIZE,
208 PAGE_CACHE_SIZE);
Miklos Szeredi55a078f2004-02-06 16:08:03 +0000209 flush_dcache_page(page);
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000210 SetPageUptodate(page);
211 kunmap(page);
212 }
213
Miklos Szeredif85ab242004-01-07 12:16:45 +0000214 unlock_page(page);
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000215 page_cache_release(page);
216 }
217
Michael Grigoriev37b3f3b2003-11-09 15:33:24 +0000218 return 0;
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000219}
220
221static int fuse_file_read_block(struct inode *inode, char *bl_buf,
222 size_t bl_index)
223{
224 struct fuse_conn *fc = INO_FC(inode);
225 struct fuse_in in = FUSE_IN_INIT;
226 struct fuse_out out = FUSE_OUT_INIT;
227 struct fuse_read_in inarg;
228
229 memset(&inarg, 0, sizeof(inarg));
230 inarg.offset = bl_index << FUSE_BLOCK_SHIFT;
231 inarg.size = FUSE_BLOCK_SIZE;
232
233 in.h.opcode = FUSE_READ;
234 in.h.ino = inode->i_ino;
235 in.numargs = 1;
236 in.args[0].size = sizeof(inarg);
237 in.args[0].value = &inarg;
238 out.argvar = 1;
239 out.numargs = 1;
240 out.args[0].size = FUSE_BLOCK_SIZE;
241 out.args[0].value = bl_buf;
242
243 request_send(fc, &in, &out);
244
245 if (!out.h.error) {
246 size_t outsize = out.args[0].size;
247 if (outsize < FUSE_BLOCK_SIZE)
248 memset(bl_buf + outsize, 0, FUSE_BLOCK_SIZE - outsize);
249 }
250
251 return out.h.error;
252}
253
Miklos Szeredi307242f2004-01-26 11:28:44 +0000254static void fuse_file_bigread(struct address_space *mapping,
255 struct inode *inode, loff_t pos, size_t count)
256{
257 size_t bl_index = pos >> FUSE_BLOCK_SHIFT;
258 size_t bl_end_index = (pos + count) >> FUSE_BLOCK_SHIFT;
Miklos Szeredid1199f82004-02-06 15:29:22 +0000259 size_t bl_file_end_index = i_size_read(inode) >> FUSE_BLOCK_SHIFT;
Miklos Szeredi307242f2004-01-26 11:28:44 +0000260
261 if (bl_end_index > bl_file_end_index)
262 bl_end_index = bl_file_end_index;
263
264 while (bl_index <= bl_end_index) {
265 int res;
266 char *bl_buf = kmalloc(FUSE_BLOCK_SIZE, GFP_NOFS);
267 if (!bl_buf)
268 break;
269 res = fuse_is_block_uptodate(mapping, inode, bl_index);
270 if (!res)
271 res = fuse_file_read_block(inode, bl_buf, bl_index);
272 if (!res)
273 fuse_cache_block(mapping, inode, bl_buf, bl_index);
274 kfree(bl_buf);
275 bl_index++;
276 }
277}
278
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000279static ssize_t fuse_file_read(struct file *filp, char *buf,
280 size_t count, loff_t * ppos)
281{
282 struct address_space *mapping = filp->f_dentry->d_inode->i_mapping;
283 struct inode *inode = mapping->host;
Miklos Szeredi307242f2004-01-26 11:28:44 +0000284 struct fuse_conn *fc = INO_FC(inode);
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000285
Miklos Szeredi307242f2004-01-26 11:28:44 +0000286 if(fc->flags & FUSE_LARGE_READ)
287 fuse_file_bigread(mapping, inode, *ppos, count);
Miklos Szeredi36ca5562003-11-03 19:32:14 +0000288
289 return generic_file_read(filp, buf, count, ppos);
290}
291
Miklos Szeredia181e612001-11-06 12:03:23 +0000292static int write_buffer(struct inode *inode, struct page *page,
293 unsigned offset, size_t count)
294{
295 struct fuse_conn *fc = INO_FC(inode);
296 struct fuse_in in = FUSE_IN_INIT;
297 struct fuse_out out = FUSE_OUT_INIT;
Miklos Szeredi43696432001-11-18 19:15:05 +0000298 struct fuse_write_in inarg;
Miklos Szeredia181e612001-11-06 12:03:23 +0000299 char *buffer;
300
Miklos Szeredia181e612001-11-06 12:03:23 +0000301 buffer = kmap(page);
Miklos Szeredi43696432001-11-18 19:15:05 +0000302
303 memset(&inarg, 0, sizeof(inarg));
Miklos Szeredi0f48a262002-12-05 14:23:01 +0000304 inarg.offset = ((unsigned long long) page->index << PAGE_CACHE_SHIFT) +
305 offset;
Miklos Szeredi43696432001-11-18 19:15:05 +0000306 inarg.size = count;
Miklos Szeredia181e612001-11-06 12:03:23 +0000307
308 in.h.opcode = FUSE_WRITE;
309 in.h.ino = inode->i_ino;
Miklos Szeredi43696432001-11-18 19:15:05 +0000310 in.numargs = 2;
311 in.args[0].size = sizeof(inarg);
312 in.args[0].value = &inarg;
313 in.args[1].size = count;
314 in.args[1].value = buffer + offset;
Miklos Szeredia181e612001-11-06 12:03:23 +0000315 request_send(fc, &in, &out);
Miklos Szeredi43696432001-11-18 19:15:05 +0000316 kunmap(page);
Miklos Szeredi7c35cf92004-01-14 16:56:49 +0000317 if(out.h.error)
318 SetPageError(page);
Miklos Szeredia181e612001-11-06 12:03:23 +0000319
320 return out.h.error;
321}
322
Miklos Szeredi7c35cf92004-01-14 16:56:49 +0000323static int get_write_count(struct inode *inode, struct page *page)
Miklos Szeredia181e612001-11-06 12:03:23 +0000324{
Miklos Szeredia181e612001-11-06 12:03:23 +0000325 unsigned long end_index;
Miklos Szeredid1199f82004-02-06 15:29:22 +0000326 loff_t size = i_size_read(inode);
Miklos Szeredi7c35cf92004-01-14 16:56:49 +0000327 int count;
Miklos Szeredia181e612001-11-06 12:03:23 +0000328
Miklos Szeredid1199f82004-02-06 15:29:22 +0000329 end_index = size >> PAGE_CACHE_SHIFT;
Miklos Szeredia181e612001-11-06 12:03:23 +0000330 if(page->index < end_index)
331 count = PAGE_CACHE_SIZE;
332 else {
Miklos Szeredid1199f82004-02-06 15:29:22 +0000333 count = size & (PAGE_CACHE_SIZE - 1);
Miklos Szeredia181e612001-11-06 12:03:23 +0000334 if(page->index > end_index || count == 0)
Miklos Szeredi7c35cf92004-01-14 16:56:49 +0000335 return 0;
Miklos Szeredia181e612001-11-06 12:03:23 +0000336 }
Miklos Szeredi7c35cf92004-01-14 16:56:49 +0000337 return count;
Miklos Szeredia181e612001-11-06 12:03:23 +0000338}
339
Miklos Szeredi7c35cf92004-01-14 16:56:49 +0000340#ifdef KERNEL_2_6
341
342static void write_buffer_end(struct fuse_conn *fc, struct fuse_in *in,
343 struct fuse_out *out, void *_page)
344{
345 struct page *page = (struct page *) _page;
346
347 lock_page(page);
348 if(out->h.error) {
349 SetPageError(page);
350 if(out->h.error == -ENOSPC)
351 set_bit(AS_ENOSPC, &page->mapping->flags);
352 else
353 set_bit(AS_EIO, &page->mapping->flags);
354 }
355 end_page_writeback(page);
356 kunmap(page);
357 unlock_page(page);
358 kfree(in);
359}
360
361static int write_buffer_nonblock(struct inode *inode, struct page *page,
362 unsigned offset, size_t count)
363{
364 int err;
365 struct fuse_conn *fc = INO_FC(inode);
366 struct fuse_in *in = NULL;
367 struct fuse_out *out = NULL;
368 struct fuse_write_in *inarg = NULL;
369 char *buffer;
370 unsigned int s = sizeof(struct fuse_in) + sizeof(struct fuse_out) +
371 sizeof(struct fuse_write_in);
372
373 in = kmalloc(s, GFP_NOFS);
374 if(!in)
375 return -ENOMEM;
376 memset(in, 0, s);
377 out = (struct fuse_out *)(in + 1);
378 inarg = (struct fuse_write_in *)(out + 1);
379
380 buffer = kmap(page);
381
382 inarg->offset = ((unsigned long long) page->index << PAGE_CACHE_SHIFT) + offset;
383 inarg->size = count;
384
385 in->h.opcode = FUSE_WRITE;
386 in->h.ino = inode->i_ino;
387 in->numargs = 2;
388 in->args[0].size = sizeof(struct fuse_write_in);
389 in->args[0].value = inarg;
390 in->args[1].size = count;
391 in->args[1].value = buffer + offset;
392 err = request_send_nonblock(fc, in, out, write_buffer_end, page);
393 if(err) {
394 if(err != -EWOULDBLOCK)
395 SetPageError(page);
396 kunmap(page);
397 kfree(in);
398 }
399 return err;
400}
401
402static int fuse_writepage(struct page *page, struct writeback_control *wbc)
403{
404 int err;
405 struct inode *inode = page->mapping->host;
406 unsigned count = get_write_count(inode, page);
407
408 err = -EINVAL;
409 if(count) {
410 /* FIXME: check sync_mode, and wait for previous writes (or
411 signal userspace to do this) */
412 if(wbc->nonblocking) {
413 err = write_buffer_nonblock(inode, page, 0, count);
414 if(!err)
415 SetPageWriteback(page);
416 else if(err == -EWOULDBLOCK) {
417 __set_page_dirty_nobuffers(page);
418 err = 0;
419 }
420 } else
421 err = write_buffer(inode, page, 0, count);
422 }
423
424 unlock_page(page);
425 return err;
426}
427#else
428static int fuse_writepage(struct page *page)
429{
430 int err;
431 struct inode *inode = page->mapping->host;
432 int count = get_write_count(inode, page);
433 err = -EINVAL;
434 if(count)
435 err = write_buffer(inode, page, 0, count);
436
437 unlock_page(page);
438 return err;
439}
440#endif
Miklos Szeredia181e612001-11-06 12:03:23 +0000441
442static int fuse_prepare_write(struct file *file, struct page *page,
443 unsigned offset, unsigned to)
444{
445 /* No op */
446 return 0;
447}
448
449static int fuse_commit_write(struct file *file, struct page *page,
450 unsigned offset, unsigned to)
451{
452 int err;
453 struct inode *inode = page->mapping->host;
454
455 err = write_buffer(inode, page, offset, to - offset);
456 if(!err) {
457 loff_t pos = (page->index << PAGE_CACHE_SHIFT) + to;
Miklos Szeredid1199f82004-02-06 15:29:22 +0000458 if(pos > i_size_read(inode))
459 i_size_write(inode, pos);
Miklos Szeredia181e612001-11-06 12:03:23 +0000460 }
461 return err;
462}
463
Miklos Szeredi5e183482001-10-31 14:52:35 +0000464static struct file_operations fuse_file_operations = {
Miklos Szeredi89b86af2004-02-06 17:02:08 +0000465 .read = fuse_file_read,
466 .write = generic_file_write,
467 .mmap = generic_file_mmap,
468 .open = fuse_open,
469 .release = fuse_release,
470 .fsync = fuse_fsync,
471#ifdef KERNEL_2_6
472 .sendfile = generic_file_sendfile,
473#endif
Miklos Szeredi5e183482001-10-31 14:52:35 +0000474};
475
476static struct address_space_operations fuse_file_aops = {
Miklos Szeredie8663f32004-01-13 15:33:12 +0000477 .readpage = fuse_readpage,
478 .writepage = fuse_writepage,
479 .prepare_write = fuse_prepare_write,
480 .commit_write = fuse_commit_write,
Miklos Szeredi5e183482001-10-31 14:52:35 +0000481};
482
483void fuse_init_file_inode(struct inode *inode)
484{
Miklos Szeredi307242f2004-01-26 11:28:44 +0000485#ifdef KERNEL_2_6
486 struct fuse_conn *fc = INO_FC(inode);
487 /* Readahead somehow defeats big reads on 2.6 (says Michael
488 Grigoriev) */
489 if(fc->flags & FUSE_LARGE_READ)
490 inode->i_mapping->backing_dev_info->ra_pages = 0;
491#endif
Miklos Szeredi5e183482001-10-31 14:52:35 +0000492 inode->i_fop = &fuse_file_operations;
493 inode->i_data.a_ops = &fuse_file_aops;
Miklos Szeredi5e183482001-10-31 14:52:35 +0000494}
495
496/*
497 * Local Variables:
498 * indent-tabs-mode: t
499 * c-basic-offset: 8
500 * End:
501 */