Messages in this thread | | | Subject | Re: [PATCH 4/11] FUSE - read-only operations | From | Miklos Szeredi <> | Date | Tue, 11 Jan 2005 00:03:14 +0100 |
| |
> > +static inline unsigned long time_to_jiffies(unsigned long sec, > > + unsigned long nsec) > > +{ > > + /* prevent wrapping of jiffies */ > > + if (sec + 1 >= LONG_MAX / HZ) > > + return 0; > > + > > + return jiffies + sec * HZ + nsec / (1000000000 / HZ); > > +} > > Use timespec_to_jiffies ?
OK.
> > + > > + req = fuse_get_request(fc); > > + if (!req) > > + return -ERESTARTNOINTR; > > Is this trying to restart the action over and over if the system is low > on memory?
No, memory is not allocated in fuse_get_request(). Rather it returns an unused preallocated request. If there are no unused requests it will block. If interrupted it will return NULL.
> This else clause would be better to use vfs_permission().
Later patch will introduce mount option that does exactly this. The default behavior is deliberately more liberal than generic_permission().
> > + link = read_link(dentry); > > + ret = vfs_follow_link(nd, link); > > + free_link(link); > > + return ret; > > +} > > If you don't have to do magic for follow_link, please use the recently > added interface that is stack friendly. See: > http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.7-rc1/2.6.7-rc1-mm1/broken-out/SL0-core-RC6-bk5.patch
OK. I didn't know this.
Thanks, Miklos - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |